-
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
How executable action can locate runfiles in both Windows and sandboxed execution #3726
Comments
/cc @davidstanke this is a blocker for building typescript on windows |
I will investigate and get back. Thank you very much for providing the repro case! |
runfiles manifest depends on local environment - it has absolute paths
…On Sep 13, 2017 19:02, "Philipp Wollermann" ***@***.***> wrote:
@ulfjack <https://github.com/ulfjack> @dslomov
<https://github.com/dslomov> It seems like the runfiles_manifest is not
in the inputs of a Spawn, but is created (because when disabling
sandboxing, the action in the repro example works).
Before I dive deeper into debugging this, do you have an idea out of your
head why this is the case?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3726 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AExrX6yTqN0g5lUAFjWlyoNbnzq-ysSzks5siAqlgaJpZM4PUunK>
.
|
The runfiles manifest is intentionally not in the inputs, like @dslomov says. This is WAI. We need to know what the actual problem is here. |
The bigger problem is, how can an executable action locate its runtime dependencies? Symlinks are not present on Windows, and the manifest is not present in a sandbox. There seems to be no way remaining for the |
That run wasn't from a Windows run, and you didn't mention Windows above. We don't have sandboxing on Windows at this time, and we do have some tools to do runfiles lookups on Windows. That said, I'm not sure we have adequately defined / designed a more permanent solution, but I'm sure it isn't making the current runfiles manifests (that contain absolute paths) available in the sandbox. |
I mentioned at the beginning of the description, "Under windows, runfiles must be accessed via the runfiles_manifest since there are no symlinks" but it could have been more clear: I would like to write the compiler once, and run on all platforms. I think you are saying this is not possible, even for a compiler that isn't platform-dependent (running in NodeJS) it needs to have separate file resolution logic for Windows than on Mac/Linux. That's also true for wrapper scripts that bootstrap the compiler (eg. find its entry point). What is the recommended pattern then, to write rules that work on all platforms? Look for a runfiles manifest file, and if not found, assume that the runfiles symlink tree is populated? |
This will work for now (I appreciate it is not awesome)
We need to provide good guidance to people willing to have rules that work cross-platform. One possible solution is make sure people can always rely on the manifest being present. That would mean that inside the sandbox, the manifest will point to the files inside the sandbox (sandbox will generate that file). |
I don't think we want to guarantee the existence of a runfiles manifest for every single action. |
Well, ok, I'll upgrade that to a maybe. Although I'm still hopeful that Microsoft will make symlinks usable. I don't think we'll be able to resolve it in this issue thread. If you need a short term solution, I'm afraid you'll have to go with separate logic on Windows vs. everything else. |
I apologize for missing the Windows reference in the first sentence. |
Thanks, all. We do have a big challenge to make the whole ecosystem work on
Windows. At least for Angular, I think this will be totally worth it :)
If you want to do anything with this issue, I guess the best would be a
mention in the docs somewhere of how an executable action should resolve
its runtime files.
…On Thu, Sep 14, 2017 at 7:58 AM Ulf Adams ***@***.***> wrote:
I apologize for missing the Windows reference in the first sentence.
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#3726 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAC5I_d_tNhCLRqX5yl68vCKCO8OvLCJks5siT8UgaJpZM4PUunK>
.
|
I use |
For NodeJS rules I wrapped the location expansion to give runfiles paths
https://github.com/bazelbuild/rules_nodejs/blob/a9c12cebee0c267a32330533b47c22fb08aa81f0/internal/node.bzl#L64
Then you just need to read the manifest file to locate that key like
https://github.com/bazelbuild/rules_nodejs/blob/a9c12cebee0c267a32330533b47c22fb08aa81f0/internal/check_bazel_version_test.py#L4
…On Tue, Oct 10, 2017, 4:52 AM Eugene Kliuchnikov ***@***.***> wrote:
I use $location substitution for (JVM) args for this. Works magically,
until you try it on windows - bazel does not link data dependencies to
.runfiles at all..
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#3726 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAC5IwqR568bri_zAWMHLTGBtyfy4U9zks5sqzA1gaJpZM4PUunK>
.
|
I think this could be closed in favor of #3889 |
In order to support running "compiler-cli" tests that use the "test_support.ts" utilities on Windows with Bazel, we need to imporve the logic that resolves NPM packages and symlinks them into a temporary directory. A more Bazel idiomatic and windows compatible way of resolving Bazel runfiles is to use the "RUNFILES_MANIFEST" if present. This ensures that the NPM packages can be also symlinked on Windows, and tests can execute properly on Windows. Read more about why this is needed here: * bazelbuild/bazel#3726 (comment)
In order to support running "compiler-cli" tests that use the "test_support.ts" utilities on Windows with Bazel, we need to imporve the logic that resolves NPM packages and symlinks them into a temporary directory. A more Bazel idiomatic and windows compatible way of resolving Bazel runfiles is to use the "RUNFILES_MANIFEST" if present. This ensures that the NPM packages can be also symlinked on Windows, and tests can execute properly on Windows. Read more about why this is needed here: * bazelbuild/bazel#3726 (comment) PR Close #28352
In order to support running "compiler-cli" tests that use the "test_support.ts" utilities on Windows with Bazel, we need to imporve the logic that resolves NPM packages and symlinks them into a temporary directory. A more Bazel idiomatic and windows compatible way of resolving Bazel runfiles is to use the "RUNFILES_MANIFEST" if present. This ensures that the NPM packages can be also symlinked on Windows, and tests can execute properly on Windows. Read more about why this is needed here: * bazelbuild/bazel#3726 (comment)
In order to support running "compiler-cli" tests that use the "test_support.ts" utilities on Windows with Bazel, we need to imporve the logic that resolves NPM packages and symlinks them into a temporary directory. A more Bazel idiomatic and windows compatible way of resolving Bazel runfiles is to use the "RUNFILES_MANIFEST" if present. This ensures that the NPM packages can be also symlinked on Windows, and tests can execute properly on Windows. Read more about why this is needed here: * bazelbuild/bazel#3726 (comment)
In order to support running "compiler-cli" tests that use the "test_support.ts" utilities on Windows with Bazel, we need to imporve the logic that resolves NPM packages and symlinks them into a temporary directory. A more Bazel idiomatic and windows compatible way of resolving Bazel runfiles is to use the "RUNFILES_MANIFEST" if present. This ensures that the NPM packages can be also symlinked on Windows, and tests can execute properly on Windows. Read more about why this is needed here: * bazelbuild/bazel#3726 (comment) PR Close #28550
Description of the problem / feature request / question:
Under windows, runfiles must be accessed via the runfiles_manifest since there are no symlinks.
However, this file is absent under the sandbox.
If possible, provide a minimal example to reproduce the problem:
https://gist.github.com/alexeagle/d7c57183f548c428469bec6ec4113419
The
find
command inrepro.sh
lists all the files visible when the sandboxed action executes; the manifest file isn't present at all./cc @philwo
Environment info
Operating System:
Bazel version (output of
bazel info release
):$ bazel version
Build label: 0.5.4-homebrew
Build target: bazel-out/darwin_x86_64-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Fri Aug 25 16:55:29 2017 (1503680129)
Build timestamp: 1503680129
Build timestamp as int: 1503680129
If
bazel info release
returns "development version" or "(@non-git)", please tell us what source tree you compiled Bazel from; git commit hash is appreciated (git rev-parse HEAD
):Have you found anything relevant by searching the web?
(e.g. StackOverflow answers,
GitHub issues,
email threads on the
bazel-discuss
Google group)Anything else, information or logs or outputs that would be helpful?
(If they are large, please upload as attachment or provide link).
The text was updated successfully, but these errors were encountered: