Vendored libgit2-sys builds fail on Windows when `cargo --manifest-path` is a long UNC path
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Ambito
- build-system, operating-systems
Direzione di ricerca
Riproduci il problema con cargo build --manifest-path usando il percorso UNC lungo, quindi esamina i comandi del compilatore di libgit2-sys e libssh2-sys vendored e i relativi percorsi out/include. Confronta le build interessate 0.18.3/1.9.2 con le build precedenti 0.17.0/1.8.1; il lavoro è completato quando gli header generati vengono trovati ed entrambe le build vendored riescono da un percorso UNC lungo.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Where "a long UNC path" is e.g. \\?\C:\...\some_project\Cargo.toml, which is the form emitted by std::path::Path::canonicalize on Windows.
Reproducing the error is very simple.
cargo init path_fun
cd path_fun
cargo add git2 --features vendored-libgit2
cargo build --manifest-path \\?\S:\...\path_fun\Cargo.toml
# replacing `S:\` with your drive, and `...` with a real path
The output is quite repetitive, yielding numerous lines similar to:
cargo:warning=ToolExecError: command did not execute successfully (status code exit code: 2): "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.44.35207\\bin\\HostX64\\x64\\cl.exe" "-nologo" "-MD" "-O1" "-Z7" "-Brepro" "-I" "\\\\?\\S:\\...\\target\\debug\\build\\libgit2-sys-7b3f8407131016e2\\out\\include" "-I" "libgit2/src/libgit2" "-I" "libgit2/src/util" "-I" "libgit2/deps/llhttp" "-I" "libgit2/deps/xdiff" "-I" "libgit2/deps/pcre" "-I" "\\\\?\\S:\\...\\target\\debug\\build\\libz-sys-f91fe522964cd50a\\out/include" "-W0" "-DGIT_REGEX_BUILTIN=1" "-DHAVE_STDINT_H=1" "-DHAVE_MEMMOVE=1" "-DNO_RECURSE=1" "-DNEWLINE=10" "-DPOSIX_MALLOC_THRESHOLD=10" "-DLINK_SIZE=2" "-DPARENS_NEST_LIMIT=250" "-DMATCH_LIMIT=10000000" "-DMATCH_LIMIT_RECURSION=MATCH_LIMIT" "-DMAX_NAME_SIZE=32" "-DMAX_NAME_COUNT=10000" "-DSTRSAFE_NO_DEPRECATE" "-DWIN32" "-D_WIN32_WINNT=0x0600" "-DSHA1DC_NO_STANDARD_INCLUDES=1" "-DSHA1DC_CUSTOM_INCLUDE_SHA1_C=\"common.h\"" "-DSHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C=\"common.h\"" "-Fo\\\\?\\S:\\...\\target\\debug\\build\\libgit2-sys-7b3f8407131016e2\\out\\build\\43a19b30e9e69d8f-reader.o" "-c" "libgit2/src/libgit2\\reader.c"rebase.c
S:\cargo\registry\src\index.crates.io-1949cf8c6b5b557f\libgit2-sys-0.18.3+1.9.2\libgit2\src\util\git2_util.h(11): fatal error C1083: Cannot open include file: 'git2_features.h': No such file or directory
The relevant sections, I believe, being Cannot open include file: 'git2_features.h': No such file or directory and "-I" "\\\\?\\S:\\...\\target\\debug\\build\\libgit2-sys-7b3f8407131016e2\\out\\include". Very notably, if I look in the ...\target\debug\build\libgit2-sys-7b3f8407131016e2\out\include I find git2_features.h. That leads me to imagine this is some dumb little shell expansion corner case.
I've confirmed this is reproducible (On My Machine™) in git2 v0.20.3 / libgit2-sys v0.18.3+1.9.2 through git2 v0.19.0 / libgit2-sys v0.17.0+1.8.1. (My CI systems have definitely built v0.19.0 just fine, but are bombing on v0.20.3, so I need to focus on fixing that issue.)
Note the same issue seems to be present in libssh2-sys v0.3.1, and depending on the resolved cargo build order, you might see Cannot open include file: 'libssh2.h' instead of git2_features.h with the above repro instructions. The libssh2-sys ToolExecError includes a mirrored "-I" "\\\\?\\S:\\...\\target\\debug\\build\\libssh2-sys-b28bdd3defa4ee0c\\out\\include" (almost) pointing to a directory that includes a libssh2.h. I didn't realize this until I was mostly done writing this issue and started seeing it out of my local repros. I can duplicate the report in the libssh2-sys github repo if that would be useful.
Thanks!
- Lingua principale
- Rust
- Stelle
- 2.1k
- Fork
- 470
- Merge medio
- 2g 17h
- PR unite (30g)
- 18
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di rust-lang/git2-rs
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
`stash_foreach` crashes on stash entries with no message or a non-UTF-8 messageForse già presa @shivampwm2020 l’ha presa 43 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 64/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di rust-lang/git2-rs
Issue simili
-
bug P2
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
Windows microphone listing treats words in a device name as DirectShow labelsForse già presa @Sujal-chaudhary l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
clipy-recorder/clipy#447 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
nightly-cleanup
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
max-sixty/worktrunk#4939 · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
[Flaky Test] tests::signer::v0::miner_recovers_when_broadcast_block_delay_across_tenures_occursApertaflaky
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
stacks-network/stacks-core#7918 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni