8000 fix: read-only toolchain lib folder under Windows · bazel-contrib/rules_python@43bdb71 · GitHub
[go: up one dir, main page]

Skip to content 8000

Commit 43bdb71

Browse files
committed
fix: read-only toolchain lib folder under Windows
We already set the lib folder to read-only on macOS and Linux, so we need to set on Windows as well. This should solve the problem of .pyc files changing a busting the cache. Signed-off-by: Thulio Ferraz Assis <3149049+f0rmiga@users.noreply.github.com>
1 parent b5c0c0b commit 43bdb71

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

python/repositories.bzl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,10 @@ def _python_repository_impl(rctx):
102102
exec_result = rctx.execute(["chmod", "-R", "ugo-w", "lib"])
103103
if exec_result.return_code:
104104
fail(exec_result.stderr)
105+
else:
106+
exec_result = rctx.execute(["attrib", "+r", "%cd%\\lib\\*.*", "/s", "/d"])
107+
if exec_result.return_code:
108+
fail(exec_result.stderr)
105109

106110
python_bin = "python.exe" if ("windows" in platform) else "bin/python3"
107111

0 commit comments

Comments
 (0)
0