wasmbindgen requires a exact match between the cli version and the
library version, generally that isn't that bad as it should always
be safe to update to the latest patch version of a library (but ofc
when reproduciblity and outdated lock files are in the mix that
complicates stuff, which is why I assume multiple versions are kept)
It's a case of upgrading a patch version technically being breaking
change unless you also update the library versions alongside it.
They are not doing anything right now. This is in preparation for their
complete removal from the tree.
Note: several changes that affect the derivation inputs (e.g. removal of
references to stub paths in build instructions) were left out. They will
be cleaned up the next iteration and will require special care.
Note: this PR is a result of a mix of ugly regex (not AST) based
automation and some manual labor. For reference, the regex automation
part was hacked in: https://github.com/booxter/nix-clean-apple_sdk
Signed-off-by: Ihar Hrachyshka <ihar.hrachyshka@gmail.com>
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.