Skip to content

perf: migrate bash launcher to hermetic-build#1045

Open
jbedard wants to merge 2 commits into
mainfrom
hermetic-build
Open

perf: migrate bash launcher to hermetic-build#1045
jbedard wants to merge 2 commits into
mainfrom
hermetic-build

Conversation

@jbedard
Copy link
Copy Markdown
Member

@jbedard jbedard commented May 22, 2026

Changes are visible to end-users: yes

  • Searched for relevant documentation and updated as needed: yes
  • Breaking change (forces users to change their own code or config): no
  • Suggested release notes appear below: yes

Use https://github.com/hermeticbuild/hermetic-launcher to launch the python toolchain instead of depending on a shell wrapper.

Test plan

  • Covered by existing test cases
  • Manual testing

@aspect-workflows
Copy link
Copy Markdown

aspect-workflows Bot commented May 22, 2026

Bazel 8 (Test)

All tests were cache hits

183 tests (100.0%) were fully cached saving 1m 5s.


Bazel 9 (Test)

All tests were cache hits

182 tests (100.0%) were fully cached saving 1m 10s.


Bazel 8 (Test)

e2e

All tests were cache hits

136 tests (100.0%) were fully cached saving 1m 21s.


Bazel 9 (Test)

e2e

All tests were cache hits

131 tests (100.0%) were fully cached saving 1m 1s.


Bazel 8 (Test)

examples/uv_pip_compile

All tests were cache hits

1 test (100.0%) was fully cached saving 444ms.


Buildifier      Gazelle

@jbedard jbedard force-pushed the hermetic-build branch 2 times, most recently from 491171d to dbccde5 Compare May 22, 2026 07:11
# Make wheel-declared console scripts reachable via `subprocess.run("name", ...)`.
_venv_bin = os.path.join(sys.prefix, "bin")
if _venv_bin not in os.environ.get("PATH", "").split(os.pathsep):
os.environ["PATH"] = _venv_bin + os.pathsep + os.environ.get("PATH", "")
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does anyone know of a better way of doing this? Should it be opt-in?

@jbedard jbedard marked this pull request as ready for review May 22, 2026 17:07
@jbedard jbedard requested a review from dzbarsky May 22, 2026 17:07
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dbccde5e29

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread py/private/py_venv/_virtualenv.py Outdated
@@ -1,5 +1,12 @@
"""quasi-public types."""

PyExecutableInfo = provider(
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This replaces the __PEX_PY_BINARY_ENTRYPOINT__ we were inserting into the shell script.

I don't know the history behind py_pex_binary or if this is the ideal solution. @thesayyn?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should not be needed now that we have b5ecd19

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because we can just use DefaultInfo.executable or something like that?

Comment thread py/private/py_venv/types.bzl Outdated
@jbedard jbedard force-pushed the hermetic-build branch 2 times, most recently from b5ecd19 to fe6c33c Compare May 28, 2026 17:20
@aspect-workflows
Copy link
Copy Markdown

aspect-workflows Bot commented May 28, 2026

✨ Aspect Workflows Tasks

📅 Fri May 29 21:53:27 UTC 2026

🔄 2 in progress tasks

  • 🔄 test (test-e2e-bazel-9) · ⏱ 3.3s · 🐙 GitHub Actions · ☑️ Check
    💬 Spawning bazel test...
  • 🔄 test (test-root-bazel-9) · ⏱ 3.6s · 🐙 GitHub Actions · ☑️ Check
    💬 Spawning bazel test...

❌ 1 failed task

  • ❌ test (test-e2e-bazel-8) · ⏱ 1m 29s · 🐙 GitHub Actions · ☑️ Check
    💬 failed in test · Bazel test failed

✅ 4 successful tasks

  • ✅ buildifier · ⏱ 21.7s · 🐙 GitHub Actions · ☑️ Check
    💬 Format complete (clean)
  • ✅ gazelle · ⏱ 25.7s · 🐙 GitHub Actions · ☑️ Check
    💬 Gazelle complete (clean)
  • ✅ test (test-examples-uv_pip_compile-bazel-8) · ⏱ 27.2s · 🐙 GitHub Actions · ☑️ Check
    💬 Bazel test complete (1/1 passed · 1 cached)
  • ✅ test (test-root-bazel-8) · ⏱ 2m 55s · 🐙 GitHub Actions · ☑️ Check
    💬 Bazel test complete (184/184 passed · 120 cached)

🔁 Reproduce

❌ test (test-e2e-bazel-8)

aspect test -- \
  @@aspect_rules_py++uv+sdist_build__uv_pyproject_cases__pyahocorasick__2_2_0//:whl \
  //cases/uv-pyproject-cases/pyahocorasick:test
# without Aspect CLI
bazel test -- \
  @@aspect_rules_py++uv+sdist_build__uv_pyproject_cases__pyahocorasick__2_2_0//:whl \
  //cases/uv-pyproject-cases/pyahocorasick:test

Install aspect: docs.aspect.build/cli/install


⏱ Last updated Fri May 29 21:56:39 UTC 2026 · 📊 GitHub API quota 263/15,000 (2% used, resets in 31m)
🚀 Powered by Aspect CLI (v2026.22.23)  |  Aspect Build · X · LinkedIn · YouTube

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 28, 2026

py_binary startup benchmark

Version Mean (ms) Median (ms) ± stddev vs BCR vs main Build (s)
BCR 1.11.5 (baseline) 330.136 328.383 ±6.299 45.80
HEAD main 135.411 134.753 ±2.685 -59.0% 15.22
This PR 61.200 59.951 ±5.682 -81.5% -54.8% 12.66

Measured with hyperfine --warmup 5 --runs 50 on Linux
Gate: PR vs HEAD main (threshold: 10%). BCR is shown only as a historical baseline.
Build time: cold bazel build //:bench with isolated output base, no disk cache.

sys.path quality

Version sys.path entries distinct site-packages roots duplicate realpaths
BCR 1.11.5 (baseline) 6 1 0
HEAD main 7 2 0
This PR 7 2 0

sys.path quality measured by bench_syspath inside the assembled venv. Duplicate realpaths indicate symlink redundancy; many distinct site-packages roots suggest an inefficient venv layout.

…uncher native stub

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants