Skip to content

perf: migrate bash launcher to hermetic-build#1045

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

perf: migrate bash launcher to hermetic-build#1045
jbedard wants to merge 4 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?

Comment thread py/private/py_venv/types.bzl Outdated
PyExecutableInfo = provider(
doc = "Provider emitted by `py_venv_exec` carrying launcher-level metadata that downstream consumers can't infer from the binary itself.",
fields = {
"entrypoint_rlocation": "str — runfiles path of the `main` Python file the launcher exec's. Read by `py_pex_binary` to set the pex entrypoint without scraping the launcher.",
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.

should be a File instead of a str. downstream consumers can decide what they want to do with it.

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.

See fixup: b5ecd19

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.

2 participants