{rust-bin,example}: remove WASI target workaround and fix example

The un-versioned `wasm32-wasi` target is removed in favor of
`wasm32-wasip?` since Rust 1.84. Examples are updated.

The nixpkgs patch for WASI target name remapping is merged in 24.11.
We can also safely remove the workaround.
This commit is contained in:
oxalica
2025-01-10 23:15:59 -05:00
committed by oxalica
parent 0c7c168592
commit 06871d5c5f
5 changed files with 17 additions and 16 deletions

View File

@@ -3,7 +3,6 @@
{
lib,
pkgs,
toRustTarget,
manifests,
nightly,
}:
@@ -23,21 +22,15 @@ let
(filter (name: set.${name} == null)
(attrNames set));
# FIXME: https://github.com/NixOS/nixpkgs/pull/146274
toRustTarget' = platform:
if platform.isWasi then
"${platform.parsed.cpu.name}-wasi"
else
platform.rust.rustcTarget or (toRustTarget platform);
toRustTarget = platform: platform.rust.rustcTarget;
# The platform where `rustc` is running.
rustHostPlatform = toRustTarget' stdenv.hostPlatform;
rustHostPlatform = toRustTarget stdenv.hostPlatform;
# The platform of binary which `rustc` produces.
rustTargetPlatform = toRustTarget' stdenv.targetPlatform;
rustTargetPlatform = toRustTarget stdenv.targetPlatform;
mkComponentSet = callPackage ./mk-component-set.nix {
inherit removeNulls;
toRustTarget = toRustTarget';
inherit removeNulls toRustTarget;
};
mkAggregated = callPackage ./mk-aggregated.nix {};