-
Notifications
You must be signed in to change notification settings - Fork 693
Go container image build fails on macOS in 0.23.0 (worked in 0.22.0) due to toolchain resolution #2052
Comments
Got same problem, did a git bisect between v0.23.0 and v0.22.0 and found that 76c708f was the commit where it brokes. |
With the following workspace,
|
I have been running into the same issue starting with the same rules_docker version, but with the I just figured out that I could work around the issue by passing the following argument:
Our use-case is we generate our images with our CI running on x86 but we use Mac dev machines and want to be able to sanity check things locally as necessary, which means being able to run We were holding back from doing an upgrade until this was fixed, so we've been pinned on |
The bisected commit mentioned above #2052 (comment) also touches the transitions feature. |
Okay did some more reading and it looks like this flag was introduced specifically to disable the feature added in this commit. This looks to be the recommended way of handling this behavior for now. Also worth mentioning, I've added this line to my bazelrc so I don't have to specify it explicitly:
|
@uhthomas fwiw I tried to use Bazel 6-pre in order to test out the optional toolchain support. Is there something specific I need to do to opt into that behavior? |
What specifically are you trying to do? rules_docker and any rulesets which are not using optional toolchains will need to be updated to use them. |
For anyone still struggling with this, I think I've found a (not so elegant) workaround that seems to do the trick without disabling transitions. This is great for us as it means we no longer have to supply Set up a "dummy" C++ toolchain:
then add to
Obviously this won't work at all if you actually do need cgo, but it seems to do the job for us. |
This issue has been automatically marked as stale because it has not had any activity for 180 days. It will be closed if no further activity occurs in 30 days. |
Not stale, this still needs addressed. |
I'm seeing the same issue with rules_go v0.38.1 and rules_docker v0.25.0. @nickgooding's workaround works for my case as well. The fact that cgo is not used but got involved into the toolchain dependency tree, sounds like a bug to me. |
Any progress on this. Even with the latest version of Bazel, rules_docker facing the same issue. |
Same issue. |
🐞 bug report
Affected Rule
The issue is caused by the rule: go_image
Is this a regression?
Yes, the previous version in which this bug was not present was: 0.22.0
Description
On macOS (I tested both macOS 12 on Apple Silicon and macOS 11 on Intel) go_image targets fail to build using rules_docker 0.23.0. The error message is:
(which is actually quite misleading). After some search I was able to pinpoint this regression to the rules_docker 0.23.0 release.
This appears to be a similar, but not exactly the same, issue as #2009.
🔬 Minimal Reproduction
The bug can be reproduced with https://github.com/Xjs/rules-docker-macos-regression .
🔥 Exception or Error
🌍 Your Environment
Operating System:
Output of
bazel version
:On both machines:
Rules_docker version:
The text was updated successfully, but these errors were encountered: