-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Environment variable to identify the library name #11966
Comments
Could you expand on your use case for a |
For my specific use case, I am using See here |
So more specifically, you are needing a way for a test target to find the lib target's file name? How would FYI Integration tests have access to |
Yes, that would be correct.
|
My calling out of |
Oh, got it. |
Problem
Cargo allows for building libraries having different name than the crate name (
name
field on[package]
) via thename
field on[lib]
, such as given the following manifest, crate name will begoodname
but built library will be namedlibothername.so
or so.For binaries, we have
CARGO_BIN_NAME
being populated with similar target name for binary on tests etc, but we do not have the equivalent of it for libraries, thus my request is to haveCARGO_LIB_NAME
, or any suitable variable name that will be populated with the target library name, having same behavior asCARGO_BIN_NAME
.Proposed Solution
Add an env var
CARGO_LIB_NAME
to be populated with the value set onname
field on[lib]
, if set or default to package name.Notes
Ref:
[lib]
and[package]
when publishing #6827 Cargo allows you to have a different name in [lib] and [package] when publishingThe text was updated successfully, but these errors were encountered: