Skip to content

fix: Add -Zjson-target-spec on Cargo calls where needed#21846

Draft
ChayimFriedman2 wants to merge 1 commit intorust-lang:masterfrom
ChayimFriedman2:json-target-spec
Draft

fix: Add -Zjson-target-spec on Cargo calls where needed#21846
ChayimFriedman2 wants to merge 1 commit intorust-lang:masterfrom
ChayimFriedman2:json-target-spec

Conversation

@ChayimFriedman2
Copy link
Contributor

@ChayimFriedman2 ChayimFriedman2 commented Mar 19, 2026

Fixes #21821.

CC @ShoyuVanilla assuming you know - do we need to gate this only for affected Cargo versions? If so, how?

@ShoyuVanilla
Copy link
Member

Yeah, the older versions without that flag will error with it. For the later, I guess we could just do it based on the toolchain version. Would that be hard because of some quirks in our codebase? (I can't check whether it's hard or not since I'm outside rn. Sry 😅 )

@Veykril
Copy link
Member

Veykril commented Mar 20, 2026

We already have the sysroot here so we should have the toolchain version queried already somewhere

@ShoyuVanilla
Copy link
Member

As Lukas said we should the toolchain version available there, I guess you could compare the toolchain version like the following lines:

let usage = if *toolchain_version >= MINIMUM_TOOLCHAIN_VERSION_SUPPORTING_LOCKFILE_PATH_ENV {
LockfileUsage::WithEnvVar
} else if *toolchain_version >= MINIMUM_TOOLCHAIN_VERSION_SUPPORTING_LOCKFILE_PATH_FLAG {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Custom targets triplets loaded from json now require "-Z json-target-spec"

3 participants