镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Add Pyodide patch to remove redundant Python calls during the bootstrap - #8386

Open
ryanking13 wants to merge 1 commit into
mainfrom
gyeongjae/finalize-bootstrap-skip-run-python
Open

ryanking13 wants to merge 1 commit into
mainfrom
gyeongjae/finalize-bootstrap-skip-run-python

Conversation

@ryanking13

Copy link
Copy Markdown
Contributor

Adds a patch to apply upstream Pyodide PR to workerd (pyodide/pyodide#6534).

This removes expensive Python AST parse / Python function calls during the bootstrap to improve the cold start.

@ryanking13
ryanking13 requested review from a team as code owners November 12, 2026 07:24

@clanky-the-clanker clanky-the-clanker Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💬 Approved with comments — The patch logic is well guarded and matches the upstream change. The only note is an informational one about unrelated churn in MODULE.bazel.lock, including a transitive downgrade of hermetic_launcher.

Findings: 1 info (1 is an inline comment on the diff)

The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.


📋 Code Quality: 💬 1 info

Patch logic is sound; the lockfile has unrelated transitive dependency churn.

Recommendation: 💬 Optional Nits

  • [INFO] MODULE.bazel.lock downgrades hermetic_launcher from 0.0.17 to 0.0.16 and adds other entries unrelated to the Pyodide bump. (MODULE.bazel.lock:145)
View full review
  • The finalizeBootstrap patches are strict: each one has expected: 1, matches an exact literal or shape, and throws when the structure doesn't match.
  • MODULE.bazel.lock also changes things the Pyodide bump doesn't explain: hermetic_launcher goes from 0.0.17 to 0.0.16, aspect_tools_telemetry gains 0.5.2 entries, and new extension entries appear for protobuf, rules_android and rules_rust. This usually means the lock was regenerated against an older main or with a different Bazel or registry state.

✅ All other checks passed

🚀 Release: ✅ LGTM

Low risk: the dependency bundle bump has updated integrity hashes.


🔒 Security: ✅ LGTM

The bundle URL host is unchanged, and the new sha256 integrity hashes are pinned. The AST rewrite runs at build time on fixed matches and takes no untrusted input.


📖 AGENTS.md: ✅ LGTM

No AGENTS.md concerns.


⚡ Performance: ✅ LGTM

Removing the Python source compilation and execution from finalizeBootstrap should reduce cold-start cost.


📝 Documentation: ✅ LGTM

No documentation concerns.


Reviewed commit: feb3cdca

Comment thread MODULE.bazel.lock Resolved

@hoodmane hoodmane left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's try to make the finalizeBootstrap: import _pyodide_core only when not restoring a snapshot patch shorter, it's a bit confusing this way.

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