Open cBournhonesque opened 5 months ago
I'm not able to replicate this, neither with v0.2.5 or using main
. Can you post the entire build log
here's my try at reproducing it
cargo init
cargo add libudev-sys
# Cross.toml
[target.x86_64-unknown-linux-gnu]
pre-build = [
"dpkg --add-architecture $CROSS_DEB_ARCH",
"""apt-get update && apt-get install --assume-yes \
pkg-config:$CROSS_DEB_ARCH \
libssl-dev:$CROSS_DEB_ARCH \
ca-certificates:$CROSS_DEB_ARCH \
libasound2-dev:$CROSS_DEB_ARCH \
libpulse-dev:$CROSS_DEB_ARCH \
libdbus-1-dev:$CROSS_DEB_ARCH \
portaudio19-dev:$CROSS_DEB_ARCH \
libudev-dev:$CROSS_DEB_ARCH \
"""
]
❯ cross build --release --target x86_64-unknown-linux-gnu
Compiling pkg-config v0.3.29
Compiling libc v0.2.153
Compiling libudev-sys v0.1.4
Compiling libudev-test v0.1.0 (/project)
Finished release [optimized] target(s) in 44.24s
Hm i'm not too sure why but the error I get now is related to alsa:
error: failed to run custom build command for `alsa-sys v0.3.1`
Caused by:
process didn't exit successfully: `/target/release/build/alsa-sys-6d9c1bff4963f07a/build-script-build` (exit status: 101)
--- stdout
cargo:rerun-if-env-changed=ALSA_NO_PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG
cargo:rerun-if-env-changed=PKG_CONFIG
cargo:rerun-if-env-changed=ALSA_STATIC
cargo:rerun-if-env-changed=ALSA_DYNAMIC
cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
cargo:rerun-if-env-changed=PKG_CONFIG_PATH
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
--- stderr
thread 'main' panicked at /Users/cbournhonesque/dev/rust/.cargo/registry/src/index.crates.io-6f17d22bba15001f/alsa-sys-0.3.1/build.rs:13:18:
`PKG_CONFIG_ALLOW_SYSTEM_CFLAGS="1" PKG_CONFIG_ALLOW_SYSTEM_LIBS="1" "pkg-config" "--libs" "--cflags" "alsa"` did not exit successfully: exit status: 1
error: could not find system library 'alsa' required by the 'alsa-sys' crate
--- stderr
Package alsa was not found in the pkg-config search path.
Perhaps you should add the directory containing `alsa.pc'
to the PKG_CONFIG_PATH environment variable
No package 'alsa' found
My compilation fails:
even though I added this to my
Cross.toml
:My run command is
cross build --release --target x86_64-unknown-linux-gnu
.I searched online and it looks like I might be missing from complicated linker env variables?