Skip to content

Commit 1299307

Browse files
authored
fix(toolchain): no chmod on windows when downloading hermetic toolchain (#2693)
Previously the code would not chmod for the Windows hermetic toolchains because there is usually no need - Windows does not have chmod and if you are downloading the Windows repo on a UNIX system, you won't run it, so it will stay as is. However, that left a single case where somebody may want to download the Linux toolchain on a Windows and the main cases are: * `bazel sync` * build a docker image on Windows using `rules_oci` or similar. Fixes #2660
1 parent 175fe4c commit 1299307

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

CHANGELOG.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ Unreleased changes template.
5757

5858
{#v0-0-0-fixed}
5959
### Fixed
60-
* Nothing fixed.
60+
* Do not try to run `chmod` when downloading non-windows hermetic toolchain
61+
repositories on Windows. Fixes
62+
[#2660](https://github.com/bazel-contrib/rules_python/issues/2660).
6163

6264
{#v0-0-0-added}
6365
### Added

python/private/python_repository.bzl

+3-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,9 @@ def _python_repository_impl(rctx):
127127
# pycs being generated at runtime:
128128
# * The pycs are not deterministic (they contain timestamps)
129129
# * Multiple processes trying to write the same pycs can result in errors.
130-
if "windows" not in platform:
130+
#
131+
# Note, when on Windows the `chmod` may not work
132+
if "windows" not in platform and "windows" != repo_utils.get_platforms_os_name(rctx):
131133
repo_utils.execute_checked(
132134
rctx,
133135
op = "python_repository.MakeReadOnly",

0 commit comments

Comments
 (0)