Skip to content

rules_py: uv host repo reports libsystem 14.0 on macOS without running sw_vers (part of #12277) - #12824

Draft
TrapsterDK wants to merge 3 commits into
mainfrom
fix-12277-hermetic-cpp-rust
Draft

TrapsterDK wants to merge 3 commits into
mainfrom
fix-12277-hermetic-cpp-rust

Conversation

@TrapsterDK

@TrapsterDK TrapsterDK commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Part of #12277

//tools/testing/hermetic:cpp_rust on macos_arm64 fails during the fetch probe. This PR fixes two of those fetch failures:

  • rules_py++host_platform+rules_py_uv_host: sw_vers is not on the hermetic PATH, so ver[1] was out of range (ci.yml run 43706723775). host_libc_glibc.patch now returns libsystem, 14.0 on macOS.
  • remotejdk21_macos_aarch64: its patch_cmds ran bash from the applet-only PATH (execvp(bash, ...), evidence run 43835976571). Probes now run Bazel with BAZEL_SH=/bin/bash, which repository patch commands use.

Tests:

  • Locally (linux_x86_64): //tools/testing/hermetic:hermetic_unit_test passes; the rules_py patch applies.
  • tools/dx check --affected timed out after 1200s locally; not checked.
  • //patches:update_readme_test fails on main too: patches/README.md: fmt has no override in MODULE.bazel (row not touched here).
  • Nested/consumer tests not run locally.
  • Evidence: macos_arm64 run 43838072092 gets past both failures above and now fails on rules_python++python+python_3_14_aarch64-apple-darwin: Unable to find the binary 'install_name_tool' on PATH.

Also: new patches/rules_python/install_name_tool.patch (patch applies to 2.4.6 locally).

Remaining on #12277:

  • macOS: install_name_tool.patch (rules_python) uses /usr/bin/install_name_tool; not run on macOS, needs a new evidence run.
  • windows_x86_64 hermetic-windows and linux_arm64 hlint have not been investigated here.
  • Scheduled ci.yml on main reaching dogfood; the owner has to decide on the dogfood needs.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xut2hzwNN9Q3DFZx18pNic

@TrapsterDK

Copy link
Copy Markdown
Collaborator Author

Review: changes requested

Must fix before merge:

  1. patches/rules_py/host_libc_glibc.patch:1: the PR is CONFLICTING with main. main's copy of this patch changed (nested: indirect consumer builds a cc_binary with its own C++ toolchain (part of #12601) #12823 touched it, and its osx branch now runs /usr/bin/sw_vers), so the hunk header and context in this PR no longer match. Rebase, regenerate the patch against rules_py 2.0.0-alpha.11, and confirm it applies.
  2. tools/testing/hermetic/src/lib.rs:1410 and :1528: after the rebase, recheck UNIX_ENV_PREFIX = 11 and the argv[..7], argv[9..] and argv[10..] indices in tools/testing/hermetic/src/tests.rs. main's bazel_argv test has a different env prefix (HOME present, PATH=/usr/bin:/bin), so the counts here are likely off. Run //tools/testing/hermetic:hermetic_unit_test on the rebased branch.
  3. patches/README.md:46: it says the macOS version is reported "without running sw_vers". Reword it after the rebase so it matches main's row.

The PR is still draft, and its fix needs a macos_arm64 evidence run, so keep it draft until that run is green.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Xut2hzwNN9Q3DFZx18pNic

TrapsterDK and others added 3 commits November 16, 2026 10:48
…g sw_vers (part of #12277)

The hermetic cpp_rust qualification on macos_arm64 failed fetching
rules_py_uv_host: sw_vers is not on the hermetic PATH, so the version
split had one element. Report the 14.0 floor the apple rules target.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xut2hzwNN9Q3DFZx18pNic
The macOS remotejdk patch_cmds ran `bash` from the applet-only PATH and
failed with execvp(bash). Repository patch commands now take BAZEL_SH.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xut2hzwNN9Q3DFZx18pNic
… (part of #12277)

The hermetic PATH holds only applets, so which(install_name_tool) failed
while fetching the macOS CPython repo.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Xut2hzwNN9Q3DFZx18pNic
@TrapsterDK

Copy link
Copy Markdown
Collaborator Author

Fixed: rebased onto origin/main and regenerated patches/rules_py/host_libc_glibc.patch (conflict resolved); rechecked UNIX_ENV_PREFIX (11) and test indices (hermetic_unit_test passes); patches/README.md row reads correctly after rebase.

@TrapsterDK
TrapsterDK force-pushed the fix-12277-hermetic-cpp-rust branch from 3840104 to b1135d1 Compare November 16, 2026 09:49

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-review Touches review paths; needs a second-session Review: comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant