-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Changing output base results in failed builds due to parsing the contents of the convenience symlinks #13951
Comments
looks related #10653 |
Hey, I think output paths are more concern of Configurability team? Or perhaps OSS? Please triage. |
And run them after spec validations, for quicker feedback on those. And add a temp fix to `.bazelignore` to work around bazelbuild/bazel#13951.
I don't know if there's a good way to fix this, but I'll ask @gregestren to investigate when he's back. |
This is one of those things that just falls between the cracks. Not really Configurability or OSS.
|
It doesn't support wildcards though, right? #7093 |
Yes. It doesn't, but there are only 4 to add, so it's not that difficult to
enumerate them all
…On Fri, Sep 16, 2022 at 2:03 PM Brentley Jones ***@***.***> wrote:
you could just add bazel-* to .bazelignore
It doesn't support wildcards though, right? #7093
<#7093>
—
Reply to this email directly, view it on GitHub
<#13951 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAXHHHARQ5MHNV4UNNR67ATV6SZAZANCNFSM5DTX6NJA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
There are only 4 to add if you know the workspace name. One is based on the name of the directory the workspace is placed in, which can be different for each user. And that is the one that has caused me the most issues so far, because of the |
Then it would go in the .bazelrc for the workspace.
…On Sun, Sep 18, 2022 at 6:16 PM Brentley Jones ***@***.***> wrote:
There are only 4 to add if you know the workspace name. One is based on
the name of the directory the workspace is placed in, which can be
different for each user.
—
Reply to this email directly, view it on GitHub
<#13951 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAXHHHDD3DVSWYHDK2I57M3V66ICXANCNFSM5DTX6NJA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Just ran into this issue, too. Should the documentation for --output_base mention that you need to add the Are there any downsides to this workaround? It's not very clear to me what are the consequences of adding output directories to |
Changing the docs seems like a good step. |
A workaround for bazelbuild/bazel#13951 that allows setting `--output_base=outbazel` while building with Bazel. Change-Id: Ie024fff2a145f57d3767c270c512b1f3d110d9f8 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/131612 Reviewed-by: Anthony DiGirolamo <tonymd@google.com> Commit-Queue: Ted Pudlik <tpudlik@google.com>
This is a common thing for IDE extensions to do while syncing. It is recommened to use a different output base in the Bazel docs. This looks like a duplication of #10653 anyway. |
When the output base is changed after the convenience symlinks have been created, queries such as `//...` try to traverse into them and load them as packages since they are only excluded based on whether the resolved location is in the output base. This adds some heuristics to determine if a symlink is a convenience symlink: 1. The symlink name has an appropriate suffix. 2. An ancestor of the symlink target at the appropriate level is called `execroot`. 3. The `execroot` directory contains a file called `DO_NOT_BUILD_HERE`. These heuristics should work if both the output base and the symlink prefix change while being quite robust to false positives. This is important for IDE integration, where the [output base is often changed](https://bazel.build/run/scripts#output-base-option) for queries, to prevent concurrent builds from blocking them. An example of this is the vscode-bazel extension. Fixes bazelbuild#10653 Fixes bazelbuild#13951 Closes bazelbuild#21005. PiperOrigin-RevId: 610667735 Change-Id: I1869c9a2063f7f526950e48c0b1ee6efa89fd202
…21505) When the output base is changed after the convenience symlinks have been created, queries such as `//...` try to traverse into them and load them as packages since they are only excluded based on whether the resolved location is in the output base. This adds some heuristics to determine if a symlink is a convenience symlink: 1. The symlink name has an appropriate suffix. 2. An ancestor of the symlink target at the appropriate level is called `execroot`. 3. The `execroot` directory contains a file called `DO_NOT_BUILD_HERE`. These heuristics should work if both the output base and the symlink prefix change while being quite robust to false positives. This is important for IDE integration, where the [output base is often changed](https://bazel.build/run/scripts#output-base-option) for queries, to prevent concurrent builds from blocking them. An example of this is the vscode-bazel extension. Fixes #10653 Fixes #13951 Closes #21005. Commit 8f74ace PiperOrigin-RevId: 610667735 Change-Id: I1869c9a2063f7f526950e48c0b1ee6efa89fd202 Co-authored-by: Cameron Martin <cameronmartin123@gmail.com> Co-authored-by: Yun Peng <pcloudy@google.com>
A fix for this issue has been included in Bazel 7.1.0 RC2. Please test out the release candidate and report any issues as soon as possible. |
Description of the problem / feature request:
When changing the output base. Bazel no longer recognizes the
bazel-*
symlinks as it's own and parses the contents resulting in build failuesBugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Example repo at https://github.com/adamporich/simple-bazel-test just consists of a single passing test.
What operating system are you running Bazel on?
Above output is from Linux but occurs on Windows as well
What's the output of
bazel info release
?Have you found anything relevant by searching the web?
#11875 is a similar issue but in this case we don't need a root level glob to trigger
Any other information, logs, or outputs that you want to share?
I did try and use the https://docs.bazel.build/versions/4.2.1/command-line-reference.html#flag--experimental_convenience_symlinks option but it didn't seem to have an effect.
The text was updated successfully, but these errors were encountered: