Build can embed the wrong runtime after switching Pulley feature
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 55/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- rust, wasm
- Ambito
- build-system
Direzione di ricerca
Inizia da hyperlight-wasm/build.rs e ispeziona il modo in cui l'output del runtime annidato e il wasm_runtime_resource.rs generato usano OUT_DIR e il percorso target condiviso. Riproduci le sequenze normali -\u003e pulley -\u003e normal e pulley -\u003e normal -\u003e pulley dei consumer, quindi prova build native e Pulley concorrenti. Il lavoro è completato quando ogni componente AOT viene caricato con il runtime incorporato corrispondente e le build concorrenti rimangono correttamente isolate.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
Switching between native and Pulley builds can embed the wrong hyperlight-wasm-runtime guest. A native host build can retain the Pulley runtime and reject a valid x86 AOT component:
GuestError(GuestError, "Module was compiled for architecture 'x86_64'")
Reproduction
Use a consumer feature that enables hyperlight-wasm/pulley.
- Build and run with an x86 AOT component.
- Build and run with the Pulley feature and a Pulley AOT component.
- Build and run with the x86 AOT component again.
The third run can reject the x86 component. This reproduces with hyperlight-wasm 0.15.0 and Wasmtime 36.0.14.
Root cause
hyperlight-wasm/build.rs builds the embedded runtime into a shared nested target directory:
<target>/hyperlight-wasm-runtime/x86_64-hyperlight-none/<profile>/hyperlight-wasm-runtime
Native and Pulley Cargo units have separate OUT_DIR directories. Both generated wasm_runtime_resource.rs files use include_bytes! with this shared mutable path.
The nested Pulley build overwrites the runtime binary. Cargo can rebuild the native hyperlight-wasm unit because the include_bytes! input changed while its build script remains cached. The native unit then embeds the Pulley binary.
The shared output also permits a race between concurrent normal and Pulley builds.
Suggested fix
Copy the completed nested runtime into the outer build script's OUT_DIR. Point include_bytes! at that private copy. This preserves the shared nested compilation cache.
Concurrent builds also need one of these protections:
- Hold a lock across the nested build and copy.
- Use a separate nested target directory for each runtime configuration.
The configuration key must cover pulley, gdb, trace_guest, wasmtime_latest, and the WIT environment values. The outer OUT_DIR provides complete isolation but duplicates compilation work.
Regression coverage
Build a consumer in both sequences. Verify that the final component loads:
normal -> pulley -> normal
pulley -> normal -> pulley
Concurrent native and Pulley builds should produce correctly matched embedded runtimes.
- Lingua principale
- Rust
- Stelle
- 728
- Fork
- 39
- Merge medio
- 2g 3h
- PR unite (30g)
- 25
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di hyperlight-dev/hyperlight-wasm
-
lifecycle/needs review
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
-
Can't update to wasmtime 48 Apertalifecycle/needs review
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
-
use the #[guest_func] macro on `init_wasm_runtime` instead of manually calling register_function? Apertalifecycle/needs review
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
hyperlight-dev/hyperlight-wasm#395 · 1 commento · 1 reazione ·
-
lifecycle/needs review
Difficoltà 2/5 1-3 ore Idoneità per principianti 48/100
-
Implementing multiple worlds Apertalifecycle/confirmed
Difficoltà 5/5 Più di una settimana Idoneità per principianti 30/100
hyperlight-dev/hyperlight-wasm#203 · 1 commento ·
Tutte le issue di hyperlight-dev/hyperlight-wasm
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
state:needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
zed-industries/zed#64680 · 2 commenti ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
RustPython/RustPython#8802 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
TheLarkInn/aipm#2390 ·