-
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
experimental_remap_main_repo and register_execution_platforms issue #7773
Comments
@iirina any update? |
@dkelmer and I were just discussing this (and #7654) and realized the problem and how to fix it. Here is a brief explanation of how the code works currently:
This was fine before repository remapping existed. Now, however, we need to move the target pattern expansion into the workspace functions and out of the skyfunctions. So, to fix these issues:
Of these, the hard part is adding target pattern expansion to the workspace functions, since that requires access to |
Priority wise: definitely. Complexity wise: I'm doing my best |
@dkelmer will this make 0.26rc? |
… unrelated Bazel FR (#7773) more cumbersome to implement. RELNOTES: None PiperOrigin-RevId: 246007951
Platform and toolchain resolution rely on the target pattern parsing code to turn target pattern strings into Labels. Since most of the target pattern parsing codepaths turn target patterns that originated from the command line, they don't need to pass along the repository renaming map. But instances that affect platform and toolchain target patterns, we need to pass the map. This allows us to turn on the --incompatible_remap_main_repo flag on by default in Bazel. Closes #7902. Fixes #7755, #7773, #7654. RELNOTES: None PiperOrigin-RevId: 246199440
*** Reason for rollback *** Breaks bazel-skylib See #8227 for details. *** Original change description *** Make target pattern parsing repository-renaming aware. Platform and toolchain resolution rely on the target pattern parsing code to turn target pattern strings into Labels. Since most of the target pattern parsing codepaths turn target patterns that originated from the command line, they don't need to pass along the repository renaming map. But instances that affect platform and toolchain target patterns, we need to pass the map. This allows us to turn on the --incompatible_remap_main_repo flag on by default in Bazel. Closes #7902. Fixes #7755, #7773, #7654. RELNOTES: None PiperOrigin-RevId: 246546091
@dkelmer any update? We're nearing three months on it. I have a workaround but I'm not sure when it will break |
Unfortunately @dkelmer is no longer working on Bazel. I'm going to try and figure out who can take over this work. |
Re-assigning to @dslomov to find a new owner. |
Klaus, can you take a look at what needs to be done here (and how much work it is)? |
Hi @katre,
thanks for the detailed description of how things work at the moment. However, I have a question on your conclusion.
Why is it necessary, to move the pattern expansion out of the skyfunctions? Wouldn't it be an alternative to perform the repository mapping (with the current map based on the currently loaded repository) at the level of target patterns? As far as I can see, pattern expansion is pretty orthogonal to repository remapping, as we do not do any form of expansion in the repository part of a pattern. In this way, we would also get rid of the problem...
...of getting a full skyframe access (through a Am I missing something, or is this a way forward worth investigating further? |
Hmm, I think this would work. You're entirely correct that target patterns can't change the repository, only the "local" package and targets selected. I believe @Dannark was working on something similar: she had several changes which added the concept of repo mapping to target pattern evaluation (771cb7a, which was rolled back in dac2135). I don't think this was ever finished and rolled forward again, but may prove a basis for starting. |
@aehlig can you explain what will be the implications of |
Well, my proposal is to not disallow it. What it's all about is the following. Currently, you can have a
This works, because we do not need to expand the pattern in the registration of an execution platform at time of registration. And with the proposal to do the renaming of repositories at the level of pattern strings this continues to work; however, if we followed the proposal of immediately expanding and keeping the labels instead, the example would stop working. |
My proposed fix for that issue is the following sequence of commits.
@katre @ittaiz can you have a look if this is a reasonable implementation or whether I missed something? Thanks. |
I skimmed it but I don’t feel I have enough understanding of that area to weigh in. |
This looks fine, I'll save detailed review comments for the CLs as they
arrive.
…On Fri, Jul 5, 2019 at 11:15 AM Ittai Zeidman ***@***.***> wrote:
I skimmed it but I don’t feel I have enough understanding of that area to
weigh in.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#7773?email_source=notifications&email_token=AACPW7ZIU3UVIWIPNS4N4Z3P55QSHA5CNFSM4G724TV2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZJYPHQ#issuecomment-508790686>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AACPW73FXKYV6CLBLMPL2CDP55QSHANCNFSM4G724TVQ>
.
|
*** Reason for rollback *** Breaks Skylib tests: https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/1082#95e91cd3-c796-408b-83ab-9991efcf1292 Culprit finder: https://buildkite.com/bazel/culprit-finder/builds/183#985aa488-33c9-4dcc-8561-a96c6e1fb4ed *** Original change description *** register_{toolchains, execution_platforms}: honor renaming When handling the registration of toolchains or execution platforms, take the applicable renaming into account. This, in particular, includes the renaming from the name of the main workspace to the canonical '@'. Fixes #7773. Change-Id: I22fe84e337ad6d33df2a9263e6671e2e0d0a284d PiperOrigin-RevId: 257214983
Reopening, as the change was rolled back. It seems, the renaming is missing in the |
When handling the registration of toolchains or execution platforms, take the applicable renaming into account. This, in particular, includes the renaming from the name of the main workspace to the canonical '@'. Fixes bazelbuild#7773. Change-Id: I22fe84e337ad6d33df2a9263e6671e2e0d0a284d PiperOrigin-RevId: 257176466
*** Reason for rollback *** Breaks Skylib tests: https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/1082#95e91cd3-c796-408b-83ab-9991efcf1292 Culprit finder: https://buildkite.com/bazel/culprit-finder/builds/183#985aa488-33c9-4dcc-8561-a96c6e1fb4ed *** Original change description *** register_{toolchains, execution_platforms}: honor renaming When handling the registration of toolchains or execution platforms, take the applicable renaming into account. This, in particular, includes the renaming from the name of the main workspace to the canonical '@'. Fixes bazelbuild#7773. Change-Id: I22fe84e337ad6d33df2a9263e6671e2e0d0a284d PiperOrigin-RevId: 257214983
*** Reason for rollback *** Breaks bazel-skylib See bazelbuild/bazel-skylib#173 *** Original change description *** register_{toolchains, execution_platforms}: honor renaming When handling the registration of toolchains or execution platforms, take the applicable renaming into account. This, in particular, includes the renaming from the name of the main workspace to the canonical '@'. Fixes #7773. This is a roll-forward of 40e2d7f with fixing the needed additional renamings for tool chains, as to not break skylib. RELNOTES: None. PiperOrigin-RevId: 258776285
Unfortunately, the commit was rolled back again, due to bazelbuild/bazel-skylib#173 which I, unfortunately, cannot reproduce locally. |
…g unrelated Bazel FR (bazelbuild/bazel#7773) more cumbersome to implement. RELNOTES: None PiperOrigin-RevId: 246007951
Description of the problem / feature request:
build breaks when using --experimental_remap_main_repo=true and register_execution_platforms refers to current workspace in fully qualified manner.
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
https://github.com/ittaiz/bazel_remap_platforms_issue
Error:
You can also check the remap_off_passes and no_qualify_in_ws_passes branches which show the build passes when remap is off or when you don't qualify the execution platform in the WORKSPACE.
What operating system are you running Bazel on?
OS X
What's the output of
bazel info release
?0.23.1
I also tried to verify that 2398d85 doesn't solve the issue. It wasn't easy since it was rollbacked, I can't seem to build bazel HEAD locally and I had a really hard time finding a bazel nightly release.
I ended up downloading the mac binary from this build https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/862#36abbed3-6d50-4137-a779-4a6c989bc557 as I think it should contain the above change.
In any case the build still fails there.
Also happens with 0.24.0rc7
Have you found anything relevant by searching the web?
#7654 sounds related, which is why I tried the above commit, but we have a bit of a different error.
Also I'll share that in our internal workspace we did see
ERROR: While resolving toolchains for target //some-target: no matching toolchains found for types @io_bazel_rules_scala//scala:toolchain_type
but when I worked on the repro and worked on a minimized example I actually got the error from above.Also the two workarounds above also workaround it for our internal cases.
The text was updated successfully, but these errors were encountered: