signalapp / libsignal

Home to the Signal Protocol as well as other cryptographic primitives which make Signal possible.
GNU Affero General Public License v3.0
3.63k stars 420 forks source link

compiling fails on Ubuntu 18.04 #491

Closed hokascha closed 2 years ago

hokascha commented 2 years ago

I am trying to get signal-cli running on Ubuntu 18.04.6 LTS which requires libsignal 0.20 but has no Glibc 2.28 - so compiling myself should be an option. While compiling, I get an error, looks like cmake is too old for the "parallel" parameter. Is there a way to circumvent the issue?

$ ./build_jni.sh desktop
cargo build -p libsignal-jni --release
   Compiling boring-sys v2.0.0 (https://github.com/signalapp/boring?branch=libsignal#b95cb545)
error: failed to run custom build command for `boring-sys v2.0.0 (https://github.com/signalapp/boring?branch=libsignal#b95cb545)`

Caused by:
  process didn't exit successfully: `/home/osboxes/signal/libsignal-0.20.0/target/release/build/boring-sys-32223fab38945807/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=BORING_BSSL_PATH
  CMAKE_TOOLCHAIN_FILE_x86_64-unknown-linux-gnu = None
  CMAKE_TOOLCHAIN_FILE_x86_64_unknown_linux_gnu = None
  HOST_CMAKE_TOOLCHAIN_FILE = None
  CMAKE_TOOLCHAIN_FILE = None
  CMAKE_GENERATOR_x86_64-unknown-linux-gnu = None
  CMAKE_GENERATOR_x86_64_unknown_linux_gnu = None
  HOST_CMAKE_GENERATOR = None
  CMAKE_GENERATOR = None
  CMAKE_PREFIX_PATH_x86_64-unknown-linux-gnu = None
  CMAKE_PREFIX_PATH_x86_64_unknown_linux_gnu = None
  HOST_CMAKE_PREFIX_PATH = None
  CMAKE_PREFIX_PATH = None
  CMAKE_x86_64-unknown-linux-gnu = None
  CMAKE_x86_64_unknown_linux_gnu = None
  HOST_CMAKE = None
  CMAKE = None
  running: "cmake" "/home/osboxes/.cargo/git/checkouts/boring-b37daebd62069023/b95cb54/boring-sys/deps/boringssl" "-DCMAKE_INSTALL_PREFIX=/home/osboxes/signal/libsignal-0.20.0/target/release/build/boring-sys-e25e21b28332e0f9/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_ASM_FLAGS= -ffunction-sections -fdata-sections -fPIC -m64" "-DCMAKE_ASM_COMPILER=/usr/bin/cc" "-DCMAKE_BUILD_TYPE=MinSizeRel"
  -- The C compiler identification is GNU 7.5.0
  -- The CXX compiler identification is GNU 7.5.0
  -- 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
  -- Check for working CXX compiler: /usr/bin/c++
  -- Check for working CXX compiler: /usr/bin/c++ -- works
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  -- The ASM compiler identification is GNU
  -- Found assembler: /usr/bin/cc
  -- Configuring done
  -- Generating done
  -- Build files have been written to: /home/osboxes/signal/libsignal-0.20.0/target/release/build/boring-sys-e25e21b28332e0f9/out/build
  running: "cmake" "--build" "." "--target" "crypto" "--config" "MinSizeRel" "--parallel" "1"

  --- stderr
  Unknown argument --parallel
  Unknown argument 1
  Usage: cmake --build <dir> [options] [-- [native-options]]
  Options:
    <dir>          = Project binary directory to be built.
    --target <tgt> = Build <tgt> instead of default targets.
                     May only be specified once.
    --config <cfg> = For multi-configuration tools, choose <cfg>.
    --clean-first  = Build target 'clean' first, then build.
                     (To clean only, use --target 'clean'.)
    --use-stderr   = Ignored.  Behavior is default in CMake >= 3.0.
    --             = Pass remaining options to the native tool.
  thread 'main' panicked at '
  command did not execute successfully, got: exit status: 1

  build script failed, must exit now', /home/osboxes/.cargo/registry/src/github.com-1ecc6299db9ec823/cmake-0.1.48/src/lib.rs:975:5
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
jrose-signal commented 2 years ago

And with --parallel 1 to boot! It looks like this is a bug in the cmake crate itself, fixed in the repo but not in any released versions. In the mean time, though, installing a newer version of CMake should work.

hokascha commented 2 years ago

correct, it works with the newer cmake version