Skip to content
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

Build script overrides cannot use target.<cfg>.<links> form #11042

Open
glandium opened this issue Aug 31, 2022 · 1 comment
Open

Build script overrides cannot use target.<cfg>.<links> form #11042

glandium opened this issue Aug 31, 2022 · 1 comment
Labels
A-build-scripts Area: build.rs scripts A-configuration Area: cargo config files and env vars C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-needs-team-input Status: Needs input from team on whether/how to proceed.

Comments

@glandium
Copy link
Contributor

Problem

As of writing the only way to set build script overrides is to use target.<triple>.<links>. Unfortunately, when you want to set those overrides for all targets at once, or for some subsets, the only option right now is to set them for each and every triple. This doesn't really scale.

Cc: @thomcc

Proposed Solution

No response

Notes

No response

@glandium glandium added the C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` label Aug 31, 2022
@ehuss ehuss added A-configuration Area: cargo config files and env vars A-build-scripts Area: build.rs scripts labels Sep 1, 2022
@eerii
Copy link

eerii commented Sep 18, 2024

At gstreamer-rs, we are trying to support linking to a big static library with all dependencies inside, and we need to override the individual dependency library names. We use system-deps to link the libraries on the command line, which handles this automatically. However, in Windows, variables need to have dllimport applied to them as opposed to functions which export symbols with and without __imp_. The only way to do this right now seems to be using the #[link] attribute, but this forces us to set the name of the library there. It would be very useful to use the links overrides to rename this library from dependent crates, however, the current design is very limiting. Not only it needs to be repeated for all targets, but it also doesn't allow for configuration based on features or cfg flags. Commenting on this issue to show how it would be useful for our use case.

@weihanglo weihanglo added the S-needs-team-input Status: Needs input from team on whether/how to proceed. label Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-build-scripts Area: build.rs scripts A-configuration Area: cargo config files and env vars C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-needs-team-input Status: Needs input from team on whether/how to proceed.
Projects
None yet
Development

No branches or pull requests

4 participants