Skip to content

Commit

Permalink
feat: override release profile values when compiling
Browse files Browse the repository at this point in the history
  • Loading branch information
mmalenic committed Sep 19, 2023
1 parent ae36a31 commit eb9434f
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import * as s3n from "aws-cdk-lib/aws-s3-notifications";
import * as lambdaDestinations from "aws-cdk-lib/aws-lambda-destinations";
import * as lambdaEventSources from "aws-cdk-lib/aws-lambda-event-sources";
import {CfnBucket} from "aws-cdk-lib/aws-s3";
import { exec } from "child_process";

interface Settings {
database_url: string,
Expand Down Expand Up @@ -91,8 +92,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,
Expand Down

0 comments on commit eb9434f

Please sign in to comment.