Skip to content

Commit

Permalink
Merge pull request #26 from BCWResearch/shanghai-2-static
Browse files Browse the repository at this point in the history
Partial-static linking for worker only
  • Loading branch information
patrick-bcw authored Aug 20, 2024
2 parents 99551f6 + d166126 commit 28d79f1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ ARG PROFILE=release
ENV PROFILE=${PROFILE}

# statically link the C runtime (but not openssl)
ENV COMMON_RUSTFLAGS='-C target-cpu=native -Zlinker-features=-lld -C target-feature=+crt-static'
ENV COMMON_RUSTFLAGS='-C target-cpu=native -Zlinker-features=-lld'

# Build the application.
RUN \
Expand All @@ -53,8 +53,11 @@ cd /src

# use the cache mount
# (we will not be able to to write to e.g `/src/target` because it is bind-mounted)
CC=clang-16 RUSTFLAGS="${COMMON_RUSTFLAGS}" \
CARGO_TARGET_DIR=/artifacts cargo build --locked "--profile=${PROFILE}" --target=x86_64-unknown-linux-gnu --bin worker --bin coordinator --bin leader --bin rpc --bin verifier
RUSTFLAGS="${COMMON_RUSTFLAGS} -C target-feature=+crt-static" \
CARGO_TARGET_DIR=/artifacts cargo build --locked "--profile=${PROFILE}" --target=x86_64-unknown-linux-gnu --bin worker

RUSTFLAGS="${COMMON_RUSTFLAGS}" \
CARGO_TARGET_DIR=/artifacts cargo build --locked "--profile=${PROFILE}" --target=x86_64-unknown-linux-gnu --bin coordinator --bin leader --bin rpc --bin verifier


# narrow the find call to SUBDIR because if we just copy out all executables
Expand Down

0 comments on commit 28d79f1

Please sign in to comment.