Skip to content

Commit

Permalink
Delete the previously generated binary before rebuilding
Browse files Browse the repository at this point in the history
  • Loading branch information
Tehnix committed Nov 12, 2023
1 parent 88159e2 commit 14485a2
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 4 deletions.
6 changes: 5 additions & 1 deletion lambda-directly-optimized/Dockerfile-arm
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,8 @@ COPY src/main.rs /dist/apollo-router-lambda/src/main.rs

# Build our lambda bootstrap binary. The release artifact can be found at:
# /dist/apollo-router-lambda/target/lambda/apollo-router-lambda/bootstrap
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
RUN export PATH="$HOME/.cargo/bin:$PATH"; \
export RUSTFLAGS="-Zlocation-detail=none -Zthreads=8"; \
# Delete the previously generated main.rs artifacts.
rm -r target/$TARGET/release/deps/apollo_router_lambda*; \
cargo lambda build --compiler cargo -Z build-std=std --target $TARGET --release
6 changes: 5 additions & 1 deletion lambda-directly-optimized/Dockerfile-arm-graviton
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,8 @@ COPY src/main.rs /dist/apollo-router-lambda/src/main.rs
# /dist/apollo-router-lambda/target/lambda/apollo-router-lambda/bootstrap
# NOTE: We add additional ARM/Graviton2 specific flags to the build process. See more at
# https://github.com/aws/aws-graviton-getting-started/blob/main/rust.md.
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
RUN export PATH="$HOME/.cargo/bin:$PATH"; \
export RUSTFLAGS="-Ctarget-feature=+lse -Ctarget-cpu=neoverse-n1 -Zlocation-detail=none -Zthreads=8"; \
# Delete the previously generated main.rs artifacts.
rm -r target/$TARGET/release/deps/apollo_router_lambda*; \
cargo lambda build --compiler cargo -Z build-std=std --target $TARGET --release
2 changes: 2 additions & 0 deletions lambda-directly-optimized/Dockerfile-x86
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,6 @@ COPY src/main.rs /dist/apollo-router-lambda/src/main.rs
# /dist/apollo-router-lambda/target/lambda/apollo-router-lambda/bootstrap
RUN export PATH="$HOME/.cargo/bin:$PATH"; \
export RUSTFLAGS="-Zlocation-detail=none -Zthreads=8"; \
# Delete the previously generated main.rs artifacts.
rm -r target/$TARGET/release/deps/apollo_router_lambda*; \
cargo lambda build --compiler cargo -Z build-std=std --target $TARGET --release
5 changes: 4 additions & 1 deletion lambda-directly/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,7 @@ COPY src/main.rs /dist/apollo-router-lambda/src/main.rs

# Build our lambda bootstrap binary. The release artifact can be found at:
# /dist/apollo-router-lambda/target/lambda/apollo-router-lambda/bootstrap
RUN export PATH="$HOME/.cargo/bin:$PATH"; cargo lambda build --compiler cargo --release
RUN export PATH="$HOME/.cargo/bin:$PATH"; \
# Delete the previously generated main.rs artifacts.
rm -r target/x86_64-unknown-linux-gnu/release/deps/apollo_router_lambda*; \
cargo lambda build --compiler cargo --release
5 changes: 4 additions & 1 deletion lambda-with-server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,7 @@ COPY src/main.rs /dist/apollo-router-lambda/src/main.rs

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

0 comments on commit 14485a2

Please sign in to comment.