-
Notifications
You must be signed in to change notification settings - Fork 23
Cannot compile with musl as target #30
Comments
Linked root issue and merged issue are closed. Is this done? |
It didn't work before even with the issue merged, haven't tried recently. |
This issue seems to be reproduced when trying to build the example with musl:
|
How can we make this work with Docker/musl? Is there any example |
I have no idea, I'd be happy if someone figures it out. |
I found the solution, my container(s) were missing make and perhaps other system dependencies however the error was "saying file is not found" instead. Even an archlinux setup with libsass package can give the same error when make package is not installed. Can we make build.rs give better error messages? |
@Keats Does your system have git installed? By adding RUST_BACKTRACE to my build, I found line 56 (https://github.com/compass-rs/sass-rs/blob/master/sass-sys/build.rs#L56) as the culprit, and installing git fixed the problem for me |
@DusterTheFirst The issue is the libsass_sys still relies on glibc when build on a musl target. Here is the latest error I got when build libsass (as a dependency of zola)
For reference here is the Dockerfile I'm using ARG RUSTC_VERSION=1.42.0
FROM clux/muslrust:${RUSTC_VERSION}-stable as builder
#FROM rust:${RUSTC_VERSION}-slim-stretch as builder
ENV ZOLA_VERSION 0.10.1
RUN apt-get update -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y -q \
wget
RUN wget https://github.com/getzola/zola/archive/v${ZOLA_VERSION}.tar.gz && \
mkdir zola && \
tar -zxvf v${ZOLA_VERSION}.tar.gz -C zola && \
mv zola/zola-${ZOLA_VERSION}/* zola/ && \
rm -f v${ZOLA_VERSION}.tar.gz
WORKDIR zola
ENV RUST_BACKTRACE=1
RUN cargo build --release
FROM alpine
COPY --from=builder /zola/target/release/zola /usr/local/bin/
CMD ["zola"] |
@shalzz I was able to build and run sass-sys on alpine. Here’s the docker file I used. https://github.com/DusterTheFirst/sxfs/blob/master/Dockerfile |
Is there any way to compile this fully statically to be used in a |
See getzola/zola#316
In short:
Root issue: rust-lang/rust#36710
Related (?) RFC: https://github.com/rust-lang/rfcs/blob/master/text/1721-crt-static.md
Current merged solution: rust-lang/rust#51063
The text was updated successfully, but these errors were encountered: