-
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
Stabilize unresolved symbolic links (--experimental_allow_unresolved_symlinks) #10298
Comments
--experimental_allow_unresolved_symlinks
)
--experimental_allow_unresolved_symlinks
)
@laurentlb , @laszlocsomor , what do you think? The main blockers I see is that RBE doesn't support this yet (the protocol itself does, but we haven't wired it up yet within Bazel) and that it probably fails on Windows in all sorts of interesting ways. Neither of these are insurmountable problems and if I squinted the right way, I could even argue that they are not necessary for declaring the functionality stable, but I just can't sign up for doing them at the moment. |
@lberki : Why do you suppose it fails on Windows? |
Try I admit I haven't tried it on Windows. There is a chance that it works since all that's needed is |
...oh, and |
Thanks! The test fails here:
...because the build succeeds though it shouldn't. (Note: I edited the test to use |
bazel/src/main/java/com/google/devtools/build/lib/windows/WindowsFileSystem.java Lines 85 to 89 in b1e232d
|
@lberki : |
This seems to be failing on macOS if paired with remote caching;
|
AFAIK this has been experimental since Bazel 1.0. Is progress likely? |
Any updates? |
I hit this recently as well. I was using the feature to break circular deps between npm packages (which sadly exist in some 3rd party packages). Confirmed that it does not work with remote execution. I also hit a bug in bazel itself related to this where the bazel/src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkActionFactory.java Line 195 in a32a0fd
|
Looking at the history of this issue, the main blockers seem to be Windows and RBE support. Once those are fixed (or we decide that they don't matter), we can move this feature out of the experimental domain. @coeuvre : What do you think about updating our RBE support to support unresolved symbolic links? I realize you are busy so I was thinking about soliciting pull requests from the community. @meteorcloudy : given that symlinks are not a very common thing on Windows, can we get away without supporting unresolved symlinks? I don't even know if NTFS supports dangling symlinks; if it doesn't, then the decision is easy because then unresolved symlinks don't make all that much sense, do they? |
@lberki My guess is that it will work correctly [--windows_enable_symlinks](with https://bazel.build/reference/command-line-reference#flag--windows_enable_symlinks), NTFS does support dangling symlinks. Is there a simple test that I can run to verify? |
|
Oh, it passes because it's skipped on windows.. |
@lberki
I believe Windows isn't really a blocker, dangling symlinks and dangling junctions both work. |
@meteorcloudy then that leaves RBE support, I guess. (plus some glue logic to hard-wire the value of this flag to false within Google, but that, I can throw in since contributions don't work for that one) |
Is Alessandro's comment about remote caching on MacOS still relevant? |
@gregmagolan Could you confirm whether remote execution support for actions that produce unresolved symlinks is a blocker for rules_nodejs? (This doesn't currently work in Bazel, even after @fmeum's changes; consuming unresolved symlinks remotely, on the other hand, does work.) |
Unresolved symlink artifacts created with `ctx.actions.symlink(target_path = ...)` are now created without making the target path absolute by prepending the exec root, which diverged from the documentation and intended goal and also gave rise to hermeticity issues as such symlinks would regularly resolve outside the sandbox. Furthermore, in order to bring local execution in line with other execution types, the runfiles manifest entry (and thus the runfiles directory contents) for symlink artifacts are now their target paths rather than their exec paths, which along the way resolves another soure of non-hermetic resolution outside the runfiles directory. This requires making symlink artifacts (but not artifacts representing regular files) inputs of `SourceManifestAction`, which previously had no inputs. The change flattens a nested set in `getInputs`, but benchmarks confirm that this does not result in a performance regression. Alternatives considered either result in a substantially worse Starlark API or wouldn't work for symlinks created by spawns. Work towards #10298 Closes #16272. PiperOrigin-RevId: 474784371 Change-Id: I15d318c30542c1da54d86d9b1ae769fe2a0ec970
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).
@tjgq Thanks for checking. Actions that output unresolved symlinks running in RBE are not needed. Only that RBE can handle unresolved symlink inputs. |
Does anyone have a simple-to-reproduce case where dangling symlinks work with standalone execution but not with sandboxed execution? The cases I thought we have actually fail without |
I have resolved a major bug in my understanding of the symlink handling, and believe that with #15982 there are no more blockers in the way symlinks are handled for sandboxes. |
@larsrc-google do I understand correctly that the last blocker was #16290 which just got fixed? |
No more blockers from my side. @tjgq is tracking the RBE-related bits. |
...and @meisterT says that it's all good on the remote execution side, so then I assume all bits are ready, except for flag administration (we don't want this to be enabled within Google) |
Can someone clarify what else action items are needed for this issue? If none, let's close this one to reduce the number of release blockers for 6.0. |
I do believe that covers everything needed for 6.0. |
@larsrc-google Aren't we missing a commit that removes the |
Arg. Yes, you're right. Starting on that. |
Also adds support for such symlinks to the remote worker implementation. Work towards bazelbuild#10298 Closes bazelbuild#15781. PiperOrigin-RevId: 469196671 Change-Id: I441da6d0a658d142153ada6cc0f836bf2ed3bcff
Unresolved symlink artifacts created with `ctx.actions.symlink(target_path = ...)` are now created without making the target path absolute by prepending the exec root, which diverged from the documentation and intended goal and also gave rise to hermeticity issues as such symlinks would regularly resolve outside the sandbox. Furthermore, in order to bring local execution in line with other execution types, the runfiles manifest entry (and thus the runfiles directory contents) for symlink artifacts are now their target paths rather than their exec paths, which along the way resolves another soure of non-hermetic resolution outside the runfiles directory. This requires making symlink artifacts (but not artifacts representing regular files) inputs of `SourceManifestAction`, which previously had no inputs. The change flattens a nested set in `getInputs`, but benchmarks confirm that this does not result in a performance regression. Alternatives considered either result in a substantially worse Starlark API or wouldn't work for symlinks created by spawns. Work towards bazelbuild#10298 Closes bazelbuild#16272. PiperOrigin-RevId: 474784371 Change-Id: I15d318c30542c1da54d86d9b1ae769fe2a0ec970
@meisterT what about the rename? |
See my comment here: #16458 (comment) |
Description of the problem / feature request:
#9075 added support for unresolved symlinks, via the
actions.declare_symlink()
andactions.symlink()
functions. That functionality is currently gated by--experimental_allow_unresolved_symlinks
.I've discovered that unresolved symlinks are critical for supporting hermetic Node.JS builds. Specifically, Node's use of symlinks for module resolution semantics mean that we need to be able to create symlink artifacts that reference dependencies and can be used as runfiles, but exist outside the runfiles root.
What are the current blockers to stabilizing unresolved symlinks? Is there a list of known remaining work to get them enabled by default?
cc @lberki @laszlocsomor
The text was updated successfully, but these errors were encountered: