-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Builtins exports.bzl file is called after the WORKSPACE #17713
Comments
cc @comius |
cc @brandjon @Wyverald @meteorcloudy Reproducer:
|
Possible workaround might be to split bzl files containing repository rules in Apple repo, so that they don't load rules_proto (or anything that uses ProtoInfo). |
Yea that could work for this case since it's unlikely folks need that specific rule at this stage |
looks like rules_clojure has the same issue through a different codepath https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/2903#0186cce4-f095-461b-a896-2efe15924483 |
Hey everyone. I'm also getting this error trying to build Tensorflow from github on Windows using the latest bazel binaries: https://github.com/bazelbuild/bazel/releases/tag/7.0.0-pre.20230302.1. Steps to reproduce:
Error:
|
Could we assign some dummy Provider value to these symbols before |
It's not that it's called "after", it's that its result is not at all used for WORKSPACE-loaded .bzl files. Builtins injection only applies to BUILD-loaded .bzl files. See (The None comes from the native-defined value intended to be overridden by builtins injection.) |
I think this should be fixed from Bazel side since it's an incompatible change causing many downstream breakages, but is probably avoidable. |
This should be fixed by b1341be |
Not fixed at 8b60d6d, cc @benjaminp |
@keith Can you provide more information on what's still broken? |
Here's a new repro: protorepro.zip Seems to be the exact same error as before you just have to be using bzlmod and not the WORKSPACE |
Returning None fails type-check, when a rule with ProtoInfo is loaded from WORKSPACE context (builtins are not applied). Worksaround: bazelbuild#17713 PiperOrigin-RevId: 523387385 Change-Id: I08408a6209de9c266bf10f4584f76f0341029fd5
This is to workaround bazelbuild#17713 (something about WORKSPACE loaded bzl files not having builtins-bzl overrides applied). PiperOrigin-RevId: 523468866 Change-Id: Ia1484a03b958d149255f0b5c37df211ef8dfc46b
bazelbuild#17713 Closes bazelbuild#18022. PiperOrigin-RevId: 525350732 Change-Id: I869653fcd6d4a82ccca49f14e66245c182062731
bzlmod is still broken in the latest rolling release:
|
b1341be disclaimed efforts to fix bzlmod. So, this state is not surprising. |
/cc @Wyverald for awareness |
I can confirm the new commit fixes the real world case of this. thanks all! |
@bazel-io fork 6.3.0 |
@meteorcloudy looks like b1341be is good to cherry-pick. However, when we try to cherry-pick c2553cc, we seem to need another PR or commit because of conflicts from 2 files ("src/main/java/com/google/devtools/build/lib/packages/BazelStarlarkEnvironment.java" and "src/main/java/com/google/devtools/build/lib/skyframe/BzlLoadFunction.java"). For example, createBzlToplevelsWithoutNative function should be in the "src/main/java/com/google/devtools/build/lib/packages/BazelStarlarkEnvironment.java" file already in the release-6.3.0. The conflict from the "src/main/java/com/google/devtools/build/lib/skyframe/BzlLoadFunction.java" file is from the changed code for the function, "getAndDigestPredeclaredEnvironment" |
@iancha1992 Thanks for the info! @hvadehra Do you think we need those fixes in 6.3.0 at all? Did starlarkification of those symbols only happen after Bazel 6? |
Some rules/symbols might have moved to _builtins before 6.0 was cut. But I don't know if there are any references to those in workspace files. We can cherry pick b1341be out of an abundance of caution. We only need c2553cc for bzlmod, so I'll defer to you if that's something you want to support in 6.3.0. |
@iancha1992 OK, then let's only cherry pick b1341be for now. |
bazelbuild#17713 Closes bazelbuild#18022. PiperOrigin-RevId: 525350732 Change-Id: I869653fcd6d4a82ccca49f14e66245c182062731
Description of the bug:
After this commit a3f0bfa, using rules_swift in some cases results in this error:
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Here's a repro project protorepro.zip. Run
USE_BAZEL_VERSION=last_green bazelisk build ...
. Testing with the commit before that does not have the issue. Using rules_proto @ the current HEAD (71c4fc69900946093ac5c82d81efd19fa522d060) does not fix the issue.Which operating system are you running Bazel on?
macOS
What is the output of
bazel info release
?No response
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.No response
What's the output of
git remote get-url origin; git rev-parse master; git rev-parse HEAD
?No response
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
No response
The text was updated successfully, but these errors were encountered: