Skip to content

Commit df4acbd

Browse files
alex-the-thirdgithub-actions[bot]
authored andcommitted
fix: use locale-neutral Windows ACL for build data (#3887)
On localized Windows installations, `build_data_writer.ps1` could fail when creating the output file ACL because it used the English localized `Everyone` principal name. This changes the ACL rule to use the language-neutral `WorldSid` identity instead, preserving the existing Everyone read permission without depending on the display language of Windows. Before: German and other localized Windows installs could fail with `IdentityMappedException` / `IdentityNotMappedException`. After: build data generation succeeds on localized Windows installs. Fixes #3886 Tests: `bazelisk test //tests/build_data:build_data_test --config=fast-tests` --------- Co-authored-by: Richard Levasseur <richardlev@gmail.com> (cherry picked from commit 8629003) Work towards #3867
1 parent 721ca37 commit df4acbd

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ expansion.
5454
* (rules) Fixed venv output paths for `py_binary` and `py_test` targets whose
5555
names contain path separators so distinct targets with the same basename no
5656
longer share the same venv output directory.
57+
* (windows) Fixed build data generation on localized Windows installations.
5758

5859
{#v2-2-0-added}
5960
### Added
@@ -76,6 +77,7 @@ and [#1975](https://github.com/bazel-contrib/rules_python/issues/1975).
7677

7778

7879

80+
7981
{#v2-1-0}
8082
## [2.1.0] - 2026-06-17
8183

python/private/build_data_writer.ps1

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,16 @@ $Utf8NoBom = New-Object System.Text.UTF8Encoding $False
2121
[System.IO.File]::WriteAllLines($OutputPath, $Lines, $Utf8NoBom)
2222

2323
$Acl = Get-Acl $OutputPath
24-
$AccessRule = New-Object System.Security.AccessControl.FileSystemAccessRule("Everyone", "Read", "Allow")
24+
# We use WorldSid because the "Everyone" name is locale-dependent.
25+
$EveryoneSid = New-Object System.Security.Principal.SecurityIdentifier(
26+
[System.Security.Principal.WellKnownSidType]::WorldSid,
27+
$null
28+
)
29+
$AccessRule = New-Object System.Security.AccessControl.FileSystemAccessRule(
30+
$EveryoneSid,
31+
"Read",
32+
"Allow"
33+
)
2534
$Acl.SetAccessRule($AccessRule)
2635
Set-Acl $OutputPath $Acl
2736

0 commit comments

Comments
 (0)