cloudflare / pingora

A library for building fast, reliable and evolvable network services.
Apache License 2.0
20.35k stars 1.1k forks source link

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

Closed paychiocedotng closed 4 months ago

paychiocedotng commented 4 months ago

Hi,

i'm experiencing build failure and not sure what I'm doing wrong or not doing right. Please help.

I'm using Ubuntu 22.04 LTS,

$ rustup -V rustup 1.26.0 (5af9b9484 2023-04-05) info: This is the version for the rustup toolchain manager, not the rustc compiler. info: The currently active rustc version is rustc 1.76.0 (07dca489a 2024-02-04)

* Cargo.toml Starts **

[package] name = "api_gateway" version = "0.1.0" edition = "2021"

[dependencies]

libz-ng-sys = "1.1.15"

pingora-boringssl = "0.1.0" pingora-core = "0.1.0" pingora-error = "0.1.0" pingora-header-serde = "0.1.0" pingora-http = "0.1.0" pingora-load-balancing = "0.1.0" pingora-openssl = "0.1.0" pingora-proxy = "0.1.0" pingora = "0.1.0" pingora-ketama = "0.1.0" pingora-lru = "0.1.0" pingora-memory-cache = "0.1.0" pingora-pool = "0.1.0" pingora-runtime = "0.1.0" pingora-timeout = "0.1.0" pingora-cache = "0.1.0" pingora-limits = "0.1.0" TinyUFO = "0.1.0" async-trait = "0.1.77" log = "0.4.21" structopt = "0.3.26" env_logger = "0.11.3"

* Cargo.toml Ends **

$ cargo build Compiling libz-ng-sys v1.1.15 Compiling sentry-backtrace v0.26.0 Compiling serde_urlencoded v0.7.1 Compiling uname v0.1.1 The following warnings were emitted during compilation:

warning: libz-ng-sys@1.1.15: Compiler version doesn't include clang or GCC: "cc" "--version" warning: libz-ng-sys@1.1.15: Compiler version doesn't include clang or GCC: "c++" "--version"

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

Caused by: process didn't exit successfully: /home/path/target/debug/build/libz-ng-sys-0b9d282b73f49799/build-script-build_zng (exit status: 101) --- stdout 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 cargo:warning=Compiler version doesn't include clang or GCC: "cc" "--version" cargo:warning=Compiler version doesn't include clang or GCC: "c++" "--version" 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: cd "/home/project_path/target/debug/build/libz-ng-sys-2e32cfecda90e696/out/build" && CMAKE_PREFIX_PATH="" "cmake" "/home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/libz-ng-sys-1.1.15/src/zlib-ng" "-DBUILD_SHARED_LIBS=OFF" "-DZLIB_COMPAT=OFF" "-DZLIB_ENABLE_TESTS=OFF" "-DWITH_GZFILEOP=ON" "-DCMAKE_INSTALL_PREFIX=/home/project_path/target/debug/build/libz-ng-sys-2e32cfecda90e696/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=Debug"

--- stderr thread 'main' panicked at /home/user/.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 warning: build failed, waiting for other jobs to finish...

LessThanGreaterThan commented 4 months ago

hey you are missing the build-essential and cmake. you can install them like this: apt install -y build-essential cmake


edited, didn't mention cmake

paychiocedotng commented 4 months ago

@LessThanGreaterThan I already had build-essential installed. But issues still persists.

$ sudo apt install -y build-essential Reading package lists... Done Building dependency tree... Done Reading state information... Done build-essential is already the newest version (12.9ubuntu3). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Thanks for your response.

LessThanGreaterThan commented 4 months ago

@LessThanGreaterThan I already had build-essential installed. But issues still persists.

$ sudo apt install -y build-essential Reading package lists... Done Building dependency tree... Done Reading state information... Done build-essential is already the newest version (12.9ubuntu3). 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Thanks for your response.

you need cmake as well.

apt install -y cmake

paychiocedotng commented 4 months ago

@LessThanGreaterThan It was unable to install cmake.

$ apt install -y cmake Reading package lists... Done Building dependency tree... Done Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:

The following packages have unmet dependencies: cmake : Depends: libjsoncpp25 (>= 1.9.5) but it is not installable Depends: librhash0 (>= 1.2.6) but it is not installable Depends: cmake-data (= 3.22.1-1ubuntu1.22.04.2) but it is not going to be installed E: Unable to correct problems, you have held broken packages.

LessThanGreaterThan commented 4 months ago

@LessThanGreaterThan It was unable to install cmake.

$ apt install -y cmake Reading package lists... Done Building dependency tree... Done Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation:

The following packages have unmet dependencies: cmake : Depends: libjsoncpp25 (>= 1.9.5) but it is not installable Depends: librhash0 (>= 1.2.6) but it is not installable Depends: cmake-data (= 3.22.1-1ubuntu1.22.04.2) but it is not going to be installed E: Unable to correct problems, you have held broken packages.

please make sure you have the correct apt sources defined, after that run apt update and try again.

incase the sources are missing you can find them here: https://gist.github.com/hakerdefo/9c99e140f543b5089e32176fe8721f5f

paychiocedotng commented 4 months ago

@LessThanGreaterThan

I eventually installed cmake through nala package manager. And i'm able to build and run the project successfully.

cmake is a dependency that needs to be installed on the dev/build environment for this library to be happy.

Thanks for your help.

paychiocedotng commented 4 months ago

Just install cmake and you'll be fine