default-crate-overrides: proc-macro-crate: fix build for 3.3.0 (#388844)

This commit is contained in:
Sandro
2025-03-15 22:11:50 +01:00
committed by GitHub
@@ -346,14 +346,14 @@
};
# Assumes it can run Command::new(env::var("CARGO")).arg("locate-project")
# https://github.com/bkchr/proc-macro-crate/blame/master/src/lib.rs#L244
# https://github.com/bkchr/proc-macro-crate/blame/master/src/lib.rs#L242
proc-macro-crate = attrs: lib.optionalAttrs (lib.versionAtLeast attrs.version "2.0") {
prePatch = (attrs.prePatch or "") + ''
postPatch = (attrs.postPatch or "") + ''
substituteInPlace \
src/lib.rs \
--replace-fail \
'env::var("CARGO").map_err(|_| Error::CargoEnvVariableNotSet)?' \
'"${lib.getBin buildPackages.cargo}/bin/cargo"'
'env::var("CARGO")' \
'Ok::<_, core::convert::Infallible>("${lib.getBin buildPackages.cargo}/bin/cargo")'
'';
};
}