Skip to content

Commit 974f5f6

Browse files
committed
fix(github-actions): replace C:\ to /mnt/c
Since Bazel will run in WSL under Windows we need to update the `--repository_cache` to use the WSL mounted path.
1 parent d753d89 commit 974f5f6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

github-actions/bazel/setup/setup-ci-bazelrc.mjs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import fs from 'fs';
77
// in the bazelrc file need to be escaled as otherwise those would escape
88
// followed characters that weren't supposed to be escaped.
99
const cachePath = path.join(os.homedir(), '.cache/bazel_repo_cache');
10-
const escapedCachePath = cachePath.replace(/\\/g, '\\\\');
10+
const escapedCachePath = cachePath.replace(/\\/g, '/');
1111

1212
const bazelRcContent = `
1313
# Print all the options that apply to the build.
@@ -16,7 +16,8 @@ const bazelRcContent = `
1616
build --announce_rc
1717
1818
# Avoids re-downloading NodeJS/browsers all the time.
19-
build --repository_cache=${escapedCachePath}
19+
# Replace path to make it compatable with WSL
20+
build --repository_cache=${escapedCachePath.replace(/c:\//i, '/mnt/c/')}
2021
2122
# More details on failures
2223
build --verbose_failures=true

0 commit comments

Comments
 (0)