Vendored libgit2-sys builds fail on Windows when `cargo --manifest-path` is a long UNC path
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
Línea de trabajo
Reproduce el fallo con cargo build --manifest-path usando la ruta UNC larga; después, inspecciona los comandos del compilador de libgit2-sys y libssh2-sys vendored y sus rutas out/include. Compara las compilaciones afectadas 0.18.3/1.9.2 con las compilaciones anteriores 0.17.0/1.8.1; se considera terminado cuando se encuentran los headers generados y ambas compilaciones vendored tienen éxito desde una ruta UNC larga.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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!
- Lenguaje dominante
- Rust
- Estrellas
- 2.1k
- Forks
- 470
- Merge medio
- 2 d 17 h
- PR fusionados (30 d)
- 18
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de rust-lang/git2-rs
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
`stash_foreach` crashes on stash entries with no message or a non-UTF-8 messagePosiblemente ocupada @shivampwm2020 la tomó hace 43 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Dificultad 3/5 1-2 días Aptitud para principiantes 64/100
Los mantenedores suelen responder en 1 día
Todos los issues de rust-lang/git2-rs
Issues similares
-
bug P2
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
Los mantenedores suelen responder en 1 día
-
Windows microphone listing treats words in a device name as DirectShow labelsPosiblemente ocupada @Sujal-chaudhary la tomó hoy. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
clipy-recorder/clipy#447 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
nightly-cleanup
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
max-sixty/worktrunk#4939 · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
[Flaky Test] tests::signer::v0::miner_recovers_when_broadcast_block_delay_across_tenures_occursAbiertoflaky
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
stacks-network/stacks-core#7918 · 1 comentario ·
Los mantenedores suelen responder en 2 días