-
Notifications
You must be signed in to change notification settings - Fork 4
Docs API #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
nradakovic
wants to merge
1
commit into
main
Choose a base branch
from
nira_add_sphinx_docs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+82
−1
Draft
Docs API #21
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| Extension API | ||
| ============= | ||
|
|
||
| This page documents the Bazel *module extension* that provisions GCC toolchains and (optionally) related | ||
| software development packages (SDP archives) via ``http_archive``. | ||
|
|
||
| Scope | ||
| ----- | ||
|
|
||
| The extension provides: | ||
|
|
||
| - A module extension named ``gcc``. | ||
| - Two tag classes: | ||
| - ``toolchain``: declares a toolchain repository and its configuration. | ||
| - ``sdp``: declares an archive (tarball) containing toolchain binaries and metadata needed for repository setup. | ||
|
|
||
| Where it lives | ||
| -------------- | ||
|
|
||
| The implementation is a Starlark module extension defined in a ``.bzl`` file and exported as:: | ||
|
|
||
| gcc = module_extension(...) | ||
|
|
||
| Tag classes | ||
| ----------- | ||
|
|
||
| toolchain | ||
| ~~~~~~~~~ | ||
|
|
||
| Defines a toolchain repository and how it should be provisioned (default package, custom SDP, or system toolchain). | ||
|
|
||
| **Required attributes** | ||
| - ``name`` (string): Toolchain repo name. | ||
| - ``target_cpu`` (string): Target CPU. Allowed: ``x86_64``, ``aarch64``. | ||
| - ``target_os`` (string): Target OS. Allowed: ``linux``, ``qnx``. | ||
|
|
||
| **Optional attributes** | ||
| - ``sdp_to_link`` (string): Name of the SDP package repo to link to this toolchain. | ||
| - ``use_default_package`` (bool): Use the default package from the version matrix. | ||
| - ``use_system_toolchain`` (bool): If true, do not download/link SDP archives (system toolchain mode). | ||
| - ``runtime_ecosystem`` (string): Runtime ecosystem identifier (default ``posix``). | ||
| - ``version`` (string): GCC toolchain version. | ||
| - ``license_info_url`` (string): URL of the license server (used for QNX flows). | ||
| - ``license_info_variable`` (string): Environment variable name for license info (used for QNX flows). | ||
| - ``sdp_version`` (string): SDP version (default ``8.0.0``; used for QNX SDP selection). | ||
| - ``license_path`` (string): Path to shared license file (default ``/opt/score_qnx/license/licenses``). | ||
| - ``extra_compile_flags`` (list of strings): Additional compiler flags. | ||
| - ``extra_link_flags`` (list of strings): Additional linker flags. | ||
|
|
||
| sdp | ||
| ~~~ | ||
|
|
||
| Defines an archive (tarball) that can be fetched via ``http_archive`` to provide toolchain binaries. | ||
|
|
||
| **Optional attributes** | ||
| - ``name`` (string): Package name. If empty, the extension may derive one depending on usage patterns. | ||
| - ``build_file`` (string): Path to the BUILD file used when creating the repository. | ||
| - ``url`` (string): Archive URL. | ||
| - ``strip_prefix`` (string): Prefix to strip when extracting. | ||
| - ``sha256`` (string): Archive checksum. | ||
|
|
||
| Behavior | ||
| -------- | ||
|
|
||
| The extension gathers tags from the root module (non-root usage is rejected). | ||
|
|
||
| Provisioning logic summary: | ||
|
|
||
| - ``sdp`` tags are translated into ``http_archive(...)`` invocations. | ||
| - ``toolchain`` tags create a toolchain repository via ``gcc_toolchain(...)``. | ||
| - If ``use_system_toolchain`` is true, the extension skips SDP linking for that toolchain. | ||
| - If ``use_default_package`` is true, the extension derives an SDP archive from ``VERSION_MATRIX`` and links it. | ||
|
|
||
| Implementation reference | ||
| ------------------------ | ||
|
|
||
| If you keep the extension implementation in your repository, include it directly so documentation stays in sync: | ||
|
|
||
| .. literalinclude:: ../path/to/gcc_extension.bzl | ||
| :language: python | ||
| :linenos: | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -15,7 +15,7 @@ | |||||
| Bazel C/C++ Toolchain Config Documentation | ||||||
| ============================ | ||||||
|
|
||||||
| TBD | ||||||
| Welcome to Bazel C/C++ Toolchain Config documentation. This repository containts Bazel toolchain configurations for different platforms used within S-CORE modules. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| .. contents:: Table of Contents | ||||||
| :depth: 2 | ||||||
|
|
||||||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean with "flows" here? Do you mean QNX "toolchains" or "flavors"? Or "workflows"?
But if it is meant to be used in workflows then it would be good to inject that parameter from the outside via command line parameter / bazelrc / environment variable because this kind of thing should not be baked into the module file, but is something determined by the execution environment. E.g. at ETAS we might have a different license server than at BMW.