Skip to content

Clean up Python pool-related codes and remove emscriptenSetup from Pyodide bundle - #8360

Merged
ryanking13 merged 1 commit into
mainfrom
gyeongjae/pyodide-bundle-glue-only
Nov 13, 2026
Merged

ryanking13 merged 1 commit into
mainfrom
gyeongjae/pyodide-bundle-glue-only

Conversation

@ryanking13

@ryanking13 ryanking13 commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

On top of #8229.

This PR removes Python pool related codes /internal/pool, which we didn't implement in the end. This gives us a following improvement:

Previously, emscriptenSetup.js was bundled into the Pyodide bundle, and any changes there required Pyodide bundle update. Now they are linked statically into the workerd binary, so we don't need to update the bundle except for when we (1) update Pyodide version, or (2) when we add a new asm.js patch.

  • update Pyodide bundle

@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.

Superseded by the review of 4390d924.

This review, of e2bfdea1

💬 Approved with comments — The refactor is clean. One WARNING about unrelated lockfile changes that downgrade hermetic_launcher; no blocking issues.

Findings: 1 warning (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.

🔧 Fix with your agent

Paste the following into your coding agent to investigate and fix these issues.

Fix the following code review issues found in pull request #8360.

Before making changes, review each issue and present a brief summary table:
- For each finding, state whether you agree, disagree, or need clarification
- If you disagree (e.g., the fix would require disproportionate changes
  for minimal ROI, or the finding is factually incorrect), explain why
- If you need to clarify something before deciding, ask those questions
- Then share your plan for which issues to tackle and in what order

## WARNING (1)

### [Code Quality] Unrelated MODULE.bazel.lock changes downgrade hermetic_launcher (0.0.17 to 0.0.16) and bump aspect_tools_telemetry, with no MODULE.bazel change behind them.
- **File:** MODULE.bazel.lock:145

📋 Code Quality: ⚠️ 1 warning

The refactor is coherent; the lockfile carries unrelated dependency changes, including a downgrade.

Recommendation: 📝 Minor Comments

  • [WARNING] Unrelated MODULE.bazel.lock changes downgrade hermetic_launcher (0.0.17 to 0.0.16) and bump aspect_tools_telemetry, with no MODULE.bazel change behind them. (MODULE.bazel.lock:145)
View full review
  • MODULE.bazel.lock: the lock replaces hermetic_launcher 0.0.17 with 0.0.16 and aspect_tools_telemetry 0.5.1 with 0.5.2. This pull request changes no MODULE.bazel or dependency declarations, so these entries look like drift from regenerating the lock locally. Revert the file or regenerate it against the target branch.
  • src/pyodide/internal/util.ts:9-20 and src/pyodide/internal/python.ts:52: the comments and TODOs that explain the setInternalErrorReporter indirection still refer to pool bundling, which no longer exists. Consider removing the indirection, or at least updating the comments.

✅ All other checks passed

🔒 Security: ✅ LGTM

No security issues found.


📖 AGENTS.md: ✅ LGTM

No issues found.


⚡ Performance: ✅ LGTM

No performance issues found.


📝 Documentation: ✅ LGTM

The src/pyodide/AGENTS.md updates match the new layout.


Reviewed commit: e2bfdea1

Comment thread MODULE.bazel.lock Resolved
Comment thread src/pyodide/bundle/esbuild.config.mjs Resolved
Base automatically changed from gyeongjae/pyodide-bundle-dir to main November 13, 2026 05:14
@ryanking13
ryanking13 force-pushed the gyeongjae/pyodide-bundle-glue-only branch from e2bfdea to 4390d92 Compare November 13, 2026 05:37

@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.

Superseded by the review of f29fff92.

This review, of 4390d924

✅ Approved — This is a clean refactor that removes the unused pool code and moves emscriptenSetup into the binary. The earlier lockfile warning is resolved, and there are no new findings.

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


✅ All checks passed

🔒 Security: ✅ LGTM

No security issues found.


📖 AGENTS.md: ✅ LGTM

No issues found.


📋 Code Quality: ✅ LGTM

The MODULE.bazel.lock drift from the last review is no longer in the diff. The relocated modules are picked up by the pyodide_static globs. pyodide-internal:* is external in the new pyodide.asm.js esbuild rule. The stack-trace file-name check matches the new bundle output name. The comments about pool bundling in util.ts/python.ts are still stale; the review body covers them.


⚡ Performance: ✅ LGTM

This is a build and module-path refactor with no runtime hot-path changes.


📝 Documentation: ✅ LGTM

The src/pyodide/AGENTS.md updates match the new layout.


Reviewed commit: 4390d924

@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.

Superseded by the review of cdc54495.

This review, of f29fff92

✅ Approved — This is a clean refactor, and the bundle metadata update since the last review is consistent with the dependency file. There are no new findings.

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


✅ All checks passed

🔒 Security: ✅ LGTM

checkCallee still trusts only frames from the bundle's pyodide.asm module. Because pyodide-internal:* is external in the bundle build, the internal:unsafe-eval import stays in the binary. Bundle integrity is still pinned with SHA-256 hashes.


📖 AGENTS.md: ✅ LGTM

No issues found.


📋 Code Quality: ✅ LGTM

In build/python_metadata.bzl, the backport numbers and integrity hashes match the bundle file names in build/deps/pyodide.MODULE.bazel. No other leftover references to pool/ or the old generated/pyodide.asm paths remain under src/pyodide.


⚡ Performance: ✅ LGTM

This is a build and module-path refactor with no runtime hot-path changes.


📝 Documentation: ✅ LGTM

The src/pyodide/AGENTS.md updates match the new layout.


Reviewed commit: f29fff92

@ryanking13
ryanking13 force-pushed the gyeongjae/pyodide-bundle-glue-only branch from f29fff9 to cdc5449 Compare November 13, 2026 05:51

@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.

Superseded by the review of 45f1885b.

This review, of cdc54495

💬 Approved with comments — This is a clean refactor, and the regenerated lock file matches the pinned Pyodide bundles. The only note is an INFO: the lock file also changes dependencies that have nothing to do with Pyodide.

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

The refactor is consistent. The regenerated lock file also changes dependencies that have nothing to do with Pyodide.

Recommendation: 💬 Optional Nits

  • [INFO] MODULE.bazel.lock downgrades hermetic_launcher (0.0.17 → 0.0.16) and adds aspect_tools_telemetry 0.5.2, neither related to this change. (MODULE.bazel.lock:145)
View full review

The pyodide_*.capnp.bin names and integrity hashes in MODULE.bazel.lock match build/deps/pyodide.MODULE.bazel and build/python_metadata.bzl. The import paths, the bundle target outputs and the checkCallee module name all line up across the changed files.

Besides the Pyodide entries, the lock file also changes three other dependencies:

  • It bumps capnproto to 734d00f, which brings the lock in line with build/deps/gen/deps.MODULE.bazel.
  • It adds aspect_tools_telemetry 0.5.2.
  • It downgrades hermetic_launcher from 0.0.17 to 0.0.16.

Nothing in this repository pins those last two modules, so their changes probably come from regenerating the lock on an older base. Regenerating it on current main would keep this pull request to the Pyodide entries.

Thanks to @​hoodmane for the comment wording suggestion on src/pyodide/bundle/esbuild.config.mjs:6.


✅ All other checks passed

🔒 Security: ✅ LGTM

The bundle integrity hashes are still pinned, and checkCallee still trusts only the bundle's pyodide.asm module.


📖 AGENTS.md: ✅ LGTM

The src/pyodide/AGENTS.md updates match the new layout.


⚡ Performance: ✅ LGTM

This changes only the build and module paths; no hot-path code changes at runtime.


📝 Documentation: ✅ LGTM

No issues found.


Reviewed commit: cdc54495

Comment thread MODULE.bazel.lock Resolved
@ryanking13
ryanking13 force-pushed the gyeongjae/pyodide-bundle-glue-only branch from cdc5449 to 45f1885 Compare November 13, 2026 06:03

@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 — This is a clean refactor, and the pinned Pyodide bundle hashes are consistent across the build files. The only note is an INFO: the lock file also changes dependencies unrelated to Pyodide.

Findings: 1 info

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


📋 Code Quality: 💬 1 info

The refactor is consistent across the build rules and import paths. One INFO note remains: lock-file changes unrelated to Pyodide.

Recommendation: 💬 Optional Nits

  • [INFO] MODULE.bazel.lock downgrades hermetic_launcher (0.0.17 → 0.0.16) and adds aspect_tools_telemetry 0.5.2, neither related to this change. (MODULE.bazel.lock:145)
View full review
  • Lock file (MODULE.bazel.lock:145): besides the Pyodide entries and the capnproto bump, the lock also downgrades hermetic_launcher (0.0.17 → 0.0.16) and adds aspect_tools_telemetry 0.5.2. Nothing in this change needs either one. They most likely come from regenerating the lock on an older base.
  • checkCallee and prepareStackTrace both use pyodideRuntime-internal:pyodide.asm, which matches the bundle's module name in python_bundles.bzl and pyodide.asm.d.ts.
  • patch_pyodide_asm.ts imports pyodide-internal:builtin_wrappers. That module is marked external in the bundle config, so it is resolved at runtime.
  • Nothing outside the changed files still references the removed internal/pool paths.

✅ All other checks passed

🔒 Security: ✅ LGTM

The bundle integrity hashes are still pinned and agree across the build files. checkCallee trusts only the pyodideRuntime-internal:pyodide.asm glue module.


📖 AGENTS.md: ✅ LGTM

The src/pyodide/AGENTS.md updates match the new layout.


⚡ Performance: ✅ LGTM

Only the build and module-resolution paths change; no runtime hot path is affected.


📝 Documentation: ✅ LGTM

No issues found.


Reviewed commit: 45f1885b

@ryanking13
ryanking13 enabled stacked auto-merge November 13, 2026 08:22
@ryanking13
ryanking13 disabled stacked auto-merge November 13, 2026 08:32
@ryanking13
ryanking13 merged commit b3843e6 into main Nov 13, 2026
36 of 37 checks passed
@ryanking13
ryanking13 deleted the gyeongjae/pyodide-bundle-glue-only branch November 13, 2026 08:32
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