-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Open
Labels
A-build-scriptsArea: build.rs scriptsArea: build.rs scriptsA-crate-typesArea: crate-type declaration (lib, staticlib, dylib, cdylib, etc.)Area: crate-type declaration (lib, staticlib, dylib, cdylib, etc.)C-bugCategory: bugCategory: bugCommand-rustcS-triageStatus: This issue is waiting on initial triage.Status: This issue is waiting on initial triage.
Description
Problem
Consider this package.
Cargo.toml:
[package]
name = "foo"
version = "0.0.0"
edition = "2024"build.rs:
fn main() {
println!("cargo::rustc-link-arg-cdylib=-lhack");
}Cargo emits a warning for it.
warning: [email protected]: cargo::rustc-link-arg-cdylib was specified in the build script of foo v0.0.0, but that package does not contain a cdylib target
Allowing this was an unintended change in the 1.50 release, and may become an error in the future. For more information, see <https://github.com/rust-lang/cargo/issues/9562>.
This warning may seem reasonable; however, users may take advantage of it by using
cargo rustc --crate-type cdylibAnd it totally works. In this case, there should be no warning. The warning is configured only to inform the user not to rely on rustc-link-arg-cdylib being transitive through dependencies. Therefore, we should remove this warning, or at least stop telling the user that it will be rejected.
cc #9562
Steps
No response
Possible Solution(s)
No response
Notes
No response
Version
Metadata
Metadata
Assignees
Labels
A-build-scriptsArea: build.rs scriptsArea: build.rs scriptsA-crate-typesArea: crate-type declaration (lib, staticlib, dylib, cdylib, etc.)Area: crate-type declaration (lib, staticlib, dylib, cdylib, etc.)C-bugCategory: bugCategory: bugCommand-rustcS-triageStatus: This issue is waiting on initial triage.Status: This issue is waiting on initial triage.