Skip to content

Commit 14485a2

Browse files
committed
Delete the previously generated binary before rebuilding
1 parent 88159e2 commit 14485a2

File tree

5 files changed

+20
-4
lines changed

5 files changed

+20
-4
lines changed

lambda-directly-optimized/Dockerfile-arm

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,8 @@ COPY src/main.rs /dist/apollo-router-lambda/src/main.rs
4444

4545
# Build our lambda bootstrap binary. The release artifact can be found at:
4646
# /dist/apollo-router-lambda/target/lambda/apollo-router-lambda/bootstrap
47-
RUN export PATH="$HOME/.cargo/bin:$PATH"; export RUSTFLAGS="-Zlocation-detail=none -Zthreads=8"; cargo lambda build --compiler cargo -Z build-std=std --target $TARGET --release
47+
RUN export PATH="$HOME/.cargo/bin:$PATH"; \
48+
export RUSTFLAGS="-Zlocation-detail=none -Zthreads=8"; \
49+
# Delete the previously generated main.rs artifacts.
50+
rm -r target/$TARGET/release/deps/apollo_router_lambda*; \
51+
cargo lambda build --compiler cargo -Z build-std=std --target $TARGET --release

lambda-directly-optimized/Dockerfile-arm-graviton

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,8 @@ COPY src/main.rs /dist/apollo-router-lambda/src/main.rs
5454
# /dist/apollo-router-lambda/target/lambda/apollo-router-lambda/bootstrap
5555
# NOTE: We add additional ARM/Graviton2 specific flags to the build process. See more at
5656
# https://github.com/aws/aws-graviton-getting-started/blob/main/rust.md.
57-
RUN export PATH="$HOME/.cargo/bin:$PATH"; export RUSTFLAGS="-Ctarget-feature=+lse -Ctarget-cpu=neoverse-n1 -Zlocation-detail=none -Zthreads=8"; cat src/main.rs; cargo lambda build --compiler cargo -Z build-std=std --target $TARGET --release
57+
RUN export PATH="$HOME/.cargo/bin:$PATH"; \
58+
export RUSTFLAGS="-Ctarget-feature=+lse -Ctarget-cpu=neoverse-n1 -Zlocation-detail=none -Zthreads=8"; \
59+
# Delete the previously generated main.rs artifacts.
60+
rm -r target/$TARGET/release/deps/apollo_router_lambda*; \
61+
cargo lambda build --compiler cargo -Z build-std=std --target $TARGET --release

lambda-directly-optimized/Dockerfile-x86

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,4 +54,6 @@ COPY src/main.rs /dist/apollo-router-lambda/src/main.rs
5454
# /dist/apollo-router-lambda/target/lambda/apollo-router-lambda/bootstrap
5555
RUN export PATH="$HOME/.cargo/bin:$PATH"; \
5656
export RUSTFLAGS="-Zlocation-detail=none -Zthreads=8"; \
57+
# Delete the previously generated main.rs artifacts.
58+
rm -r target/$TARGET/release/deps/apollo_router_lambda*; \
5759
cargo lambda build --compiler cargo -Z build-std=std --target $TARGET --release

lambda-directly/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,7 @@ COPY src/main.rs /dist/apollo-router-lambda/src/main.rs
4848

4949
# Build our lambda bootstrap binary. The release artifact can be found at:
5050
# /dist/apollo-router-lambda/target/lambda/apollo-router-lambda/bootstrap
51-
RUN export PATH="$HOME/.cargo/bin:$PATH"; cargo lambda build --compiler cargo --release
51+
RUN export PATH="$HOME/.cargo/bin:$PATH"; \
52+
# Delete the previously generated main.rs artifacts.
53+
rm -r target/x86_64-unknown-linux-gnu/release/deps/apollo_router_lambda*; \
54+
cargo lambda build --compiler cargo --release

lambda-with-server/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,7 @@ COPY src/main.rs /dist/apollo-router-lambda/src/main.rs
4848

4949
# Build our lambda bootstrap binary. The release artifact can be found at:
5050
# /dist/apollo-router-lambda/target/lambda/apollo-router-lambda/bootstrap
51-
RUN export PATH="$HOME/.cargo/bin:$PATH"; cargo lambda build --compiler cargo --release
51+
RUN export PATH="$HOME/.cargo/bin:$PATH"; \
52+
# Delete the previously generated main.rs artifacts.
53+
rm -r target/x86_64-unknown-linux-gnu/release/deps/apollo_router_lambda*; \
54+
cargo lambda build --compiler cargo --release

0 commit comments

Comments
 (0)