rust-lang / rust-semverver

Automatic checking for semantic versioning in library crates
BSD 3-Clause "New" or "Revised" License
638 stars 41 forks source link

Failure against `cargo intall` with the exit code: `0xc0000139, STATUS_ENTRYPOINT_NOT_FOUND` #267

Closed stuartZhang closed 2 years ago

stuartZhang commented 2 years ago

I ran into a installation failure, accompanying the following error:

Running `C:\Users\STUART~1\AppData\Local\Temp\cargo-installFueqMr\release\build\cargo-3adab67b4ad8080b\build-script-build`
Compiling git2 v0.13.25
Running `set CARGO=\\?\H:\symbol_link_source\.rustup\toolchains\nightly-2021-12-05-x86_64-pc-windows-gnu\bin\cargo.exe&& set CARGO_CRATE_NAME=git2&& set CARGO_MANIFEST_DIR=C:\Users\StuartZhang\.cargo\registry\src\github.com-1ecc6299db9ec823\git2-0.13.25&& set CARGO_PKG_AUTHORS="Josh Triplett <josh@joshtriplett.org>:Alex Crichton <alex@alexcrichton.com>"&& set CARGO_PKG_DESCRIPTION="Bindings to libgit2 for interoperating with git repositories. This library is
both threadsafe and memory safe and allows both reading and writing git repositories.
"&& set CARGO_PKG_HOMEPAGE=""&& set CARGO_PKG_LICENSE=MIT/Apache-2.0&& set CARGO_PKG_LICENSE_FILE=""&& set CARGO_PKG_NAME=git2&& set CARGO_PKG_REPOSITORY=https://github.com/rust-lang/git2-rs&& set CARGO_PKG_VERSION=0.13.25&& set CARGO_PKG_VERSION_MAJOR=0&& set CARGO_PKG_VERSION_MINOR=13&& set CARGO_PKG_VERSION_PATCH=25&& set CARGO_PKG_VERSION_PRE=""&& set GIT_BRANCH=dev-mock&& set GIT_LATEST_COMMIT_ID=dev-mock&& set GIT_TAG=dev-mock&& set MINXING_AES_CIPHER_IV=a0fe7c7c98e09e8c&& set PATH="C:\Users\STUART~1\AppData\Local\Temp\cargo-installFueqMr\release\deps;H:\symbol_link_source\.rustup\toolchains\nightly-2021-12-05-x86_64-pc-windows-gnu\bin;C:\Users\StuartZhang\.cargo\bin;C:\Users\StuartZhang\.rustup\toolchains\nightly-2021-12-05-x86_64-pc-windows-gnu\bin;D:\github_projects\binaryen\build\bin;H:\symbol_link_source\Dependencies_x64_Release;H:\symbol_link_source\depends22_x64;F:\Qt\5.12.11\mingw73_64\bin;C:\msys64\mingw64\bin;C:\Users\StuartZhang\.cargo\bin;C:\Program Files\Git\mingw64\libexec\git-core;C:\Program Files\Git\usr\bin;D:\Program Files\openssl-1.0.2j-fips-x86_64\bin;C:\Program Files\Calibre2;H:\minxing_workshop\phantomjs-2.1.1-windows\bin;H:\Program Files\dmg2img-1.6.7-win32;C:\android-debug-bridge-platform-tools;F:\nexus\nexus-3.17.0-01\bin;D:\Program Files\instantclient_18_5;D:\Program Files\Redis;C:\Ruby24-x64\bin;D:\Program Files\ImageMagick-6.9.9-Q16-HDRI;D:\Program Files\GraphicsMagick-1.3.27-Q16;D:\Program Files (x86)\GnuWin32\bin;D:\Program Files\apache-ant-1.10.5\bin;D:\Program Files\apache-maven-3.5.2\bin;D:\Program Files\emsdk-1.35.0-portable-64bit\java\jdk1.8.0_144\bin;C:\Program Files\nodejs;C:\Program Files (x86)\mklink\64bit\x64;C:\Program Files (x86)\junction;C:\Apache24\bin;H:\Program Files (x86)\VMware\VMware Workstation\bin\;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;D:\Program Files\ImageMagick-6.9.9-Q16-HDRI;d:\program files\graphicsmagick-1.3.27-q16;C:\Python27\;C:\Python27\Scripts;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Hewlett-Packard\SimplePass\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\ProgramData\chocolatey\bin;C:\Users\StuartZhang\AppData\Roaming\nvm;d:\Program Files (x86)\OpenSSH\bin;D:\Program Files (x86)\WinSCP\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Users\StuartZhang\AppData\Roaming\nvm;C:\Program Files\nodejs;C:\Program Files\Wasmtime\bin;C:\Program Files\Calibre2\;C:\Program Files\Git\cmd;C:\Program Files (x86)\GTK2-Runtime\bin;C:\Users\StuartZhang\scoop\shims;D:\tizen-sdk\tools;D:\Program Files\emsdk-1.35.0-portable-64bit;C:\Users\StuartZhang\.cargo\bin;C:\Users\StuartZhang\AppData\Local\Microsoft\WindowsApps;C:\Users\StuartZhang\AppData\Roaming\npm;C:\libjpeg-turbo64\bin;D:\Program Files\Fiddler;D:\Program Files\Microsoft VS Code\bin;C:\Users\StuartZhang\AppData\Local\GitHubDesktop\bin;C:\Users\StuartZhang\AppData\Local\Microsoft\WindowsApps"&& set npm_package_version=dev-mock&& rustc --crate-name git2 --edition=2018 C:\Users\StuartZhang\.cargo\registry\src\github.com-1ecc6299db9ec823\git2-0.13.25\src\lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no --cfg "feature=\"default\"" --cfg "feature=\"https\"" --cfg "feature=\"openssl-probe\"" --cfg "feature=\"openssl-sys\"" --cfg "feature=\"ssh\"" --cfg "feature=\"ssh_key_from_memory\"" -C metadata=2e9c35b3b2b9d10c -C extra-filename=-2e9c35b3b2b9d10c --out-dir C:\Users\STUART~1\AppData\Local\Temp\cargo-installFueqMr\release\deps -L dependency=C:\Users\STUART~1\AppData\Local\Temp\cargo-installFueqMr\release\deps --extern bitflags=C:\Users\STUART~1\AppData\Local\Temp\cargo-installFueqMr\release\deps\libbitflags-fcf9e03ff1b10fb5.rmeta --extern libc=C:\Users\STUART~1\AppData\Local\Temp\cargo-installFueqMr\release\deps\liblibc-c5f92d51d88cba43.rmeta --extern libgit2_sys=C:\Users\STUART~1\AppData\Local\Temp\cargo-installFueqMr\release\deps\liblibgit2_sys-12b884c7b44e5599.rmeta --extern log=C:\Users\STUART~1\AppData\Local\Temp\cargo-installFueqMr\release\deps\liblog-7479da9030f602e7.rmeta --extern url=C:\Users\STUART~1\AppData\Local\Temp\cargo-installFueqMr\release\deps\liburl-4b598b39bf83392c.rmeta --cap-lints warn -Z macro-backtrace -L native=C:\Users\STUART~1\AppData\Local\Temp\cargo-installFueqMr\release\build\libgit2-sys-ef56bf4250a46d21\out\build -L native=C:\Users\STUART~1\AppData\Local\Temp\cargo-installFueqMr\release\build\libssh2-sys-605c28473e319f3f\out\build -L native=C:/msys64/mingw64/bin/../lib`
error: failed to run custom build command for `cargo v0.59.0`

Caused by:
  process didn't exit successfully: `C:\Users\STUART~1\AppData\Local\Temp\cargo-installFueqMr\release\build\cargo-3adab67b4ad8080b\build-script-build` (exit code: 0xc0000139, STATUS_ENTRYPOINT_NOT_FOUND)
warning: build failed, waiting for other jobs to finish...
error: failed to compile `semverver v0.1.48 (https://github.com/rust-lang/rust-semverver#14697b59)`, intermediate artifacts can be found at `C:\Users\STUART~1\AppData\Local\Temp\cargo-installFueqMr`

Caused by:
  build failed

Given the above error log, are any of system-wide native libraries absent in my OS? My OS is as below:

Edition:            Windows 10 Home edition
version:            20H2
installation time:  ‎21-‎4-‎24
internal version:   19042.1466
Experience:             Windows Feature Experience Pack 120.2212.3920.0
stuartZhang commented 2 years ago

I have just discovered the rationale of this issue. The system-wide "zlib1.dll" under the directory "C:\Windows\System32" brings about the failure of the git2-rs compilation. My solution is so crude & humble: