-
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_no_transitive_loads: Forbid macros loaded transitively #5636
Comments
+1 on this change. Current behavior is surprising.
…On Thu, 19 Jul 2018 at 15:06 Laurent Le Brun ***@***.***> wrote:
When a bzl file contains a load, e.g.
load("//some:file.bzl", "fct")
it implicitly exports fct.
This is problematic for many reasons:
- Exports should be explicit
- Other languages don't do that
- Removing a load can break other files
- So it means we can't have a tool to safely remove unused loads
Unfortunately, this is a breaking change. We may create a tool to help
users update their codebase.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#5636>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABUIFybNSF5XAM14acXIPGbRwZ5Hgmtyks5uIHZVgaJpZM4VWRvW>
.
|
With flag set, loaded symbols are not automatically re-exported. #5636 RELNOTES: None. PiperOrigin-RevId: 214776940
Default behavior of Bazel will change soon (--incompatible_no_transitive_loads) #5636 RELNOTES: None. PiperOrigin-RevId: 222841756
After running on the CI (https://buildkite.com/bazel/bazel-at-release-plus-incompatible-flags/builds/56), here's the list of projects that fail with the flag:
|
@laurentlb you fixed rules_scala, right? |
I think so. I'll update the list after a new CI run. |
This flag was not flipped in time for the Bazel 0.23.0 release and will thus be postponed to Bazel 0.24.0. |
Still blocked by: Android Testing, Bazel integration testing, Bazel Remote Cache, Bazel Watcher, Gerrit, Tensorflow, rules_webtesting. |
In bazel 0.25 the flag --incompatible_no_transitive_loads is now enabled by default. To fix this, we must not rely on imported symbols being exported by default. Context: bazelbuild/bazel#5636 PiperOrigin-RevId: 246384617 GitOrigin-RevId: 5b911dcb631637cadc42d83597955058d5987556
We were picking up ABSL flags transitively. After bazelbuild/bazel#5636 this no longer works. load() the flags directly from ABSL's GENERATED_copts.bzl.
In bazel 0.25 the flag --incompatible_no_transitive_loads is now enabled by default. To fix this, we must not rely on imported symbols being exported by default. Context: bazelbuild/bazel#5636 PiperOrigin-RevId: 246384617
#5636 RELNOTES: None. PiperOrigin-RevId: 279183449
@laurentlb to verify- the fact that this issue is closed means new code can use |
Yes. |
* Bump Bazel to 1.0.0 * Fix transitive macro load See: bazelbuild/bazel#5636 * Fix memory leak in AdminService * Fix linkopts being copts * Update p4c bazel rules * Combine build targets * Fix bazel_gazelle * Bump bazel version to 2.0.0 * Fix PI deps * Fix p4c rules (for real) * Fix load() in BUILD files * python gRPC library cleanup * update build image * Skip Bazel profile * Add gcov-wrapper Sometimes the gcov tool won't print "Creating ...gcov" which may leads the bazel coverage rules failed * break tests to small one * Fix BUILD file * disable bcm tests * Fix "add gcov wrapper" step * Fix CDLang dependency Should be https://repo1.maven.org * Use new cache * disable cdlang tests * Cleanup * move gcov wrapper script to Docker image * add bcm tests back * remove gcov wrapper step from CI * Bump bazel version to 2.2.0 * Fix build * Put bazel analyze-profile back * move back to v2 cache * update gnoi path * resolve comment * address comments Co-authored-by: Maximilian Pudelko <pudelkoM@users.noreply.github.com>
When a bzl file contains a load, e.g.
load("//some:file.bzl", "fct")
it implicitly exports
fct
.This is problematic for many reasons:
Unfortunately, this is a breaking change.
There are two ways to fix it.
foo
, use:The text was updated successfully, but these errors were encountered: