Alyssa Ross bca1dde2b4 buildWasmBindgenCli,wasm-bindgen-cli-*: init
Exposing an overridable cargoHash parameter is problematic because it
will produce silently broken FODs if we change the hashing scheme,
which we are currently doing across the tree because Cargo 1.84.0 has
changed the output of fetchCargoTarball, meaning all hashes have been
invalidated.  To avoid this happening in future, we are changing to
the fetchCargoVendor mechanism, which does not depend on
implementation details of Cargo.

The future-proof way to override a package with Cargo dependencies is
to pass a cargoDeps object.  This is more verbose, and requires the
caller to have access to the src object for the package.  To
compensate for this, I've introduced a buildWasmBindgenCli function
that is nicer to use than wasm-bindgen-cli.overrideAttrs, and I've
also introduced versioned attributes for wasm-bindgen-cli versions
currently in use in Nixpkgs, so that each package that wants to use a
particular version doesn't have to duplicate the src and cargoDeps
definitions for that version.

The unversioned "wasm-bindgen-cli" attribute is demoted to an alias,
with a view to its eventual removal.
2025-01-30 10:26:44 +01:00

35 lines
773 B
Nix

{
callPackages,
lib,
wasm-bindgen-cli_0_2_92,
wasm-bindgen-cli_0_2_93,
...
}@args:
let
f = args: rec {
# wasm-bindgen-cli version must match the version of wasm-bindgen in Cargo.lock
teleport_15 = import ./15 (
args
// {
wasm-bindgen-cli = wasm-bindgen-cli_0_2_92;
}
);
teleport_16 = import ./16 (
args
// {
wasm-bindgen-cli = wasm-bindgen-cli_0_2_93;
}
);
teleport = teleport_16;
};
# Ensure the following callPackages invocation includes everything 'generic' needs.
f' = lib.setFunctionArgs f (builtins.functionArgs (import ./generic.nix));
in
callPackages f' (
builtins.removeAttrs args [
"callPackages"
"wasm-bindgen-cli_0_2_92"
"wasm-bindgen-cli_0_2_93"
]
)