diff --git a/.cargo/config.toml b/.cargo/config.toml index 179f70adf..da17250f7 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,7 +1,4 @@ [build] # https://github.com/rust-lang/rust/pull/124129 # https://github.com/dtolnay/linkme/pull/88 -rustflags = ["-Z", "linker-features=-lld"] - -#[target.x86_64-unknown-linux-gnu] -#linker = "clang-16" +rustflags = ["-Z", "linker-features=-lld"] \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 0b596ff8c..bab87abda 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,8 +24,6 @@ RUN apt-get update && apt-get install -y \ # for openssl libssl-dev \ pkg-config \ - # for static linking - clang-16 \ # clean the image && rm -rf /var/lib/apt/lists/* @@ -33,8 +31,8 @@ ARG PROFILE=release # forward the docker argument so that the script below can read it ENV PROFILE=${PROFILE} -# statically link the C runtime (but not openssl) -ENV COMMON_RUSTFLAGS='-C target-cpu=native -Zlinker-features=-lld' + +ENV RUSTFLAGS='-C target-cpu=native -Zlinker-features=-lld' # Build the application. RUN \ @@ -53,11 +51,7 @@ cd /src # use the cache mount # (we will not be able to to write to e.g `/src/target` because it is bind-mounted) -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 +CARGO_TARGET_DIR=/artifacts cargo build --locked "--profile=${PROFILE}" --all # narrow the find call to SUBDIR because if we just copy out all executables @@ -71,8 +65,8 @@ fi # maxdepth because binaries are in the root # - other folders contain build scripts etc. mkdir /output -find "/artifacts/x86_64-unknown-linux-gnu" \ - -maxdepth 2 \ +find "/artifacts/$SUBDIR" \ + -maxdepth 1 \ -type f \ -executable \ -not -name '*.so' \