-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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.
Description
Currently a library named foo
will generate an artifact libfoo.dylib
on OSX. That's probably the right default, but it's doubly problematic when building CPython libraries (native modules):
- CPython's
import
statement will lookup the shared library's name exactly (ignoring extension) requiring animport libfoo
. Thelib
prefix is very rarely used in Python (the lib suffix somewhat more so,libfoo
might also be the postfix to a Python binding tolibfoo
e.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_foo
rather than the expecting_foo
- CPython doesn't look for
.dylib
files, it apparently only looks for.so
files, even in OSX
Being 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
.
Gamadril, konstin, ssokolow, jperelli, ruuda and 11 more
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.