Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"cargo install cargo-semver-checks" fails to build since version 0.24.0 due to compile issue with cmake #841

Closed
whimboo opened this issue Jul 30, 2024 · 2 comments · Fixed by #842
Labels
C-bug Category: doesn't meet expectations

Comments

@whimboo
Copy link

whimboo commented Jul 30, 2024

Steps to reproduce the bug with the above code

Run the following command: cargo install cargo-semver-checks --version 0.24.0.

Trying to install older versions work fine.

Actual Behaviour

error: failed to run custom build command for `libz-ng-sys v1.1.15`

Caused by:
  process didn't exit successfully: `/var/folders/sd/hgkqcwv90sz_q1pqjww78nfm0000gn/T/cargo-installHyjJoV/release/build/libz-ng-sys-953997c03653e4dc/build-script-build_zng` (exit status: 101)
  --- stdout
  CMAKE_TOOLCHAIN_FILE_aarch64-apple-darwin = None
  CMAKE_TOOLCHAIN_FILE_aarch64_apple_darwin = None
  HOST_CMAKE_TOOLCHAIN_FILE = None
  CMAKE_TOOLCHAIN_FILE = None
  CMAKE_GENERATOR_aarch64-apple-darwin = None
  CMAKE_GENERATOR_aarch64_apple_darwin = None
  HOST_CMAKE_GENERATOR = None
  CMAKE_GENERATOR = None
  CMAKE_PREFIX_PATH_aarch64-apple-darwin = None
  CMAKE_PREFIX_PATH_aarch64_apple_darwin = None
  HOST_CMAKE_PREFIX_PATH = None
  CMAKE_PREFIX_PATH = None
  CMAKE_aarch64-apple-darwin = None
  CMAKE_aarch64_apple_darwin = None
  HOST_CMAKE = None
  CMAKE = None
  running: cd "/var/folders/sd/hgkqcwv90sz_q1pqjww78nfm0000gn/T/cargo-installHyjJoV/release/build/libz-ng-sys-988330083ec46cbc/out/build" && CMAKE_PREFIX_PATH="" "cmake" "/Users/henrik/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libz-ng-sys-1.1.15/src/zlib-ng" "-DCMAKE_OSX_ARCHITECTURES=arm64" "-DBUILD_SHARED_LIBS=OFF" "-DZLIB_COMPAT=OFF" "-DZLIB_ENABLE_TESTS=OFF" "-DWITH_GZFILEOP=ON" "-DCMAKE_INSTALL_PREFIX=/var/folders/sd/hgkqcwv90sz_q1pqjww78nfm0000gn/T/cargo-installHyjJoV/release/build/libz-ng-sys-988330083ec46cbc/out" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -fPIC --target=arm64-apple-darwin -mmacosx-version-min=13.3 -I/opt/homebrew/opt/openssl@3/include" "-DCMAKE_C_COMPILER=/usr/bin/cc" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC --target=arm64-apple-darwin -mmacosx-version-min=13.3" "-DCMAKE_CXX_COMPILER=/usr/bin/c++" "-DCMAKE_ASM_FLAGS= -ffunction-sections -fdata-sections -fPIC --target=arm64-apple-darwin -mmacosx-version-min=13.3 -I/opt/homebrew/opt/openssl@3/include" "-DCMAKE_ASM_COMPILER=/usr/bin/cc" "-DCMAKE_BUILD_TYPE=Release"

  --- stderr
  thread 'main' panicked at /Users/henrik/.cargo/registry/src/index.crates.io-6f17d22bba15001f/cmake-0.1.50/src/lib.rs:1098:5:

  failed to execute command: No such file or directory (os error 2)
  is `cmake` not installed?

  build script failed, must exit now
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Expected Behaviour

The build should succeed.

Generated System Information

Software version

cargo-semver-checks 0.22.0

Operating system

macOS 14.4 (Darwin 23.4.0)

Command-line

/Users/henrik/.cargo/bin/cargo-semver-checks semver-checks --bugreport

cargo version

> cargo -V
cargo 1.80.0 (376290515 2024-07-16)

Compile time information

  • Profile: release
  • Target triple: aarch64-apple-darwin
  • Family: unix
  • OS: macos
  • Architecture: aarch64
  • Pointer width: 64
  • Endian: little
  • CPU features: aes,crc,dit,dotprod,dpb,dpb2,fcma,fhm,flagm,fp16,frintts,jsconv,lor,lse,neon,paca,pacg,pan,pmuv3,ras,rcpc,rcpc2,rdm,sb,sha2,sha3,ssbs,vh
  • Host: aarch64-apple-darwin

Build Configuration

No response

Additional Context

No response

@whimboo whimboo added the C-bug Category: doesn't meet expectations label Jul 30, 2024
@obi1kenobi
Copy link
Owner

obi1kenobi commented Jul 30, 2024

Thanks for the report, and sorry for the frustrating situation.

It appears that one of our dependencies has started requiring that cmake be available, per the error message: is cmake not installed?

Unfortunately, it doesn't seem to me like we have any great options here:

  • We don't directly depend on that library — it's a transitive dependency somewhere deep in the tree — so we can't easily drop it.
  • There's no way to specify to cargo that cmake is required. If cmake isn't available, cargo install will simply never work — it cannot install cmake automatically nor proactively error out with a good error message if it isn't available.
  • We could document that cmake is needed in our README, but since this is a transitive dependency, that requirement might drift over time. And the README is probably not something people will check before running cargo install anyway.
  • We already provide a prebuilt binary for aarch64-apple-darwin which users are encouraged to use. But obviously some users will prefer to compile the tool themselves, so there's still a problem.

What do you think we should do?

@whimboo
Copy link
Author

whimboo commented Jul 30, 2024

So I had a look at the repository for libz-sys if there is a known issue for that and I found rust-lang/libz-sys#93. It's not directly related but installing cmake via brew install cmake as mentioned over there fixes the error for me.

Most people might have cmake already installed so feel free to close, or maybe have an entry in the FAQ that mentions that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: doesn't meet expectations
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants