summaryrefslogtreecommitdiffstats
path: root/contrib/persistent-https
diff options
context:
space:
mode:
authorbrian m. carlson <bk2204@github.com>2026-02-07 20:04:41 +0000
committerJunio C Hamano <gitster@pobox.com>2026-02-07 17:41:02 -0800
commit41d1d14a18164c529cd80c8b6b2a75f31831df08 (patch)
treecc7aa58e3a35fe9d7a36f6936746e0bc94717700 /contrib/persistent-https
parent9a1fa36fe3dbed82ae7f9906ba1ac6d391c18f17 (diff)
downloadgit-41d1d14a18164c529cd80c8b6b2a75f31831df08.tar.gz
git-41d1d14a18164c529cd80c8b6b2a75f31831df08.zip
rust: fix linking binaries with cargo
When Cargo links binaries with MSVC, it uses the link.exe linker from PATH to do so. However, when running under a shell from MSYS, such as when building with the Git for Windows SDK, which we do in CI, the /ming64/bin and /usr/bin entries are first in PATH. That means that the Unix link binary shows up first, which obviously does not work for linking binaries in any useful way. To solve this problem, adjust PATH to place those binaries at the end of the list instead of the beginning. This allows access to the normal Unix tools, but link.exe will be the compiler's linker. Make sure to export PATH explicitly: while this should be the default, it's more robust to not rely on the shell operating in a certain way. The reason this has not shown up before is that we typically link our binaries from the C compiler. However, now that we're about to introduce a Rust build script (build.rs file), Rust will end up linking that script to further drive Cargo, in which case we'll invoke the linker from it. There are other solutions, such as using LLD, but this one is simple and reliable and is most likely to work with existing systems. Signed-off-by: Ezekiel Newren <ezekielnewren@gmail.com> Signed-off-by: brian m. carlson <bk2204@github.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/persistent-https')
0 files changed, 0 insertions, 0 deletions