Skip to content

ci(pages): fix JupyterLite "No Kernel" — absolute argv[0] in xlean kernel.json#87

Merged
junjihashimoto merged 1 commit into
mainfrom
fix/jupyterlite-kernel-argv
Jul 2, 2026
Merged

ci(pages): fix JupyterLite "No Kernel" — absolute argv[0] in xlean kernel.json#87
junjihashimoto merged 1 commit into
mainfrom
fix/jupyterlite-kernel-argv

Conversation

@junjihashimoto

Copy link
Copy Markdown
Contributor

Problem

The hosted lab https://verilean.github.io/sparkle/lab/ shows "No Kernel" — no Lean 4 kernel is offered. The deployed xeus/kernels.json is [].

Closes #85.

Root cause

The WASM kernel rebuild step runs cmake --install into the staging prefix, which installs xeus-lean's source kernel.json. That template's argv is the bare relative string:

"argv": [ "xlean" ]

(The stock env kernel.json uses an absolute /opt/.../bin/xlean, but cmake --install clobbers it.)

jupyter lite buildjupyterlite_xeus.add_on.get_kernel_binaries reads argv[0] and checks argv[0] + ".js" / + ".wasm". With argv[0] == "xlean" those resolve relative to the build cwd (/work), where the binaries do not exist — the real ones are at $CAND/bin/xlean.{js,wasm}. So it warns "kernel binaries not found for xlean", drops the kernel, and kernels.json comes out [].

Fix

After cmake --install, rewrite the installed kernel.json's sole argv line from the relative "xlean" to the absolute $CAND/bin/xlean. Uses sed on the standalone argv line — the docs-builder image has no jq, and sed avoids the nested-heredoc quoting hazard inside the docker bash -c '…'.

Verification

Confirmed inside the docs-builder image that after the rewrite get_kernel_binaries resolves both xlean.js and xlean.wasm (FOUND, vs NOT FOUND before) — which is what populates xeus/kernels.json and lets the lab offer the Lean 4 kernel.

…rnel.json (#85)

The hosted lab (https://verilean.github.io/sparkle/lab/) showed
"No Kernel": the deployed `xeus/kernels.json` was `[]`, so no
Lean kernel was offered.

Root cause (traced through jupyterlite-xeus add_on.py):

The Sparkle WASM kernel rebuild step does
`cmake --install /work/.wasm-rebuild` into the staging prefix.
That installs xeus-lean's **source** `kernel.json`, whose argv
is the bare relative string:

    "argv": [ "xlean" ]

(The image's stock env kernel.json uses an *absolute*
`/opt/.../bin/xlean`, but `cmake --install` clobbers it with the
relative source template.)

`jupyter lite build` → `jupyterlite_xeus.add_on.get_kernel_binaries`
reads `argv[0]` and checks `argv[0] + ".js"` / `+ ".wasm"`. With
`argv[0] == "xlean"` those resolve relative to the build cwd
(`/work`), where `xlean.js` / `xlean.wasm` do NOT exist — the
real binaries are at `$CAND/bin/xlean.{js,wasm}`. So it warns
"kernel binaries not found for xlean", drops xlean from the
manifest, and the deployed `kernels.json` comes out `[]`.

Fix: after `cmake --install`, rewrite the installed kernel.json's
sole argv line from the relative `"xlean"` to the absolute
`$CAND/bin/xlean` (sed on the standalone argv line — the image
has no jq, and sed avoids the nested-heredoc quoting hazard
inside the docker `bash -c '…'`).

Verified inside the docs-builder image that
`get_kernel_binaries` then resolves both xlean.js and xlean.wasm
(FOUND, vs NOT FOUND before), which is what populates
`xeus/kernels.json` and lets the lab offer the Lean 4 kernel.
@junjihashimoto junjihashimoto merged commit 7ec5f13 into main Jul 2, 2026
6 checks passed
@junjihashimoto junjihashimoto deleted the fix/jupyterlite-kernel-argv branch July 2, 2026 01:52
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.

JupyterLite: xeus-lean kernel fails to start ("No Kernel") on the hosted /lab/ site

1 participant