Issue building zstd-sys on mips-unknown-linux-musl #1136
-
I'm not sure if this is a bug in cross or zstd-sys, but when I try to build a package that depends on zstd-sys, it throws an error:
Basically, its looking for the command I can work around this by simply adding a pre-build script that links
But I wasn't sure if this is an issue that should be raised here or with zstd-sys. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
We might have to export ENV CARGO_TARGET_MIPS_UNKNOWN_LINUX_MUSL_LINKER="$CROSS_TOOLCHAIN_PREFIX"gcc.sh \
CARGO_TARGET_MIPS_UNKNOWN_LINUX_MUSL_RUNNER="/qemu-runner mips" \
CC_mips_unknown_linux_musl="$CROSS_TOOLCHAIN_PREFIX"gcc \
CXX_mips_unknown_linux_musl="$CROSS_TOOLCHAIN_PREFIX"g++ \ We don't export I've created #1137 from this. Thanks for reporting. As a quick check, can you try adding the following to [target.mips-unknown-linux-musl.env]
passthrough = ["AR_mips_unknown_linux_musl=mips-linux-muslsf-ar"] |
Beta Was this translation helpful? Give feedback.
-
I've created the following branch as a potential fix: One quick thing, since I can't exactly replicate this on my end. Can you confirm that manually overriding Although I can't replicate this exactly, It looks like under most circumstances, just the host Cross.toml [target.mips-unknown-linux-musl]
dockerfile = 'Dockerfile' Dockerfile FROM ghcr.io/cross-rs/mips-unknown-linux-musl:main
RUN echo '#!/usr/bin/env bash\n \
unset CC_mips_unknown_linux_musl\n \
unset CXX_mips_unknown_linux_musl\n \
exec "$@"' > /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"] And then the script output: [hellopp 0.1.0] error occurred: Failed to find tool. Is `mips-linux-musl-g++` installed?
[hellopp 0.1.0]
[hellopp 0.1.0]
error: failed to run custom build command for `hellopp v0.1.0 (/home/ahuszagh/Desktop/cross/rust-cpp-hello-word)`
Caused by:
process didn't exit successfully: `/target/debug/build/hellopp-705ea2b037138262/build-script-build` (exit status: 1)
--- stdout
TARGET = Some("mips-unknown-linux-musl")
OPT_LEVEL = Some("0")
HOST = Some("x86_64-unknown-linux-gnu")
CXX_mips-unknown-linux-musl = None
CXX_mips_unknown_linux_musl = None
TARGET_CXX = None
CXX = None
CROSS_COMPILE = None
CXXFLAGS_mips-unknown-linux-musl = None
CXXFLAGS_mips_unknown_linux_musl = None
TARGET_CXXFLAGS = None
CXXFLAGS = None
CRATE_CC_NO_DEFAULTS = None
DEBUG = Some("true")
CARGO_CFG_TARGET_FEATURE = None
running: "mips-linux-musl-g++" "-O0" "-ffunction-sections" "-fdata-sections" "-fPIC" "-g" "-fno-omit-frame-pointer" "-Wall" "-Wextra" "-o" "/target/mips-unknown-linux-musl/debug/build/hellopp-38
86664edd0ddd36/out/hellopp.o" "-c" "hellopp.cc"
--- stderr
error occurred: Failed to find tool. Is `mips-linux-musl-g++` installed?
+ rustup component list --toolchain stable-x86_64-unknown-linux-gnu
|
Beta Was this translation helpful? Give feedback.
We might have to export
AR_$target
as an envvar. Pretty sure this is a bug. I'll open an issue and have a patch within the day. The issue as follows:We don't export
AR_mips_unknown_linux_musl="$CROSS_TOOLCHAIN_PREFIX"ar
, whichcc-rs
also uses. Most targets don't call thear
directly, but we should probably explicitly specify it for all targets.I've created #1137 from this. Thanks for reporting. As a quick check, ca…