Skip to content

Commit

Permalink
resolve some comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Erk- committed Mar 13, 2024
1 parent 9bdd31a commit 98e6c79
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,23 @@ ARG MUSL_TARGET="x86_64-linux-musl"
# The crate features to build this with
ARG FEATURES=""

FROM --platform=$BUILDPLATFORM rust:latest AS chef
FROM --platform=$BUILDPLATFORM rustlang/rust:nightly AS chef
ARG RUST_TARGET
ARG MUSL_TARGET
ARG FEATURES

RUN <<EOT
set -ex
apt-get update
apt-get upgrade
apt-get install --assume-yes musl-dev clang lld
EOT

RUN rustup target add $RUST_TARGET

RUN cargo install cargo-chef --locked

COPY <<EOF /app/.cargo/config
COPY <<EOF /app/.cargo/config.toml
[env]
CC_aarch64-unknown-linux-musl = "clang -target aarch64-unknown-linux-musl -fuse-ld=lld"
CXX_aarch64-unknown-linux-musl = "clang++ -target aarch64-unknown-linux-musl -fuse-ld=lld"
Expand All @@ -29,14 +30,20 @@ CXX_x86_64-unknown-linux-musl = "clang++ -target x86_64-unknown-linux-musl -fuse

[target.aarch64-unknown-linux-musl]
linker = "clang"
rustflags = ["-C", "link-args=-target aarch64-unknown-linux-musl -fuse-ld=lld"]
rustflags = [
"-C", "link-args=-target aarch64-unknown-linux-musl -fuse-ld=lld",
"-C", "strip", "symbols",
]

[target.x86_64-unknown-linux-musl]
linker = "clang"
rustflags = ["-C", "link-args=-target x86_64-unknown-linux-musl -fuse-ld=lld"]
rustflags = [
"-C", "link-args=-target x86_64-unknown-linux-musl -fuse-ld=lld",
"-C", "strip", "symbols",
]

#[unstable]
#build-std = ["std", "panic_abort"]
[unstable]
build-std = ["std", "panic_abort"]
EOF

WORKDIR /app
Expand Down

0 comments on commit 98e6c79

Please sign in to comment.