aws / aws-sam-cli

CLI tool to build, test, debug, and deploy Serverless applications using AWS SAM
https://aws.amazon.com/serverless/sam/
Apache License 2.0
6.51k stars 1.17k forks source link

Bug: Workflow RustCargoLambdaBuilder does not support value "False" for building in source. Using default value "True". #7636

Open paulsmithkc opened 4 days ago

paulsmithkc commented 4 days ago

Description:

Tried testing out the Rust Hello World example but am running into some errors with sam build

$ sam build --beta-features

Experimental features are enabled for this session.                                                                           
Visit the docs page to learn more about the AWS Beta terms https://aws.amazon.com/service-terms/.                             

Starting Build use cache                                                                                                      
Cache is invalid, running build and copying resources for following functions (HelloWorldFunction)                            
Building codeuri: <...>/rust_app runtime: provided.al2023          
architecture: x86_64 functions: HelloWorldFunction                                                                            
Workflow RustCargoLambdaBuilder does not support value "False" for building in source. Using default value "True".            
 Running RustCargoLambdaBuilder:CargoLambdaBuild                                                                              

Build Failed
Error: RustCargoLambdaBuilder:CargoLambdaBuild - Cargo Lambda failed: Cannot find Cargo Lambda. Cargo Lambda must be installed on the host machine to use this feature. Follow the gettings started guide to learn how to install it: https://www.cargo-lambda.info/guide/getting-started.html

Steps to reproduce:

  1. Use sam init to create a Hello World example project using runtime provided.al2023
  2. Run sam build

Observed result:

Project fails to build

Expected result:

Project builds successfully

Additional environment details

sam --version

SAM CLI, version 1.127.0

sam --info

{
  "version": "1.127.0",
  "system": {
    "python": "3.8.20",
    "os": "macOS-15.0-x86_64-i386-64bit"
  },
  "additional_dependencies": {
    "docker_engine": "27.2.0",
    "aws_cdk": "Not available",
    "terraform": "1.9.7"
  },
  "available_beta_feature_env_vars": [
    "SAM_CLI_BETA_FEATURES",
    "SAM_CLI_BETA_BUILD_PERFORMANCE",
    "SAM_CLI_BETA_TERRAFORM_SUPPORT",
    "SAM_CLI_BETA_RUST_CARGO_LAMBDA"
  ]
hnnasit commented 4 days ago

Hello @paulsmithkc, as mentioned in the error message and the docs, Cargo Lambda needs to be installed to use sam build for rust projects. Let us know if you are still running into issues or have questions.