Skip to content

Commit 1012e87

Browse files
authoredMar 19, 2025
[Backport release-24.11] default-crate-overrides: proc-macro-crate: fix build for 3.3.0 (#390222)
2 parents 29d9c00 + dbb19a6 commit 1012e87

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed
 

‎pkgs/build-support/rust/default-crate-overrides.nix

+4-4
Original file line numberDiff line numberDiff line change
@@ -359,14 +359,14 @@ in
359359
};
360360

361361
# Assumes it can run Command::new(env::var("CARGO")).arg("locate-project")
362-
# https://github.com/bkchr/proc-macro-crate/blame/master/src/lib.rs#L244
362+
# https://github.com/bkchr/proc-macro-crate/blame/master/src/lib.rs#L242
363363
proc-macro-crate = attrs: lib.optionalAttrs (lib.versionAtLeast attrs.version "2.0") {
364-
prePatch = (attrs.prePatch or "") + ''
364+
postPatch = (attrs.postPatch or "") + ''
365365
substituteInPlace \
366366
src/lib.rs \
367367
--replace-fail \
368-
'env::var("CARGO").map_err(|_| Error::CargoEnvVariableNotSet)?' \
369-
'"${lib.getBin buildPackages.cargo}/bin/cargo"'
368+
'env::var("CARGO")' \
369+
'Ok::<_, core::convert::Infallible>("${lib.getBin buildPackages.cargo}/bin/cargo")'
370370
'';
371371
};
372372
}

0 commit comments

Comments
 (0)
Failed to load comments.