-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
incompatible_load_cc_rules_from_bzl: load cc rules from @rules_cc #8743
Comments
The flag `--incompatible_load_cc_rules_from_bzl` will be flipped for Bazel 1.0. GitHub Issue: #8743 RELNOTES:none PiperOrigin-RevId: 259285337
Is the migration tooling available to do the migration? |
Went in at bazelbuild/buildtools@3a4128e |
Nice! But this tooling does not update WORKSPACE file, right? |
Nope, but rules_cc is in the WORKSPACE suffix. This was needed by Java, so it's always present. |
Fixes googletest for upcoming `--incompatible_load_cc_rules_from_bzl` (bazelbuild/bazel#8743) and `--incompatible_load_python_rules_from_bzl` (bazelbuild/bazel#9006). This change was automatically generated with buildifier -lint=fix -warnings=all $(find . -name "BUILD" -o -name "BUILD.bazel" -o -name "*.bzl")
Fixes googletest for upcoming `--incompatible_load_cc_rules_from_bzl` (bazelbuild/bazel#8743) and `--incompatible_load_python_rules_from_bzl` (bazelbuild/bazel#9006). This change was automatically generated with `buildifier -lint=fix -warnings=all $(find . -name "BUILD" -o -name "BUILD.bazel" -o -name "*.bzl")`.
Migrating rules_rust for these incompatible changes: bazelbuild/bazel#9006 bazelbuild/bazel#8922 bazelbuild/bazel#8743
This migration is currently blocked by bazelbuild/rules_cc#39. In a codebase heavily dependant on tags, running |
The the automatic updating of BUILD files with the lack of rules_* versions is breaking builds. There have been no github releases of rules_* projects so WORKSPACES are based on information found in bugs like this or the grpc code, versions with known issues. Bazel 1.2.0 is warning about not loading rules_* so people are running buildifier, which is then breaking their builds. Since bazel is issuing these warning it should also include default rules_* versions that are believed to work with that version of bazel. Being able to override that setting would be nice, but there needs to at least be a reasonable default. |
Which rules_* is breaking exactly? Is it breaking for cc? We have the rules_cc repository in the suffix, so it should not be a problem unless you bump into the tags issue in bazelbuild/rules_cc#39. If that happens you will have to manually update the WORKSPACE to include the latest rules_cc version. |
See bazelbuild/bazel#8743. This will be required in Bazel 1.0. Protobuf was updated in protocolbuffers/protobuf@bf0c69e#diff-96239ee297e0a92ac6ff96a6bc434ef0. GoogleTest was updated in google/googletest@6fd262e. gflags has not yet been updated, so the repo still won't build with --incompatible_load_cc_rules_from_bzl. Tested with buildifier -warnings=native-cc -lint=warn **/BUILD. PiperOrigin-RevId: 267638515
Starting with Bazel 3.0, C++ rules will require loads. See bazelbuild/bazel#8743 Thanks to Yannic Bonenberger for noting this in https://boringssl-review.googlesource.com/c/boringssl/+/39825 Change-Id: I8e274c82ade6c7ec569989026190f6a0a88b47ed Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/39924 Commit-Queue: David Benjamin <[email protected]> Reviewed-by: David Benjamin <[email protected]>
Update: We decided not to require everyone to add a load() statement to every single BUILD file because it's too much churn. The current plan is to "pretend" that the eventual C++/Java rules written in Starlark are load()ed everywhere. We might revisit this decision once they are reasonably stable and once we decide where exactly they need to be load()ed from, but now is not the time. |
Flag: --incompatible_load_cc_rules_from_bzl
Available since: 0.28 (July2019 release)
Will be flipped in: 1.0 (September 2019 release)
Tracking issue: #7643
cc_library, cc_binary, cc_test, cc_import, cc_proto_library, fdo_profile, fdo_prefetch_hints, objc_library, objc_import, cc_toolchain, cc_toolchain_suite, cc_flags_supplier and compiler_flag have to be loaded from @rules_cc.
For example if you are using cc_library, add the following load statement to your BUILD/bzl file.
load("@rules_cc//cc:defs.bzl", "cc_library")
You will have to add the rules_cc to your WORKSPACE file as well:
There is a bug in a previous version of rules_cc that may cause problems when you have tags of your own that come from a separate bzl file. If you have to use the old version of rules_cc, you can get around the bug by passing tags = list(TAGS) to the cc_* rule. instead of doing tags = TAGS directly.
The text was updated successfully, but these errors were encountered: