-
-
Notifications
You must be signed in to change notification settings - Fork 152
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
[Platform Transitions] Fix platform transitions for selecting tools. #272
base: master
Are you sure you want to change the base?
Conversation
cc @aaliddell |
The select shouldn't be taking the target config, as we specifically request the exec config for the tools: rules_proto_grpc/internal/plugin.bzl Lines 31 to 36 in 7064b28
The fact the select is failing indicates that your exec config may be an unsupported platform (QNX presumably), which is what needs solving here rather than resorting to host config by introducing the alias. Note that if we actually wanted to switch to host config, changing Have you tried constraining the doc building rules with |
Sorry, I am a bit confused by your previous comment. According to the bazel docs: They say that cfg can either be Since I believe bazel resolves selects before it actually builds things, my understanding is if I were to compile for the target platform QNX, the Let me know if I have any misunderstandings here, but afaik, we aren't executing bazel on QNX. We are building for it, but that would be the target platform (ie cfg= |
So host config was dropped in v6: bazelbuild/bazel@6464f1c That section of code I highlighted above is exactly where we are asking the proto plugin to be produced in the exec config as you are looking for, so the select should be resolved appropriately and the fact you are getting target config there indicates bazel is in the wrong configuration. So switching to an alias select is just hiding the problem rather than actually solving it. Are you using configuration transitions? Could you follow the steps here to check your config for the relevant targets? As it stands I don't have a cross compiling setup to be able to test with. |
I ran into an issue the other day where I have a multi-platform repo and I was compiling code for a different platform (in this case QNX).
I ran into an issue with the docs compile rule where I would get the following error:
The issue was we were compiling for QNX, but even though the tool is for the execution platform, the select operates on the target platform when selecting the tool. So added an alias buffer rule in between the tool and the select so the select would only operate on the execution platform. That seemed to work, so I implemented the buffer for everywhere where I saw this pattern.