-
Notifications
You must be signed in to change notification settings - Fork 655
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error on cargo build --release #1346
Comments
It seems that my used gcc version is to old.
I found some advice to use a newer version of gcc, so I did:
Running cargo build leads now to
like also mentioned in the COMPILING.md here. Now I end up with the original error (see first post). I can see that build-essentials has installed gcc-9 again. I tried to just remove gcc-9, also does not work. The error on cargo build is now:
|
What has fixed the issue for me:
I missed Maybe it's worth to mention a min. version for gcc in the COMPILING.md? |
I don't think this is realistic. This new gcc requirement comes from a dependency. Downstream projects can't be expected to track this kind of thing. I think if you're building the latest code, you're likely going to need a reasonably recent version of common dev tools like gcc. Ubuntu 20.04 might still be "supported" by Canoncial, but it's two LTS releases behind now and contains software from 4.5 years ago. I think it's fair to say that building latest software isn't what old Ubuntu LTS releases are for. |
Ok. The issue is solved for me at the moment. Regarding "best practice": Who is responsible for closing an issue? The OP? Or should this stay open in case someone else stumbles over the same (whereas can still be found in closed issues)? |
If there's no further action or tracking required then leaving it open isn't necessary and anyone can close. It can easily be reopened later if required. Google will likely bring anyone else here with the same problem, and the workaround should be clear to them. |
I guess the one thing remaining for me here is why it's dragging this dependency in. I thought that aws-lc package was related to nasm support, and surely that's behind a non-default feature flag... |
Cancel thah. I see it's being brought in by hyper's TLS library that's used by |
I think they fixed this in aws-lc-sys v0.21.2 aws/aws-lc-rs#520 |
So how do we fix this on alpine? ERROR: unable to select packages:
build-essential (no such package):
required by: world[build-essential]
gcc-10 (no such package):
required by: world[gcc-10] I tried using an ubuntu builder (rust:latest), but an alpine image as the final one, and I can't seem to get it working even after installing gcompat on the alpine image. c8c0c3e8bbde:/# librespot --version
Error relocating /usr/bin/librespot: __res_init: symbol not found
c8c0c3e8bbde:/# ldd /usr/bin/librespot
/lib64/ld-linux-x86-64.so.2 (0x7fc9cfb20000)
libasound.so.2 => /usr/lib/libasound.so.2 (0x7fc9ceb93000)
libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x7fc9ceb6f000)
libm.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7fc9cfb20000)
libc.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7fc9cfb20000)
ld-linux-x86-64.so.2 => /lib/ld-linux-x86-64.so.2 (0x7fc9ceb68000)
Error relocating /usr/bin/librespot: __register_atfork: symbol not found
Error relocating /usr/bin/librespot: gnu_get_libc_version: symbol not found
Error relocating /usr/bin/librespot: __res_init: symbol not found Using this dockerfile: # Stage 1: Build the Librespot binary
FROM rust:latest AS builder
# Install necessary dependencies for building
RUN apt-get update && apt-get install -y \
pkg-config \
libasound2-dev \
&& rm -rf /var/lib/apt/lists/*
# Set the working directory
WORKDIR /usr/src/librespot
# Clone the Librespot repository
RUN git clone https://github.com/librespot-org/librespot.git .
# Build the project
RUN cargo build --release
ARG BUILD_FROM
#FROM $BUILD_FROM
FROM ghcr.io/hassio-addons/base:16.2.1
# Add env
ENV LANG C.UTF-8
# Set shell
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN \
apk add --no-cache \
pulseaudio alsa-plugins-pulse bash gcompat \
&& rm -fr \
/tmp/*
RUN apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community/ snapcast-server=0.29.0-r0
# Copy the built binary from the builder stage
COPY --from=builder /usr/src/librespot/target/release/librespot /usr/bin/librespot
#RUN apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing/ librespot=0.4.2-r4
RUN \
wget https://github.com/badaix/snapweb/releases/download/v0.8.0/snapweb.zip && \
unzip -o snapweb.zip -d /usr/share/snapserver/snapweb/ && \
rm snapweb.zip
# Copy data for add-on
COPY run.sh /
RUN chmod a+x /run.sh
CMD [ "/run.sh" ] |
Tried to cross compile like this: # Stage 1: Build the Librespot binary
FROM rust:latest AS builder
# Install necessary dependencies for building
RUN apt-get update && apt-get install -y \
pkg-config \
libasound2-dev \
musl-tools \
&& rm -rf /var/lib/apt/lists/*
# Set the working directory
WORKDIR /usr/src/librespot
# Clone the Librespot repository
RUN git clone https://github.com/librespot-org/librespot.git .
# Set up cargo for static linking
RUN rustup target add x86_64-unknown-linux-musl
# Build the project
RUN cargo build --release --target=x86_64-unknown-linux-musl
ARG BUILD_FROM
#FROM $BUILD_FROM
FROM ghcr.io/hassio-addons/base:16.2.1
# Add env
ENV LANG C.UTF-8
# Set shell
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN \
apk add --no-cache \
pulseaudio alsa-plugins-pulse bash gcompat \
&& rm -fr \
/tmp/*
RUN apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community/ snapcast-server=0.29.0-r0
# Copy the built binary from the builder stage
COPY --from=builder /usr/src/librespot/target/x86_64-unknown-linux-musl/release/librespot /usr/bin/librespot
#RUN apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing/ librespot=0.4.2-r4
RUN \
wget https://github.com/badaix/snapweb/releases/download/v0.8.0/snapweb.zip && \
unzip -o snapweb.zip -d /usr/share/snapserver/snapweb/ && \
rm snapweb.zip
# Copy data for add-on
COPY run.sh /
RUN chmod a+x /run.sh
CMD [ "/run.sh" ] But getting this for alsa-sys:
|
Can't even get it built on an alpine builder: # Stage 1: Build the Librespot binary
FROM rust:alpine AS builder
# Install necessary dependencies for building
RUN apk add --no-cache \ build-base \ pkgconfig \ alsa-lib-dev \ alsa-lib \ libc-dev \ git
# Set the working directory
WORKDIR /usr/src/librespot
# Clone the Librespot repository
RUN git clone https://github.com/librespot-org/librespot.git .
# Build the project
RUN cargo build --release
ARG BUILD_FROM
#FROM $BUILD_FROM
FROM ghcr.io/hassio-addons/base:16.2.1
# Add env
ENV LANG C.UTF-8
# Set shell
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN \ apk add --no-cache \ pulseaudio alsa-plugins-pulse bash \ && rm -fr \ /tmp/*
RUN apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community/ snapcast-server=0.29.0-r0
# Copy the built binary from the builder stage
COPY --from=builder /usr/src/librespot/target/release/librespot /usr/bin/librespot
#RUN apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing/ librespot=0.4.2-r4
RUN \ wget https://github.com/badaix/snapweb/releases/download/v0.8.0/snapweb.zip && \ unzip -o snapweb.zip -d /usr/share/snapserver/snapweb/ && \
rm snapweb.zip
# Copy data for add-on
COPY run.sh /
RUN chmod a+x /run.sh
CMD [ "/run.sh" ]
|
Beside a Linux PC system, I have (tried) to build current librespot also on other targets (native, no cross-compile): Raspberry Pi OS (64bit) on a Raspberry Pi 4:
Raspberry Pi OS (32bit) on a Rasperry Pi 1:
Win10 (64bit)
That's the complete error log:
It seems that I have stopped building librespot on Windows for now. Was anyone successful compiling and building recent librespot on Windows? Edit: |
Is your windows system likely to be out of memory while compiling? Does building with |
And in terms of successful windows builds, they're all fine for CI (else it wouldn't have been merged). |
Thanks for the hint. I just thought there is maybe a general issue with building on Windows. I have rebooted my Win10 PC and started the build again. I was able to finish the build now using Edit: |
I'm getting a build error on
cargo build --release
, running Linux Mint 20.3 (based on Ubuntu 20.04 LTS, still supported). What I did so far:Building result in following error:
I'm not facing any build issues for a version older than 3rd of Sept. Next update for me was 7th of Sept. Since 7th of Sept. I cannot build HEAD of dev anymore. Some commit between 3rd and 7th seems to cause this issue.
Any help welcome.
The text was updated successfully, but these errors were encountered: