-
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
Symlink warnings since upgrading to Bazel 6 #17081
Comments
Hi @pdeva, Minimal reproduce case is required for the above issue. Thanks! |
not minimal, but pull https://github.com/simmonmt/advent-of-code and bazel build in the 2022 directory with bazel 6 will reproduce it. |
As the reproducer uses the |
Thanks Fabian! Can confirm that adding the manual tag to the |
This is a troublesome change from Bazel upstream. In a large project with rules_go's @fmeum hinted, to the discussion thread over at rules_go, but did not point out the root cause being this flag flipped in Bazel 6.0 6452024. What is the long-term solution for this flag flip? Do we discourage folks from configuring top-level targets with @sgowroji Is it possible to contact the author of this CL for more info?
|
Got the same message after upgrading 6.0.0. I find
I find the doc of output directory layout is still indicating It is confusing: Are Update: Assuming that I want to preserve the two folders, I need to set
Or, add a flag in
|
Hi all, apologies for the late response.
@sluongng Since this flag is enabled by default, the long term goal is to remove it and the current behavior would stick. You also mentioned that this caused breakages, could you please help me with a repro for a known breakage? We can talk more about the current As a recap for this flag: When it is enabled, for a build with a single top-level target, this will guarantee that blaze-bin points to whatever the output directory of that top-level target. If there are multiple top level configurations making the output directories ambiguous it clears the symlinks. @bolitt setting |
@aranguyen OSS users tend to do |
@aranguyen Here is one of our latest PR where we have to apply @fmeum 's suggested fix to mitigate the issue buildbuddy-io/buildbuddy#3393. This has an obvious downside: these code paths that are marked with Targets with self-transition are very common in the Go ecosystem: engineers often develop on a MacOS machine and deploy on a Linux environment (as a container via rules_docker's go_image), so it's typical for a Bazel + rules_go setup to use transition to help provide cross-compilation between these environments and architectures. |
I have a bunch of scripts to build and run, like
So my question is: what is the suggested final solution? Only to use the OS-dependent command?
|
Hi all, sorry for the late reply but here are updates from our team on this issue:
|
I would argue that the current workaround is a UX degradation that needs to be addressed. Not quite sure why flag removal is being pushed forward so aggressively while there are unaddressed problems stated here. Clearing symlink automatically based on top-level target configurations feels "magical" at best and confusing/anti-user at worst. If a big repo has complicated transitions that are used for purposes other than building a binary (i.e. |
I seem to have discovered this as an unfortunate interaction with the CLion plugin. If I build my target This is really confusing and a bit frustrating because there is already a lot to digest with bazels output directory structure, but as a user of a build system who is trying to build a plugin for a host application I really need a way to have a stable output location of the targets I define. I don't really mind the details of how that's arrived at, but from the user point of view it should work about as easily as |
What is the long term solution for these workflows? |
Thanks for all this feedback. @fmeum , @aranguyen , and I are currently re-reviewing based on your experiences. |
We talked and we'll work on an adjustment from the above feedback. Ball is currently in my court. I'll plan to visit this (ideally with a PR we can review) in June. Feel free to ping if time passes by and you're unsure where things stand. |
Just to be clear on what expectation I believe that was violated: A workspace dependency should not affect the convenience symlinks. |
@SanjayVas can you elaborate more precisely? |
@gregestren My understanding is that the default behavior change means that transitions can result in the convenience symlinks being cleared. Simply depending on rules from workspaces that use transitions (e.g. rules_docker) can therefore trigger this behavior. |
That shouldn't trigger if you're only building the depender. You've noticed otherwise? |
Simple repo that demonstrates this issue: https://github.com/world-federation-of-advertisers/containers There are no transitions in this code. Any use of transitions is due to use of rules from the |
Old semantics: New semantics: Fixes bazelbuild#17081. PiperOrigin-RevId: 546025529 Change-Id: I095564bb9233eba4b008df7f9e6aedae3e973b23
Old semantics: New semantics: Fixes bazelbuild#17081. PiperOrigin-RevId: 546025529 Change-Id: I095564bb9233eba4b008df7f9e6aedae3e973b23
We're aiming to get ceb9955 into Bazel 6.3.0, which will be cut Wednesday. Note this doesn't guarantee But it should remove the 6.0 regression and (I hope) make 6.3.0 a strict improvement over < 6.0. And it should cleanly address all the Appreciate anyone's feedback if you can test the change out. |
Adjust `--top_level_targets_for_symlinks`. - If all targets in `$ bazel build //...` have the top-level config, `bazel-bin`, etc. point to that config - If all targets in `$ bazel build //...` have the same transitioned config, `bazel-bin`, etc. point to that config - If targets in `$ bazel build //...` have mixed configs, `bazel-bin`, etc. are deleted - If all targets in `$ bazel build //...` have the top-level config, `bazel-bin`, etc. point to that config - If all targets in `$ bazel build //...` have the same transitioned config, `bazel-bin`, etc. point to that config - If targets in `$ bazel build //...` have mixed configs and at least one of them is the top-level config, `bazel-bin`, etc. point to the top-level config - If targets in `$ bazel build //...` have mixed configs and none are the top-level config, `bazel-bin`, etc. are deleted Fixes bazelbuild#17081. Closes bazelbuild#18854. PiperOrigin-RevId: 546938509 Change-Id: I75adf0b8c2094522125c5e65d8c450eb2436d392
Adjust `--top_level_targets_for_symlinks`. - If all targets in `$ bazel build //...` have the top-level config, `bazel-bin`, etc. point to that config - If all targets in `$ bazel build //...` have the same transitioned config, `bazel-bin`, etc. point to that config - If targets in `$ bazel build //...` have mixed configs, `bazel-bin`, etc. are deleted - If all targets in `$ bazel build //...` have the top-level config, `bazel-bin`, etc. point to that config - If all targets in `$ bazel build //...` have the same transitioned config, `bazel-bin`, etc. point to that config - If targets in `$ bazel build //...` have mixed configs and at least one of them is the top-level config, `bazel-bin`, etc. point to the top-level config - If targets in `$ bazel build //...` have mixed configs and none are the top-level config, `bazel-bin`, etc. are deleted Fixes bazelbuild#17081. Closes bazelbuild#18854. PiperOrigin-RevId: 546938509 Change-Id: I75adf0b8c2094522125c5e65d8c450eb2436d392
Adjust `--top_level_targets_for_symlinks`. - If all targets in `$ bazel build //...` have the top-level config, `bazel-bin`, etc. point to that config - If all targets in `$ bazel build //...` have the same transitioned config, `bazel-bin`, etc. point to that config - If targets in `$ bazel build //...` have mixed configs, `bazel-bin`, etc. are deleted - If all targets in `$ bazel build //...` have the top-level config, `bazel-bin`, etc. point to that config - If all targets in `$ bazel build //...` have the same transitioned config, `bazel-bin`, etc. point to that config - If targets in `$ bazel build //...` have mixed configs and at least one of them is the top-level config, `bazel-bin`, etc. point to the top-level config - If targets in `$ bazel build //...` have mixed configs and none are the top-level config, `bazel-bin`, etc. are deleted Fixes bazelbuild#17081. Closes bazelbuild#18854. PiperOrigin-RevId: 546938509 Change-Id: I75adf0b8c2094522125c5e65d8c450eb2436d392
Old semantics: New semantics: Fixes bazelbuild#17081. PiperOrigin-RevId: 546025529 Change-Id: I095564bb9233eba4b008df7f9e6aedae3e973b23
Adjust `--top_level_targets_for_symlinks`. - If all targets in `$ bazel build //...` have the top-level config, `bazel-bin`, etc. point to that config - If all targets in `$ bazel build //...` have the same transitioned config, `bazel-bin`, etc. point to that config - If targets in `$ bazel build //...` have mixed configs, `bazel-bin`, etc. are deleted - If all targets in `$ bazel build //...` have the top-level config, `bazel-bin`, etc. point to that config - If all targets in `$ bazel build //...` have the same transitioned config, `bazel-bin`, etc. point to that config - If targets in `$ bazel build //...` have mixed configs and at least one of them is the top-level config, `bazel-bin`, etc. point to the top-level config - If targets in `$ bazel build //...` have mixed configs and none are the top-level config, `bazel-bin`, etc. are deleted Fixes bazelbuild#17081. Closes bazelbuild#18854. PiperOrigin-RevId: 546938509 Change-Id: I75adf0b8c2094522125c5e65d8c450eb2436d392
* Adjust --top_level_targets_for_symlinks Adjust `--top_level_targets_for_symlinks`. - If all targets in `$ bazel build //...` have the top-level config, `bazel-bin`, etc. point to that config - If all targets in `$ bazel build //...` have the same transitioned config, `bazel-bin`, etc. point to that config - If targets in `$ bazel build //...` have mixed configs, `bazel-bin`, etc. are deleted - If all targets in `$ bazel build //...` have the top-level config, `bazel-bin`, etc. point to that config - If all targets in `$ bazel build //...` have the same transitioned config, `bazel-bin`, etc. point to that config - If targets in `$ bazel build //...` have mixed configs and at least one of them is the top-level config, `bazel-bin`, etc. point to the top-level config - If targets in `$ bazel build //...` have mixed configs and none are the top-level config, `bazel-bin`, etc. are deleted Fixes #17081. Closes #18854. PiperOrigin-RevId: 546938509 Change-Id: I75adf0b8c2094522125c5e65d8c450eb2436d392 * Merge with 6.3.0 baseline. Particularly manually merge relevant signature changes from 1cd3588. Thsi is different than 1cd3588 itself because that also uses a baseline too new for 6.3.0.
Description of the bug:
Seeing this message in output since upgrading to Bazel 6 (from Bazel 5):
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
upgrade to bazel 6 from bazel 5 and run build
Which operating system are you running Bazel on?
linux
What is the output of
bazel info release
?release 6.0.0
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
?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: