alexcrichton / alexcrichton/link-config

Issue with libraries installed outside /usr

Aperta
#17 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Rust
Stelle
16
Fork
8
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

I'm not quite sure what's going on here, but, trying to build nanomsg.rs via Cargo
- fails if nanomsg is installed in /home/install/nanomsg
- works if nanomsg is installed in /usr/local
- but fails if installed in /usr/local and `nanomsg.rs/nanomsg-sys/src/lib.rs:11` is changed from `link_config!("libnanomsg", ["only_static"]);` to `link_config!("libnanomsg", ["only_static", "system_static"]);`

Error message on failure:

```
$ cargo build --verbose
Fresh link-config v0.1.1 (file:///home/dhardy/other/link-config)
Compiling nanomsg-sys v0.1.0 (file:///home/dhardy/other/nanomsg.rs)
Running `rustc /home/dhardy/other/nanomsg.rs/nanomsg-sys/src/lib.rs --crate-name nanomsg-sys --crate-type lib -g -C metadata=c6a64bd04f280bd4 -C extra-filename=-c6a64bd04f280bd4 --out-dir /home/dhardy/other/brindle/examples/stage1/feetmeters/target/deps --emit=dep-info,link -L dependency=/home/dhardy/other/brindle/examples/stage1/feetmeters/target/deps -L dependency=/home/dhardy/other/brindle/examples/stage1/feetmeters/target/deps --extern link-config=/home/dhardy/other/brindle/examples/stage1/feetmeters/target/deps/liblink-config-ad5ed414069a9a33.so`
error: could not find native static library `nanomsg`, perhaps an -L flag is missing?
```

I have installed nanomsg-0.5-beta to both locations (identical version). `/home/install/nanomsg` is actually a symlink, but that shouldn't make a difference.

`link-config/src/lib.rs:168` may have something to do with this ("static" and "/usr..."), but I don't really understand what's going on:

```
(allow_static_system || !base.as_vec().starts_with(b"/usr")) &&
```

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.