Skip to content

Commit

Permalink
build: Produce statically-linked images with musl (#440)
Browse files Browse the repository at this point in the history
  • Loading branch information
olix0r authored May 16, 2024
1 parent 95dbaa5 commit 9066973
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
8 changes: 1 addition & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,10 @@ jobs:
PACKAGE_VERSION: ${{ needs.meta.outputs.version }}
CARGO_RELEASE: "1"
DEBIAN_FRONTEND: noninteractive
container: docker://ghcr.io/linkerd/dev:v43-rust
container: docker://ghcr.io/linkerd/dev:v43-rust-musl
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- run: git config --global --add safe.directory "$PWD" # actions/runner#2033
- run: just rustup
if: matrix.arch != 'amd64'
- run: apt-get update && apt-get install -y g++-aarch64-linux-gnu gcc-aarch64-linux-gnu libc6-dev-arm64-cross
if: matrix.arch == 'arm64'
- run: apt-get update && apt-get install -y g++-arm-linux-gnueabihf gcc-arm-linux-gnueabihf libc6-dev-armhf-cross
if: matrix.arch == 'arm'
- run: just release
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32
with:
Expand Down
10 changes: 4 additions & 6 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ package_arch := env_var_or_default("ARCH", "amd64")
# If a `package_arch` is specified, then we change the default cargo `--target`
# to support cross-compilation. Otherwise, we use `rustup` to find the default.
_cargo_target := if package_arch == "amd64" {
"x86_64-unknown-linux-gnu"
"x86_64-unknown-linux-musl"
} else if package_arch == "arm64" {
"aarch64-unknown-linux-gnu"
"aarch64-unknown-linux-musl"
} else if package_arch == "arm" {
"armv7-unknown-linux-gnueabihf"
"armv7-unknown-linux-musleabihf"
} else {
`rustup show | sed -n 's/^Default host: \(.*\)/\1/p'`
}
Expand Down Expand Up @@ -149,9 +149,7 @@ test *flags:

# Build linkerd-await
build:
{{ _cargo }} build --frozen --target={{ _cargo_target }} \
{{ if build_type == "release" { "--release" } else { "" } }} \
{{ _fmt }}
just-cargo profile={{ build_type }} target={{ _cargo_target }} build

release: fetch build
@mkdir -p release
Expand Down

0 comments on commit 9066973

Please sign in to comment.