-
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
sh_test does not work remotely on Windows #4962
Comments
#3726 is pretty relevant as well, in particular "the manifest is not present in a sandbox", with reply "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." |
My repro attempt failed with this error:
The jvm.out file is empty. I don't know what file I should set to |
Ah, sorry. This works when using a GCE VM. It may be sufficient to set |
Update: It turns out that remote execution for Windows provides quite a different environment. In fact, a Because of the nature of remote execution, all the runfiles are actually present in the runfiles tree on the remote worker (this is because you must ship actual files to remote workers on all platforms, so symlinks are resolved before packaging up the input tree). This contrasts to local execution of Windows, where the runfiles tree is empty, and the MANIFEST is used to find actual files. This means that remote Windows execution looks a lot like remote Linux execution from the point of view of runfiles. Two places are affected by this for Windows remote execution:
I will prepare an example pull request containing my hacky change for illustration purposes. |
Thanks for investigating! bazel/src/tools/runfiles/java/com/google/devtools/build/runfiles/Runfiles.java Lines 55 to 61 in 2a5512f
But we do need to make change to the launcher |
Yun, I guess the launcher can use the runfiles library when it's ready. Unfortunately I'm finding insufficient time lately to finish anything, including the runfiles library. |
@jasharpe , the thanks |
I discussed with @meteorcloudy and I will try to make a pull request to (for now) change the launcher to attempt to fall back to a directory approach if the MANIFEST file is missing. I think this simplifies things since it'll just work in both environments without having to pass any state in. (For tests the launcher can check the setting of RUNFILES_MANIFEST_ONLY, but this doesn't work for other remotely run executables like tools for genrules. So the options are this falling back strategy, or adding some additional environment variables.) Any objections to that? The issue of not setting RUNFILES_MANIFEST_ONLY for remote tests I will handle separately. As far as I know the cases I will need to handle for remote execution are:
|
Since I promised to share my hacky change to make sh_tests work, here it is: DISCLAIMER: Hacky! jasharpe/bazel@master...jasharpe:hacky_runfiles May be useful in understanding what issues I'm trying to deal with. |
The repro case in the initial issue is for a test (sh_test in particular), but another interesting case for a fix to be tested on is genrules. I have created a repro case for this. Here's the BUILD file:
If you build this genrule remotely you get:
|
One more thing that satisfies my own curiosity, I just discovered that the reason manifests aren't written for remote builds is this: https://github.com/bazelbuild/bazel/blob/master/src/main/java/com/google/devtools/build/lib/analysis/SourceManifestAction.java#L141 |
The comment's reasoning makes sense though. |
… to validate this key use case for remote Windows builds. This is a working test case, but I plan to add more in this style to demonstrate fixes to address bazelbuild#4962.
… to validate this key use case for remote Windows builds. This is a working test case, but I plan to add more in this style to demonstrate fixes to address bazelbuild#4962.
… to validate this key use case for remote Windows builds. This is a working test case, but I plan to add more in this style to demonstrate fixes to address bazelbuild#4962.
… to validate this key use case for remote Windows builds. This is a working test case, but I plan to add more in this style to demonstrate fixes to address bazelbuild#4962.
… to validate this key use case for remote Windows builds. This is a working test case, but I plan to add more in this style to demonstrate fixes to address bazelbuild#4962.
… to validate this key use case for remote Windows builds. This is a working test case, but I plan to add more in this style to demonstrate fixes to address #4962. Note that to run this test requires a build of Bazel that includes b4545ba since this changed the way runfile manifests are discovered. Bazel 0.11 doesn't include this. RELNOTES: None. PiperOrigin-RevId: 192444770
Description of the problem / feature request:
sh_test rules (and probably others) do not work on Windows when using remote execution, due to a missing runfiles manifest file.
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
On a Windows Server 2016 VM with Bazel 0.11.1 installed:
Copy these files to there:
BUILD: https://gist.github.com/jasharpe/4566c496b222eaf45771ee815b1544e7
.bazelrc: https://gist.github.com/jasharpe/9edadeee13396b0efdddd6d21faeae3a
pass.sh: https://gist.github.com/jasharpe/70df48ca39a799825cc03099e9083086
The error printed is something like:
Indeed if you check this directory, it does not contain a file called MANIFEST:
What operating system are you running Bazel on?
Windows Server 2016 (1709)
What's the output of
bazel info release
?release 0.11.1
If
bazel info release
returns "development version" or "(@non-git)", tell us how you built Bazel.N/A
What's the output of
git remote get-url origin ; git rev-parse master ; git rev-parse HEAD
?N/A
Have you found anything relevant by searching the web?
Closest thing seems #1593 and #2296 but I'm not sure it's the same problem, and both were closed a while ago.
Any other information, logs, or outputs that you want to share?
The text was updated successfully, but these errors were encountered: