-
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
Include the full absolute paths of runfiles in action keys #19171
Conversation
e07fcfb
to
bb35179
Compare
bb35179
to
30f3cf5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, looks good, but @c-parsons might have an opinion about this, let me pull him in.
src/main/java/com/google/devtools/build/lib/analysis/SourceManifestAction.java
Outdated
Show resolved
Hide resolved
This looks good in principle, with one caveat: @c-parsons ran into a situation where it would be advantageous to be able to move Bazel output bases around in the file system while keeping as much cached as possible, and this makes that worse. However, I think it's for the better, because it just makes the reality that the absolute path of the source tree is an input of what the source manifes action does more obvious, so let's go ahead; I'll wait for a confirmation from @c-parsons , but I'd be surprised if he had an objection. |
Out of curiosity, how come you haven't been able to write an integration test? I thought it would be pretty easy to wrap the reproduction at https://github.com/JesseTatasciore/bazel-manifest-caching-repro into a test case. |
5a1c4b8
to
99f863f
Compare
Tried this again and now the test is failing without and passing with the change. Not sure what I got wrong on the first attempt. |
@lberki Should I just skip the test on Windows? I don't know whether it's possible to get the unmangled PWD in Bash on Windows. |
@meteorcloudy maybe you have an idea? I'm not very enthusiastic about skipping the test on Windows due to the difficulty of debugging Windows-only issues. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks alright, modulo one nit and that I haven't heard from @c-parsons ; if he doesn't weigh in until tomorrow, let's assume he's fine with it.
|
||
mkdir -p "${OUTPUT_BASE}" | ||
mkdir -p "${TEST_FOLDER_1}" | ||
mkdir -p "${TEST_FOLDER_2}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: symlinking $TEST_FOLDER_2
to $TEST_FOLDER_1
makes it more obvious that the two are the same
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am copying the contents now. I think that symlinking wouldn't work as the "same workspace, same output root" case didn't result in any issues even before this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought that Bazel doesn't resolve symlinks in the name of the workspace, but you're right -- copying is the obviously correct option.
We are using msys2 on windows, you can use cygpath to convert the path to a format that is understandable on Windows. For example, |
It's |
d1a19bf
to
ee935e4
Compare
Thanks @meteorcloudy, the tests are passing now. |
/cc @lberki LGTM? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I asked @c-parsons to weigh in and given that he didn't and that to the best of my knowledge, his use case is not hampered by this change, let's merge it.
Both `SourceManifestAction` and `SymlinkTreeAction`, the only users of `Runfiles#fingerprint`, emit absolute paths to runfiles artifacts in their output. This requires also including these paths in the action key computation to prevent incorrect incremental builds if `--output_base` changes.
ee935e4
to
6114338
Compare
@lberki I resolved the merge conflict. |
No worries, we are doing the same at Google (it just takes a bit of time, sorry about that) |
Both
SourceManifestAction
andSymlinkTreeAction
, the only users ofRunfiles#fingerprint
, emit absolute paths to runfiles artifacts in their output. This requires also including these paths in the action key computation to prevent incorrect incremental builds if--output_base
changes.Fixes #17267