Open jameshilliard opened 4 months ago
The linked PR doesn't provide much details on the proposed solution besides a code dump. Could you provide more details on the problem, what the user-facing solution would be, and how that helps?
Could you provide more details on the problem, what the user-facing solution would be, and how that helps?
Currently to say set a target linker we have to generate an env variable like CARGO_TARGET_$(call UPPERCASE,$(RUSTC_TARGET_NAME))_LINKER
, it would be nice to be able to set the target linker for all target artifact builds using a non-target-triple specific variable like CARGO_TARGET_LINKER
.
In TOML terms,
[target]
linker = ...
[target.<triple>]
linker = ...
translates to
{
"target": {
"linker": "...",
"<triple>": {
"linker": "...",
}
}
}
Personally, I would worry about putting target-config fields at the same level as <triple>
/ <cfg>
Some options
<cfg>
(I'm assuming there are technical limitations for this)Huh, we don't specify what happens if multiple target
s apply. In moving this forward, we should probably verify what is done in that case and be able to talk whether a design for solving this problem works with that solution or not.
Huh, we don't specify what happens if multiple
target
s apply. In moving this forward, we should probably verify what is done in that case and be able to talk whether a design for solving this problem works with that solution or not.
So in my pull request I actually wrote a test to cover this specific scenario. The way I implemented the logic was to have any target triple specific configs take precedence over generic target configs if they exist.
Problem
When building for targets from a meta build system like buildroot it is preferable to be able to unconditionally set target config/env variables without having to care about the target triple as we use target specific toolchains that will only support a single target architecture typically.
Proposed Solution
https://github.com/rust-lang/cargo/pull/9603