Skip to content

Commit

Permalink
fix: support running with --enable_runfiles on Windows
Browse files Browse the repository at this point in the history
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:

bazel-contrib#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.
  • Loading branch information
dae committed Oct 28, 2020
1 parent 7532f9e commit 04e5f1d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/common/windows_utils.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ if "%RUNFILES_MANIFEST_ONLY%" neq "1" (
set %~2=%~1
exit /b 0
)
if "%RUN_UNDER_RUNFILES%" equ "1" (
set RUNFILES_MANIFEST_FILE=%RUNFILES_DIR%\MANIFEST
)
if "%RUNFILES_MANIFEST_FILE%" equ "" (
set RUNFILES_MANIFEST_FILE=%~f0.runfiles\MANIFEST
)
Expand Down

0 comments on commit 04e5f1d

Please sign in to comment.