Skip to content

Commit

Permalink
Auto merge of #120232 - c272:json-buildstd, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
Add support for custom JSON targets when using build-std.

Currently, when building with `build-std`, some library build scripts check properties of the target by inspecting the target triple at `env::TARGET`, which is simply set to the filename of the JSON file when using JSON target files.

This patch alters these build scripts to use `env::CARGO_CFG_*` to fetch target information instead, allowing JSON target files describing platforms without `restricted_std` to build correctly when using `-Z build-std`. There are some weak assertions here (for example, `nintendo && newlib`), however this seems at least a marginal improvement on the existing solution.

Fixes rust-lang/wg-cargo-std-aware#60.
  • Loading branch information
bors committed Feb 11, 2024
2 parents 5275802 + 66be6c7 commit 97741eb
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit 97741eb

Please sign in to comment.