Repository navigation
Closed
Description
Please provide the following information. The more we know about your system and use case, the more easily and likely we can help.
Description of the problem / feature request / question:
If asking a question or requesting a feature, also tell us about the underlying problem you're trying to solve.
If possible, provide a minimal example to reproduce the problem:
Environment info
-
Operating System:
Windows Server 2012 R2 -
Bazel version (output of
bazel info release):
0.8.0
Have you found anything relevant by searching the web?
(e.g. StackOverflow answers,
GitHub issues,
email threads on the bazel-discuss Google group)
No.
Anything else, information or logs or outputs that would be helpful?
(If they are large, please upload as attachment or provide link).
$ bazel run :shell_wrapper
Loading:
Loading: 0 packages loaded
INFO: Analysed target //:shell_wrapper (0 packages loaded).
INFO: Found 1 target...
[0 / 5] BazelWorkspaceStatusAction stable-status.txt
Target //:shell_wrapper up-to-date:
C:/cygwin64/tmp/_bazel_wyan/zgiahg30/execroot/__main__/bazel-out/x64_windows-fastbuild/bin/shell_wrapper
C:/cygwin64/tmp/_bazel_wyan/zgiahg30/execroot/__main__/bazel-out/x64_windows-fastbuild/bin/shell_wrapper.exe
INFO: Elapsed time: 0.305s, Critical Path: 0.01s
INFO: Build completed successfully, 3 total actions
INFO: Running command line: C:/cygwin64/tmp/_bazel_wyan/zgiahg30/execroot/__main__/bazel-out/x64_windows-fastbuild/bin/shell_wrapper.exe ./hello_world.exe ./app.conf
PWD: /c/cygwin64/tmp/_bazel_wyan/zgiahg30/execroot/__main__/bazel-out/x64_windows-fastbuild/bin/shell_wrapper.exe.runfiles
===============================
MANIFEST
===============================
RUNFILES: C:\cygwin64\tmp\_bazel_wyan\zgiahg30\execroot\__main__\bazel-out\x64_windows-fastbuild\bin\shell_wrapper.runfiles
===============================
dir: cannot access 'C:\cygwin64\tmp\_bazel_wyan\zgiahg30\execroot\__main__\bazel-out\x64_windows-fastbuild\bin\shell_wrapper.runfiles': No such file or directory
===============================
dir: cannot access './hello_world.exe': No such file or directory
dir: cannot access './app.conf': No such file or directory
There are two problems:
- the PWD path's last section is shell_wrapper.exe.runfiles, but RUNFILES variable value does not have .exe in the path. So RUNFILES is an invalid path.
- app.conf is a source file. It is not in RUNFILES directory.
Both problems happen only on Windows. On Ubuntu, the RUNFILES is /home/wyan/.cache/bazel/_bazel_wyan/f48...26b/execroot/main/bazel-out/k8-fastbuild/bin/gcs_upload_wrapper.runfiles/main and all the files list in "data" are there.
Activity
laszlocsomor commentedon Dec 11, 2017
Bazel doesn't create a runfiles tree on Windows, it only does so on Linux/macOS. The value of
$RUNFILESis bogus. (Arguably Bazel shouldn't even set it on Windows.)On Windows Bazel creates a runfiles manifest, which is a text file that describes how the runfiles tree would look like. In each line there's a pair of paths: a relative path that on Linux/macOS would be the path of the symlink (under
$0.runfiles), and an absolute path that on Linux/macOS would be the path of the symlink target.To use runfiles on Windows, you have to grep the manifest file:
I don't understand the issue here. What was your expectation and what happened instead?
wyan-nestlabs commentedon Dec 11, 2017
I see it now. I guess it is OK to have RUNFILES with only MANIFEST inside. I have to requests:
PWD:
/c/cygwin64/tmp/_bazel_wyan/zgiahg30/execroot/__main__/bazel-out/x64_windows-fastbuild/bin/shell_wrapper.exe.runfiles# Has '.exe' in last segment of path, Exist in filesystem.RUNFILES:
C:\cygwin64\tmp\_bazel_wyan\zgiahg30\execroot\__main__\bazel-out\x64_windows-fastbuild\bin\shell_wrapper.runfiles# Not exist in filesystemapp.conf is in sh_binary's "data" and is a source. So I was expecting it in RUNFILES too. I see it in MANIFEST. So it is clear now.
laszlocsomor commentedon Dec 12, 2017
$RUNFILESshould point to the actual runfiles directory (with.exein the name). I created runfiles, Windows: $RUNFILES should point to the actual runfiles directory #4280 to track this.