Skip to content
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

xx-cargo issue with linux/arm/v6 target #104

Open
jlesage opened this issue Feb 19, 2023 · 3 comments
Open

xx-cargo issue with linux/arm/v6 target #104

jlesage opened this issue Feb 19, 2023 · 3 comments

Comments

@jlesage
Copy link

jlesage commented Feb 19, 2023

I have an issue where a build using xx-cargo with a linux/arm/v6 target is failing. Other platforms are working fine (linux/amd64, linux/386, linux/arm/v7, inux/arm64/v8).

After investigation, I found that some symbolic links are not created:

  • /arm-unknown-linux-musleabi -> armv6-alpine-linux-musleabihf
  • /armv6-alpine-linux-musleabihf/usr/lib/gcc/arm-unknown-linux-musleabi -> armv6-alpine-linux-musleabihf

With other platforms, these links are indeed properly done.

Manually creating the links fixed my build.

NOTE: The build is done under Alpine Linux.

NOTE: When using rust from the Alpine repository, the problem is not seen. Probably because their version define alpine-specific targets (https://git.alpinelinux.org/aports/tree/community/rust/alpine-target.patch?h=3.17-stable)?

@crazy-max
Copy link
Collaborator

Can you post a repro with your Dockerfile please?

@jlesage
Copy link
Author

jlesage commented Jul 17, 2023

Sure, here is a minimal Dockerfile you can use:

FROM --platform=$BUILDPLATFORM tonistiigi/xx AS xx

FROM --platform=$BUILDPLATFORM alpine:3.17

ARG TARGETPLATFORM

COPY --from=xx / /

RUN \
    apk --no-cache add \
        bash \
        curl \
        clang \
        gcc \
        musl-dev \
        && \
    xx-apk --no-cache --no-scripts add \
        musl-dev \
        gcc \
        && \
    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y && \
    source /root/.cargo/env && \
    cd /tmp && cargo new hello_cargo && \
    echo 'zip = "0.6"' >> /tmp/hello_cargo/Cargo.toml && \
    cd /tmp/hello_cargo && \
    xx-cargo build

You should see that building for linux/arm/v6 fails, while other platforms work.

@jlesage
Copy link
Author

jlesage commented Jul 17, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants