-
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
Remote Execution: Symlinks created by ctx.actions.symlink are not represented as symlinks remotely #16070
Comments
For the second form of Finally, I should note that it's a bad idea for actions to be sensitive to whether an input is a file or a symlink to said file, since sandboxed execution (which works by executing the action inside a symlink tree) would affect their outcome. |
But |
@tjgq Yes, that's completely correct. I only wanted to draw attention to the fact that even |
@tjgq : Is my understanding correct? If so, I would like to understand this a little better:
Do we see this behavior as final? That's how I interpret your answer. So basically I read that For future use-cases and guaranteed symlinks people then shall use
I agree with you, I anyhow understood from the current point of documentation, that a symlink creation is guaranteed. |
By contrast, when you call
I don't have a strong opinion. One could argue that making the contents of An important point I want to stress again, though, is that the contents of
Yes, I agree that the documentation is unclear; I was confused myself until it was pointed out to me that
I agree, although sadly you don't currently have that option if you wish to use remote execution (due to #10298).
|
Note: on Windows, |
I've just submitted 32b0f5a, which will cause non-symlink outputs created via |
This API does two different things and users occasionally get confused by it (see e.g. #16070). In particular, it is crucial to understand whether Bazel tracks the symlink on its own or the contents of its target. PiperOrigin-RevId: 483604065 Change-Id: Iab14c264eb320cd324b64b3af2a400df948dbf3c
This API does two different things and users occasionally get confused by it (see e.g. #16070). In particular, it is crucial to understand whether Bazel tracks the symlink on its own or the contents of its target. PiperOrigin-RevId: 483604065 Change-Id: Iab14c264eb320cd324b64b3af2a400df948dbf3c
This API does two different things and users occasionally get confused by it (see e.g. bazelbuild#16070). In particular, it is crucial to understand whether Bazel tracks the symlink on its own or the contents of its target. PiperOrigin-RevId: 483604065 Change-Id: Iab14c264eb320cd324b64b3af2a400df948dbf3c
This API does two different things and users occasionally get confused by it (see e.g. #16070). In particular, it is crucial to understand whether Bazel tracks the symlink on its own or the contents of its target. PiperOrigin-RevId: 483604065 Change-Id: Iab14c264eb320cd324b64b3af2a400df948dbf3c Co-authored-by: kshyanashree <[email protected]>
Re-reading the discussion, I don't believe there's anything left to do here, but let me know if you think otherwise. |
Description of the bug:
Using the remote execution capabilities of Bazel the behavior differs between a local and a remote execution.
When using ctx.actions.symlink() one would expect that the declared file is a symlink to some sort of source.
On a local execution this is the case. On a remote execution the declare file is directly represented by the symlinked file.
Thus, the content of the file is correct, but the semantics of the symlink are gone.
Build actions might rely on the semantics of a symlink and query, if a file is a symlink. This will lead to different results of local and remote executions which in worst case can cause a thread poisioning.
What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
A minimum reproducible example has been created:
https://github.com/castler/buildbarn_bazel_symlink_issue_repro#how-to-reproduce-the-issue
Which operating system are you running Bazel on?
Linux
What is the output of
bazel info release
?development version
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.Bazelisk using
last_green
.Using commit: 6efc2ab
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?
I first thought its a Remote Execution Service issue, which was analyzed here: buildbarn/bb-remote-execution#104
#11119 talks about that symlinks are not cached remotely. Maybe that has some similar root-cause.
#6547
666fce5 seemed related to me, but sadly did not fix the underlying problem.
Any other information, logs, or outputs that you want to share?
No response
The text was updated successfully, but these errors were encountered: