Skip to content

Commit 83d406b

Browse files
meteorcloudyCopybara-Service
authored and
Copybara-Service
committed
Windows, test-setup.sh: Setting RUNFILES_MANIFEST_FILE only when it exists.
Make remote execution work on Windows again. RELNOTES: None PiperOrigin-RevId: 216724305
1 parent d729f91 commit 83d406b

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

src/test/py/bazel/windows_remote_test.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,20 @@ def testShTestRunsRemotely(self):
124124
')',
125125
])
126126
self.ScratchFile(
127-
'foo/foo_test.sh', ['#!/bin/sh', 'echo hello test'], executable=True)
127+
'foo/foo_test.sh', [
128+
'#!/bin/sh',
129+
'echo hello test',
130+
'echo "RUNFILES_MANIFEST_FILE: \\"${RUNFILES_MANIFEST_FILE:-}\\""'
131+
],
132+
executable=True)
128133
self.ScratchFile('bar/BUILD', ['exports_files(["bar.txt"])'])
129134
self.ScratchFile('bar/bar.txt', ['hello'])
130135

131136
# Test.
132137
exit_code, stdout, stderr = self._RunRemoteBazel(
133138
['test', '--test_output=all', '//foo:foo_test'])
134139
self.AssertExitCode(exit_code, 0, stderr, stdout)
140+
self.assertIn('RUNFILES_MANIFEST_FILE: ""', stdout)
135141

136142
# The Java launcher uses Rlocation which has differing behavior for local and
137143
# remote.

tools/test/test-setup.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,9 @@ function rlocation() {
126126

127127
export -f rlocation
128128
export -f is_absolute
129-
# If RUNFILES_MANIFEST_ONLY is set to 1, then test programs should use manifest file to find
130-
# runfiles.
131-
if [[ "${RUNFILES_MANIFEST_ONLY:-}" == "1" ]]; then
129+
# If RUNFILES_MANIFEST_ONLY is set to 1 and the manifest file does exist,
130+
# then test programs should use manifest file to find runfiles.
131+
if [[ "${RUNFILES_MANIFEST_ONLY:-}" == "1" && -e "${RUNFILES_MANIFEST_FILE:-}" ]]; then
132132
export RUNFILES_MANIFEST_FILE
133133
export RUNFILES_MANIFEST_ONLY
134134
fi

0 commit comments

Comments
 (0)