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

Can't build on macOS #23

Open
nikitavoloboev opened this issue Jan 27, 2019 · 4 comments
Open

Can't build on macOS #23

nikitavoloboev opened this issue Jan 27, 2019 · 4 comments

Comments

@nikitavoloboev
Copy link

Get this:

❯ cargo build --release
   Compiling libssh2-sys v0.2.6
error: failed to run custom build command for `libssh2-sys v0.2.6`
process didn't exit successfully: `/Users/nikivi/src/clones/purs/target/release/build/libssh2-sys-5f5996146911a8d3/build-script-build` (exit code: 101)
--- stdout
running: "cmake" "/Users/nikivi/.cargo/registry/src/garden.eu.org-1ecc6299db9ec823/libssh2-sys-0.2.6/libssh2" "-DCRYPTO_BACKEND=OpenSSL" "-DOPENSSL_INCLUDE_DIR=/usr/local/opt/openssl/include" "-DBUILD_SHARED_LIBS=OFF" "-DENABLE_ZLIB_COMPRESSION=ON" "-DCMAKE_INSTALL_LIBDIR=lib" "-DBUILD_EXAMPLES=OFF" "-DBUILD_TESTING=OFF" "-DCMAKE_INSTALL_PREFIX=/Users/nikivi/src/clones/purs/target/release/build/libssh2-sys-33ec213e1d609559/out" "-DCMAKE_C_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_C_COMPILER=/usr/bin/cc" "-DCMAKE_CXX_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_CXX_COMPILER=/usr/bin/c++" "-DCMAKE_BUILD_TYPE=Release"
-- The C compiler identification is AppleClang 10.0.0.10001145
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Found OpenSSL: /usr/local/opt/openssl/lib/libcrypto.dylib (found version "1.0.2q")
-- Looking for EVP_aes_128_ctr
-- Looking for EVP_aes_128_ctr - found
-- Configuring incomplete, errors occurred!
See also "/Users/nikivi/src/clones/purs/target/release/build/libssh2-sys-33ec213e1d609559/out/build/CMakeFiles/CMakeOutput.log".

--- stderr
fatal: not a git repository (or any of the parent directories): .git
CMake Error at /nix/store/q3njfqg1nicir8gy5s5pqy9rqyyznxfg-cmake-3.12.1/share/cmake-3.12/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
Call Stack (most recent call first):
  /nix/store/q3njfqg1nicir8gy5s5pqy9rqyyznxfg-cmake-3.12.1/share/cmake-3.12/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  /nix/store/q3njfqg1nicir8gy5s5pqy9rqyyznxfg-cmake-3.12.1/share/cmake-3.12/Modules/FindZLIB.cmake:112 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  src/CMakeLists.txt:239 (find_package)


thread 'main' panicked at '
command did not execute successfully, got: exit code: 1

build script failed, must exit now', /Users/nikivi/.cargo/registry/src/garden.eu.org-1ecc6299db9ec823/cmake-0.1.25/src/lib.rs:599:5
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
@nikitavoloboev
Copy link
Author

@caarlos0 Did you get it to build? I saw you starred it and I would love to use it. Not sure why my build fails. 😞

@caarlos0
Copy link

caarlos0 commented Jan 27, 2019

@nikitavoloboev yes, brew install cmake and then

RUSTFLAGS="-L/usr/local/Cellar/openssl/1.0.2q/lib" OPENSSL_INCLUDE_DIR=/usr/local/Cellar/openssl/1.0.2q/include PKG_CONFIG_PATH=/usr/local/Cellar/openssl/1.0.2q/lib/pkgconfig cargo release

check the version in /usr/local/Cellar/openssl/, they may be different on your machine...

@pquentin
Copy link

I'm a happy macOS user too. :)

@kellenff
Copy link

When using Homebrew, brew --prefix openssl is convenient to ensure that you always have the right path across updating versions. For example, in my .zshenv I have:

export OPENSSL_PREFIX=`brew --prefix openssl`
export PKG_CONFIG_PATH=$OPENSSL_PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH
export OPENSSL_INCLUDE_DIR=$OPENSSL_PREFIX/include

and then use RUSTFLAGS="-L$OPENSSL_PREFIX/lib" cargo build --release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants