Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Quickstart can't build hello world: librustc_codegen_gcc.so not found

Aperta
#930 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
64/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
rust

Direzione di ricerca

Inizia dalle istruzioni di Quickstart, da config.example.toml e dagli entry point ./y.sh prepare/build/cargo; riproduci i comandi release e non-release rispetto a tests/hello-world/Cargo.toml. Traccia il motivo per cui la release build cerca in target/debug e per cui la non-release build non riesce a trovare mylib. Il lavoro è completato quando i comandi Quickstart documentati eseguono correttamente la build di hello-world.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

documentation

I'm trying to build librustc_codegen_gcc.so from this repo (rather than from Rust) to make it easier to upstream patches. However, the Quickstart instructions do not appear to work.

Following the instructions, I've:

  1. Copied config.example.toml to config.toml
  2. Ran ./y.sh prepare
  3. Ran ./y.sh build --sysroot --release

Now I'm trying to run the fourth step:

$ ./y.sh cargo build --manifest-path tests/hello-world/Cargo.toml
[BUILD] build system
    Finished [`release` profile [optimized]](https://doc.rust-lang.org/cargo/reference/profiles.html#default-profiles) target(s) in 0.01s
Using `/home/seancross/Code/rustc_codegen_gcc/build/libgccjit/b794cb99508e7eccd40fa42bb310d5781e09899b` as path for libgccjit
   Compiling hello_world v0.0.0 (/home/seancross/Code/rustc_codegen_gcc/tests/hello-world)
error: couldn't load codegen backend /home/seancross/Code/rustc_codegen_gcc/target/debug/librustc_codegen_gcc.so: cannot open shared object file: No such file or directory

error: could not compile `hello_world` (bin "hello_world") due to 1 previous error
$

It appears to be looking for something under target/debug even though the instructions say to run ./y.sh build --sysroot --release. If I re-run step 3 with ./y.sh build --sysroot without --release, then attempting to build hello-world gives a different error:

$ ./y.sh cargo build --manifest-path tests/hello-world/Cargo.toml
[BUILD] build system
    Finished [`release` profile [optimized]](https://doc.rust-lang.org/cargo/reference/profiles.html#default-profiles) target(s) in 0.00s
Using `/home/seancross/Code/rustc_codegen_gcc/build/libgccjit/b794cb99508e7eccd40fa42bb310d5781e09899b` as path for libgccjit
   Compiling hello_world v0.0.0 (/home/seancross/Code/rustc_codegen_gcc/tests/hello-world)
error[E0463]: can't find crate for `mylib`
 --> src/main.rs:1:5
  |
1 | use mylib::my_func;
  |     ^^^^^ can't find crate

For more information about this error, try `rustc --explain E0463`.
error: could not compile `hello_world` (bin "hello_world") due to 1 previous error
$
Lingua principale
Rust
Stelle
1.2k
Fork
105
Merge medio
6h 28m
PR unite (30g)
14

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di rust-lang/rustc_codegen_gcc

Tutte le issue di rust-lang/rustc_codegen_gcc

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.