Ich versuche, Racer zu ändern, um eine gemeinsam genutzte Bibliothek anstelle einer rlib auszugeben.Auswählen einer freigegebenen oder statischen Bibliothek mit Cargo
Um dies zu tun, fügte ich crate-type = ["dylib"]
in die [lib]
Abschnitt des Cargo-Manifest, dann lief cargo build --lib
. Das funktionierte großartig, und libracer.so
wurde ausgegeben.
Leider konnte ich jetzt nicht die Racer-Binärdatei erstellen, die von einer statischen Version der Bibliothek abhängt. Laufen cargo build
klagt:
Compiling racer v1.0.0 (file:///home/georgev/dotfiles/vim/bundle/racer)
error: cannot satisfy dependencies so `std` only shows up once
help: having upstream crates all available in one format will likely make this go away
error: cannot satisfy dependencies so `core` only shows up once
help: having upstream crates all available in one format will likely make this go away
error: cannot satisfy dependencies so `collections` only shows up once
help: having upstream crates all available in one format will likely make this go away
error: cannot satisfy dependencies so `rustc_unicode` only shows up once
help: having upstream crates all available in one format will likely make this go away
error: cannot satisfy dependencies so `alloc` only shows up once
help: having upstream crates all available in one format will likely make this go away
error: cannot satisfy dependencies so `libc` only shows up once
help: having upstream crates all available in one format will likely make this go away
error: cannot satisfy dependencies so `rand` only shows up once
help: having upstream crates all available in one format will likely make this go away
error: aborting due to 7 previous errors
Could not compile `racer`.
ich die crate-type
-["dylib", "bin"]
geändert, was die Zusammenstellung erlaubt erfolgreich zu sein. cargo build --lib
wird jedoch keine gemeinsame Bibliothek mehr ausgeben (nur eine rlib).
Wie kann ich angeben, welche Art von Bibliothek ich erstellen möchte, während diese Bibliothek trotzdem statisch für die Einbindung in eine ausführbare Datei erstellt werden kann?