commit | 274faad856899f1e880c842687c996fa877a8b45 | [log] [tgz] |
---|---|---|
author | David 'Digit' Turner <digit@google.com> | Mon Dec 09 14:14:37 2024 +0000 |
committer | CQ Bot <fuchsia-internal-scoped@luci-project-accounts.iam.gserviceaccount.com> | Mon Dec 09 14:14:37 2024 +0000 |
tree | a31148a7ef874e543911a09c3526919a254f1191 | |
parent | 0ebebaff9f1f0f4b48325c9d63fddda924cd8da7 [diff] |
[bazel_sdk] Add `use_rules_fuchsia` attribute to `fuchsia_sdk_repository()`. Add a new boolean attribute to the `fuchsia_sdk_repository()` rule to ensure that the generated BUILD.bazel files it contains use `@rules_fuchsia//...` instead of `@fuchsia_sdk/...` to load Bazel SDK rules. It also ensures that the @fuchsia_sdk//fuchsia:foo.bzl files re-export symbols from @rules_fuchsia/... instead of //fuchsia/... in order to ensure backwards compatibility for client BUILD files that still load the rules from @fuchsia_sdk. A few special cases are still preserved to ensure backwards compatibility and avoid breaking the build. For example: - @fuchsia_sdk//fuchsia:fuchsia_api_level is still used to set and access the Fuchsia API level value. - @rules_fuchsia//fuchsia/constraints:BUILD.bazel requires a @fuchsia_sdk//:api_level.bzl file to load properly. - fuchsia_cc_driver() and fuchsia_devicetree_visitor() use a @fuchsia_sdk label to access their linker scripts. - The fuchsia_wrap_cc_binary() macro still hard-codes references to @fuchsia_sdk and @fuchsia_clang by default in the targets it generates. For more, see the comments in `_merge_rules_fuchsia()` function of `generate_sdk_build_rules.bzl`. This *only* modifies the content of the @fuchsia_sdk repository in the in-tree Bazel workspace. The final version of the SDK, generated by `fx build generate_fuchsia_sdk_repository`, is unchanged. A future CL will change the rest of fuchsia.git to load all rules from @rules_fuchsia directly. Then others will do the same for various //vendor/* repositories. Bug: 381126633 Change-Id: I4a51afd4e9fce815007dfcefd20e63855b3b48f0 Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/1168332 Reviewed-by: Jiaming Li <lijiaming@google.com> Reviewed-by: Chase Latta <chaselatta@google.com> Commit-Queue: David Turner <digit@google.com>
Fuchsia is an open source, general purpose operating system supporting modern 64-bit Intel and ARM processors.
We expect everyone interacting with our project to respect our code of conduct.
Read more about Fuchsia's principles.
See Getting Started.
See fuchsia.dev.