-
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
Using --cpu=darwin_x86_64
in platform_mappings
triggers unnecessary toolchain evaluation
#16099
Comments
platform_mappings
triggers unnecessary toolchain evaluation--cpu=darwin_x86_64
in platform_mappings
triggers unnecessary toolchain evaluation
@gregestren , @katre , as always, ideas are welcome 😁 |
I'm unsure what the root problem is here. i.e my quick reading is that a platform mapping sets the target to a Mac platform. So that's telling Bazel it should build the target for the Mac platform, which it would now expect to work? Does your machine have no support for building for Mac at all? Even if you set a Mac |
The goal is to disable It's possible that I'm misunderstanding how platform mappings work. My assumption was that the mapping is intended to translate between |
The use case being discussed here is:
I.e., we want to log into a linux box, type Currently, they will not be skipped, because AppleCrosstoolTransition unconditionally changes the The target configuration passed on the command line is effectively ignored; the target will always be compatible. |
Yes, that makes sense @pcjanzen (and I hope that addresses your confusion @philsc about why I understand your use case. Thanks for detailing it out. The challenge with this bug is that all pieces of functionality are working as intended. It's not a bug, per se. But you're showing how that can still produce a bad user experience. Core configurability devs will review this this week as part of routine bug triage. Let's get another update from that review. |
Perhaps a related question is: What's the motivation behind |
I can't remember, but it might have been - awkwardly enough - so @oquenchil do you remember? |
I can see the appeal of that logic before Incompatible Target Skipping. But now with Incompatible Target Skipping I would like to figure out what it would take to get rid of that behaviour. Or at least work around. I appreciate you looking at this during the next bug triage. Thanks! Aside: |
It would feel natural to me if every |
@gregestren (or maybe @katre , @googlewalt ?), if you could help me find the owner of the I don't really know the
Presumably either of these would require a Either way, I'm interested in writing a proposal and/or implementing it depending on what the owners think is the best course of action. |
Thank you for being patience. We have forwarded to right team and owner for this issue to address. |
@oquenchil - This thread is questioning the logic for |
@googlewalt would you know the answer to Greg's question? |
I think we are all in agreement that having a transition in For now, one "gross" hack that might work for your |
FYI @googlewalt 's team recently did some experiments on cleaning up the |
At the risk of stating the obvious, this is a problem inherent to any rule that self-transitions on |
as far as removing that transition I've pulled that into a separate issue here #16870 |
The objc_library transition is now disabled pending deletion |
Description of the bug:
This is a follow-up to #12897. The fix (#14096) doesn't address the original problem when
platform_mappings
is in use. When not usingplatform_mappings
, there is no problem.What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
The objective is to prevent bazel from analysing
objc_library
targets on Linux.Create this BUILD file:
The target is appropriately skipped on a Linux machine:
Now add a
platform_mappings
file:and you see the same error originally reported in #12897:
It's worth noting that this only happens with
--cpu=darwin_x86_64
. If I instead add a--cpu=k8
platform mapping, then the error goes away again.Which operating system are you running Bazel on?
x86_64 Debian 11
What is the output of
bazel info release
?development version
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.What's the output of
git remote get-url origin; git rev-parse master; git rev-parse HEAD
?Have you found anything relevant by searching the web?
N/A
Any other information, logs, or outputs that you want to share?
I will investigate possible solutions to this.
The text was updated successfully, but these errors were encountered: