-
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 executor used in tests does not support dangling symlinks #16289
Comments
The tests don't currently pass due to bazelbuild#16290 and bazelbuild#16289. Making them pass might be considered a blocker for bazelbuild#10298 (declaring unresolved symlinks stable).
I think the more important point is whether RBE itself supports unresolved symlinks; to my best understanding, yes. I would be okay with releasing Bazel 6.0 without that bit of test infrastructure, if necessary, but it would be better not to do so. So let's make this, P2 and a release blocker, with maybe revisiting the latter it if we are in a time crunch? |
The remote execution spec definitely supports actions that create a symlink, but it doesn't say whether the symlink must point to an existing file or directory or not (at least according to my reading). The relevant protocol fields are The Google Cloud RBE implementation, as far as I can tell, silently fails to report a dangling output symlink. I don't know about other implementations. A minimal repro is at https://github.com/tjgq/bazel-rbe-unresolved-symlink (but note that, even if the RBE implementation worked, the build would still fail on the Bazel side due to #16290). |
cc @bazelbuild/remote-execution |
Oof. For some reason, I thought that the Google's version of remote execution does handle both input and output symlinks. Then there is no alternative than to implement it in our mock backend if we want to test the functionality and we should definitely do so. |
I've confirmed with folks who work on Google RBE that output symlinks are not currently implemented (specifically, symlinks that resolve successfully are reported as the regular files or directories that they resolve to, and dangling symlinks are omitted from the outputs entirely). So we do need to test against the mock backend. |
Since we don't know whether a dangling symlink is supposed to point to a file or a directory, we always report it as a symlink to a file. The distinction only matters in V2 of the protocol, with V2.1 reporting them uniformly, so it doesn't seem to be worth the effort to match up the input and output types. Dangling symlinks to absolute paths are unconditionally uploaded. A followup PR will gate their upload on the presence of the respective server capability (SymlinkAbsolutePathStrategy.ALLOW). Progress towards bazelbuild#16289.
Since we don't know whether a dangling symlink is supposed to point to a file or a directory, we always report it as a symlink to a file. The distinction only matters in V2 of the protocol, with V2.1 reporting them uniformly, so it doesn't seem to be worth the effort to match up the input and output types. Dangling symlinks to absolute paths are unconditionally uploaded. A followup PR will gate their upload on the presence of the respective server capability (SymlinkAbsolutePathStrategy.ALLOW). The change is behind a new --incompatible_remote_dangling_symlinks flag, which will be introduced in the flipped state. See #16353. Progress towards #16289. Closes #16352. PiperOrigin-RevId: 477735370 Change-Id: I6210d152529e4603a49377a9e72e8e116ced6b85
This was fixed by 5b46a48. |
Since we don't know whether a dangling symlink is supposed to point to a file or a directory, we always report it as a symlink to a file. The distinction only matters in V2 of the protocol, with V2.1 reporting them uniformly, so it doesn't seem to be worth the effort to match up the input and output types. Dangling symlinks to absolute paths are unconditionally uploaded. A followup PR will gate their upload on the presence of the respective server capability (SymlinkAbsolutePathStrategy.ALLOW). The change is behind a new --incompatible_remote_dangling_symlinks flag, which will be introduced in the flipped state. See bazelbuild#16353. Progress towards bazelbuild#16289. Closes bazelbuild#16352. PiperOrigin-RevId: 477735370 Change-Id: I6210d152529e4603a49377a9e72e8e116ced6b85
When attempting to remotely execute an action that produces a dangling symlink, the remote executor throws an exception here: https://cs.opensource.google/bazel/bazel/+/master:src/main/java/com/google/devtools/build/lib/remote/UploadManifest.java;l=194;drc=93029d8f1f01be440d8e06cce9585ad912f9169b
This must be fixed before integration tests for dangling symlinks can be added. This may be a blocker for #10298.
The text was updated successfully, but these errors were encountered: