diff --git a/doc/release-notes/rl-2505.section.md b/doc/release-notes/rl-2505.section.md index 0e021924848b..20937069624f 100644 --- a/doc/release-notes/rl-2505.section.md +++ b/doc/release-notes/rl-2505.section.md @@ -59,3 +59,5 @@ - `lib.types.listOf` - Plasma 5 and Qt 5 based versions of associated software are deprecated in NixOS 25.05, and will be removed in NixOS 25.11. Users are encouraged to upgrade to Plasma 6. + +- `rustPlatform.buildRustPackage` stops handling the deprecated argument `cargoSha256`. Out-of-tree packages that haven't migrated from `cargoSha256` to `cargoHash` now receive errors. diff --git a/pkgs/build-support/rust/build-rust-package/default.nix b/pkgs/build-support/rust/build-rust-package/default.nix index b98fb69b40d9..2f67df349e1d 100644 --- a/pkgs/build-support/rust/build-rust-package/default.nix +++ b/pkgs/build-support/rust/build-rust-package/default.nix @@ -83,7 +83,7 @@ lib.extendMkDerivation { cargoDeps else if cargoLock != null then importCargoLock cargoLock - else if (args.cargoHash or null == null) && (args.cargoSha256 or null == null) then + else if args.cargoHash or null == null then throw "cargoHash, cargoVendorDir, cargoDeps, or cargoLock must be set" else if useFetchCargoVendor then fetchCargoVendor ( @@ -116,15 +116,10 @@ lib.extendMkDerivation { postUnpack cargoUpdateHook ; + hash = args.cargoHash; name = cargoDepsName; patches = cargoPatches; } - // lib.optionalAttrs (args ? cargoHash) { - hash = args.cargoHash; - } - // lib.optionalAttrs (args ? cargoSha256) { - sha256 = lib.warn "cargoSha256 is deprecated. Please use cargoHash with SRI hash instead" args.cargoSha256; - } // depsExtraArgs );