-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Allow configuring name of generated shared library artifact #1970
Copy link
Copy link
Open
Labels
A-build-scriptsArea: build.rs scriptsArea: build.rs scriptsA-cargo-targetsArea: selection and definition of targets (lib, bins, examples, tests, benches)Area: selection and definition of targets (lib, bins, examples, tests, benches)A-manifestArea: Cargo.toml issuesArea: Cargo.toml issuesC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.
Metadata
Metadata
Assignees
Labels
A-build-scriptsArea: build.rs scriptsArea: build.rs scriptsA-cargo-targetsArea: selection and definition of targets (lib, bins, examples, tests, benches)Area: selection and definition of targets (lib, bins, examples, tests, benches)A-manifestArea: Cargo.toml issuesArea: Cargo.toml issuesC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Currently a library named
foowill generate an artifactlibfoo.dylibon OSX. That's probably the right default, but it's doubly problematic when building CPython libraries (native modules):importstatement will lookup the shared library's name exactly (ignoring extension) requiring animport libfoo. Thelibprefix is very rarely used in Python (the lib suffix somewhat more so,libfoomight also be the postfix to a Python binding tolibfooe.g.python-libfoo). This is compounded by "accelerator" native modules (as replacements or improvements of pure-python ones) normally being prefixed by_: Cargo would generatelib_foorather than the expecting_foo.dylibfiles, it apparently only looks for.sofiles, even in OSXBeing able to provide an exact name for generated library artifacts (maybe platform-wise?) would fix both issues.
I didn't find any way to achieve that via a build script, or the native parameters of
cargo build.