-
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
runfiles_manifest cached incorrectly with output_user_root and output_base flags set #17267
Comments
Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 30 days. It will be closed in the next 7 days unless any other activity occurs or one of the following labels is added: "not stale", "awaiting-bazeler". |
@sgowroji Not stale as it's untriaged. |
I can't really say which team this belongs to, but I think it's pretty clear what the root cause is: |
@JesseTatasciore Can you also reproduce this if you change |
Wow, that's a very nice repro! Minimal, well-documented, straightforward. Kudos. (/me now starts grokking @fmeum 's fix) |
Sorry for the delay. You may have already tried this given there is an open PR. I just tried and I believe it needs to be "two different projects sharing an |
Description of the bug:
This bug can be encountered using a target that outputs a
runfiles_manifest
and contains a source file as an input. In this case, an absolute path to the source file will be stamped into therunfiles_manifest
. However, if we run 2 builds from 2 different clones of the same repo, on the same commit, withoutput_user_root
andoutput_base
set to the same paths on both builds, then therunfiles_manifest
will be incorrectly cached for the second clone / build. Therunfiles_manifest
on the second clone / build will contain a reference to the absolute path of the inputted source file located in the first clone.What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Create 2 identical bazel workspaces containing a simple
sh_binary
that references a source file in 2 different folders. Build both targets with--output_user_root
and--output_base
set to the same folders on both. Check the 2 differentrunfiles_manifest
files and they will contain the same absolute path. That of the source file from the first one built.A minimal example can be found here: https://github.com/JesseTatasciore/bazel-manifest-caching-repro
I added a simple script named
bazel_repro.sh
which will perform the instructions I mentioned above (create the clones, run the builds andcat
the differentmanifest_runfiles
files)Which operating system are you running Bazel on?
Confirmed on
macOS Monterey
(Apple M1) andAmazon Linux 2
(centos
). Please note that I have not tried on any other OS'sWhat 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
?No response
Have you found anything relevant by searching the web?
No
Any other information, logs, or outputs that you want to share?
This is some output of the script I mentioned in the minimal repro I provided:
From which, you can see that the absolute path under
Second Build runfiles_manifest
does not match the output fromSecond Build PWD
as it should. It hastest1
fromFirst Build PWD
instead of the expectedtest2
The text was updated successfully, but these errors were encountered: