Skip to content

Commit ae9c493

Browse files
committed
fix: support running with --enable_runfiles on Windows
I was finding the run and test commands on a nodejs binary on Windows gave an error message similar to the one mentioned in the following post when --enable_runfiles is passed in on the command line: #2178 (comment) Running with --noenable_runfiles, the tests worked correctly, but other packages in my repo require runfiles. This patch changes the resolution to use the MANIFEST file inside the runfiles folder when runfiles are enabled, which seems to fix the issue.
1 parent 7532f9e commit ae9c493

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

internal/common/windows_utils.bzl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ if "%~2" equ "" (
3131
echo>&2 ERROR: Expected two arguments for rlocation function.
3232
exit 1
3333
)
34+
35+
if "%RUN_UNDER_RUNFILES%" equ "1" (
36+
set %~2=%RUNFILES_DIR%/%~1
37+
set RUNFILES_MANIFEST_FILE=%RUNFILES_DIR%/MANIFEST
38+
exit /b 0
39+
)
40+
3441
if "%RUNFILES_MANIFEST_ONLY%" neq "1" (
3542
set %~2=%~1
3643
exit /b 0

0 commit comments

Comments
 (0)