Andy Koppe says the Makefile assumes cargo places build artifacts under ./target. If the user sets a different target directory, in ~/.cargo/config.toml or through the CARGO_TARGET_DIR environment variable, the build fails with a link error because the gitcore library built by cargo cannot be found.
His patch passes '--target-dir target' to the cargo commands that build gitcore. He adds it directly to the recipes rather than to CARGO_ARGS, so the option is not lost if CARGO_ARGS is overridden.
The contrib/libgit-{sys,rs} targets are left alone, since nothing depends on where their build output goes. The Meson build of gitcore already passes --target-dir explicitly.
The patch is at v1 and has no replies yet.