From 6d1fbda7d1146e365ce3c23f948cff3353374fe5 Mon Sep 17 00:00:00 2001 From: Marko Malenic Date: Tue, 19 Sep 2023 20:49:44 +1000 Subject: [PATCH] feat: override release profile values when compiling --- .../filemanager/deploy/stack/filemanager_stack.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/workload/stateless/filemanager/deploy/stack/filemanager_stack.ts b/lib/workload/stateless/filemanager/deploy/stack/filemanager_stack.ts index 1260545d9..ef04d7ec7 100644 --- a/lib/workload/stateless/filemanager/deploy/stack/filemanager_stack.ts +++ b/lib/workload/stateless/filemanager/deploy/stack/filemanager_stack.ts @@ -91,8 +91,16 @@ export class FilemanagerStack extends Stack { RUST_LOG: "info,filemanager_ingest_lambda=trace,filemanager=trace", }, buildEnvironment: { - // Todo get this to build debug rather than release for local dev. - RUSTFLAGS: "-C target-cpu=neoverse-n1", + // Override release profile to match defaults for dev builds. + CARGO_PROFILE_RELEASE_OPT_LEVEL: "0", + CARGO_PROFILE_RELEASE_DEBUG_ASSERTIONS: "true", + CARGO_PROFILE_RELEASE_OVERFLOW_CHECKS: "true", + CARGO_PROFILE_RELEASE_PANIC: "unwind", + CARGO_PROFILE_RELEASE_INCREMENTAL: "true", + CARGO_PROFILE_RELEASE_CODEGEN_UNITS: "256", + + // Additionally speed up builds by removing debug info. Please enable this if required. + CARGO_PROFILE_RELEASE_DEBUG: "false", }, architecture: Architecture.ARM_64, role: lambdaRole,