Repository navigation
duplicate lang item `panic_impl' #1175
Copy link
Copy link
Closed
Labels
lifecycle/needs-reviewThe issue has not yet been reviewed.The issue has not yet been reviewed.
Description
What happened?
Compiling a simple guest example fails with:
error[E0152]: found duplicate lang item `panic_impl`
--> /home/sarocu/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/hyperlight-guest-bin-0.12.0/src/lib.rs:139:1
|
139 | / fn panic(info: &core::panic::PanicInfo) -> ! {
140 | | _panic_handler(info)
141 | | }
| |_^
|
= note: the lang item is first defined in crate `std` (which `tracing` depends on)
= note: first definition in `std` loaded from /home/sarocu/.rustup/toolchains/1.89-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-099ea48a26be4ce8.rlib
= note: second definition in the local crate (`hyperlight_guest_bin`)
Dependencies:
[dependencies]
hyperlight-common = "0.12.0"
hyperlight-guest = "0.12.0"
hyperlight-guest-bin = "0.12.0"
hyperlight-guest-tracing = "0.12.0"
Rust:
cargo --version
cargo 1.89.0 (c24e10642 2025-06-23)
What did you expect to happen?
Successful build
Steps to reproduce the behavior
- Install the shared dependencies in a new project
- Copy the example snippet for a guest hyperlight binary in the README
cargo build
Hyperlight Version
0.12.0
OS version
/////////////
///////////////////// -------------
///////*767//////////////// OS: Pop!_OS 24.04 LTS x86_64
//////7676767676*////////////// Kernel: 6.17.9-76061709-generic
/////76767//7676767////////////// Uptime: 3 hours, 32 mins
/////767676///*76767/////////////// Packages: 2082 (dpkg), 13 (flatpak)
///////767676///76767.///7676*/////// Shell: bash 5.2.21
/////////767676//76767///767676//////// Resolution: 3440x1440
//////////76767676767////76767///////// DE: COSMIC
///////////76767676//////7676////////// Theme: adw-gtk3 [GTK3]
////////////,7676,///////767/////////// Icons: Cosmic [GTK3]
/////////////*7676///////76//////////// Terminal: cosmic-term
///////////////7676//////////////////// CPU: AMD Ryzen 7 3700X (16) @ 3.800GHz
///////////////7676///767//////////// GPU: NVIDIA 09:00.0 NVIDIA Corporation Device 2d04
//////////////////////'//////////// Memory: 8201MiB / 31999MiB
//////.7676767676767676767,//////
/////767676767676767676767/////
///////////////////////////
/////////////////////
/////////////
Additional Information
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
lifecycle/needs-reviewThe issue has not yet been reviewed.The issue has not yet been reviewed.
Activity
ludfjig commentedon Jan 17, 2026
Hello and thanks for the report! Would you mind speciying exactly how you compiled the guest? We mostly use
cargo-hyperlightto build guests which automatically sets up certain things. Have you triedcargo hyperlight buildinstead, which I also think is what our README uses?jsturtevant commentedon Jan 17, 2026
What does your guest look like? you will need to have: (see https://github.com/hyperlight-dev/hyperlight?tab=readme-ov-file#guest)
There are some additional settings required to build and link everything properly. The easiest way to get it built is:
if your still having trouble, if you could provider a minimal example and the command you ran that would help
sarocu commentedon Jan 20, 2026
@jsturtevant I attempted to build with that exact file. I am using the published crates in a fresh project rather than cloning the repo so maybe I am just misunderstanding something with the architecture.
Seems to be a dependency issue; @ludfjig when I use that build command I see a lot of errors that are related to building deps:
ludfjig commentedon Jan 20, 2026
Are you able to build the guest checked into this repo with the command using command
just guestsin root folder? The issue could also potentially be because one ofpulls in std. Can you try adding
default-features = falseon these (at least hyperlight-common).sarocu commentedon Jan 21, 2026
@ludfjig building inside of this repo works with the
just guestscommandAdded
default-features = falseand tried the 0.11.0 release as well and still see errorsludfjig commentedon Jan 22, 2026
Thanks for checking. I tried it myself and managed to make the following work. It's harder than I thought, and the error messages were pretty cryptic. In addition I needed to do a full
cargo cleanto get it to work.main.rs:
Cargo.toml
Please let me know if the above works for you! We have been thinking about making some tool to scaffold a new guest, and I think that definitely would be useful and potentially avoid problems like these
sarocu commentedon Jan 22, 2026
That works!
Some sort of tool would be great, maybe a quick edit on the README. Appreciate the assist!