-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Allow configuring name of generated shared library artifact #1970
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
You would need a pair of new options to fix this cleanly, I think. The reason is that I can specify several types of libraries to build:
Cargo will build both a
This example would emit This would allow you to override specific parts of the name for some types of outputs, while leaving sensible and platform-independent defaults for everything else. Alternately, you could do both in one setting:
(And the |
The same on OSX, except the first one is called |
Would it be possible to just rename the artifact? Cargo's not necessarily striving to be the end-all-be-all of Rust build systems, and it's pretty likely you'll need scripting of some form layered on top of Cargo for integration into projects like this. Along those lines I'd expect a CPython library to run |
+1. Currently this requires using something like I second @thirtythreeforty suggestions for new options. |
This is a critical feature IMO. I’m trying to build an easy way to build native Rust extension is ruby and ruby wants .bundle as the dylib name on Mac. |
This feature would also be useful for writing Matlab extension, which end in something like |
Some other possible solution:
|
I am currently working on writing a pam module, and would like the library artifact to match the naming scheme of other pam modules using Obviously renaming is an option, but why is there an assumption in the first place that shared libraries must always have the |
Yes, I have a workspace with a library and an executible entry point that acts as a frontend for that library [workspace]
members = [
"foo",
"libfoo",
] Running It would be nice if Cargo could emit the file with the name exactly as described |
Currently a library named
foo
will generate an artifactlibfoo.dylib
on OSX. That's probably the right default, but it's doubly problematic when building CPython libraries (native modules):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
.dylib
files, it apparently only looks for.so
files, 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
.The text was updated successfully, but these errors were encountered: