Closed jifalops closed 7 months ago
Hi, thanks for raising this feature request. Using SAM CLI 1.107.0 and the hello world rust template, I can pass in DEBUG and have it not apply the --release
flag:
SAM_BUILD_MODE=debug sam build --debug --no-cached
...
2024-01-15 14:57:19,868 | checking for cargo-lambda
2024-01-15 14:57:19,868 | potential cargo-lambda binaries: ['/opt/homebrew/bin/cargo-lambda']
2024-01-15 14:57:19,869 | Executing cargo-lambda: /Users/lucashuy/.cargo/bin/cargo lambda build
2024-01-15 14:57:19,869 | RUST_LOG environment variable set to `debug`
2024-01-15 14:57:19,938 | DEBUG run: using build compiler configuration from metadata config=BuildConfig {
compiler: None, target: None }
...
Can you try upgrading SAM CLI to see if that resolve this issue?
After upgrading to SAM CLI, version 1.107.0
, using SAM_BUILD_MODE=debug
with sam build
resolves the issue.
Note that if sam local start-api
needs to build the application, it will ignore SAM_BUILD_MODE=debug
(even if exported), so it's important to run sam build
separately.
Description:
Redirected from https://github.com/awslabs/aws-lambda-rust-runtime/issues/671.
I am using sam local start-api for local development, but cannot get it to stop passing
--release
to the build command.Here is an example command that tries two separate ways of getting the correct behavior, but still
--release
is passed.Example output:
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
sam --version
: SAM CLI, version 1.87.0If there's no way to do this I might try the route of doing a debug build manually and pointing sam to it, but I'd really like the 'hot-reload' behavior.