`[package.metadata.lambda.deploy]` isn't respected if `binary-name` is used · Issue #866 · cargo-lambda/cargo-lambda · GitHub
Skip to content

[package.metadata.lambda.deploy] isn't respected if binary-name is used #866

Closed

Description

@nemosupremo

Cargo.toml

[package]
name = "mybin"

[package.metadata.lambda.deploy]
memory = 512
timeout = 60

Without binary-name

$cargo lambda deploy \                                                       
            --dry \                 
            mybin        
🔍 deployment for function `mybin`:
🏠 zip file located at /Users/nemo/mybin/target/lambda/mybin/bootstrap.zip
🛠️  binary last compiled 12 minutes ago
🏗️  architecture arm64
🗃️  files included in the zip file:
  - bootstrap
🛫  AWS SDK configuration:
  - region: us-east-2
🍿 function configuration:
  - timeout: Some(Timeout(60))
  - memory: Some(Memory(512))
  - enable_function_url: false
  - disable_function_url: false
  - tracing: None
  - role: None
  - layer: None
  - runtime: "provided.al2023"
  - env_options: None

With binary-name

$ cargo lambda deploy \
            --binary-name mybin \
            --dry \ 
            mybin-lambda
🔍 deployment for function `mybin`:
🏠 zip file located at /Users/nemo/mybin/target/lambda/mybin/bootstrap.zip
🛠️  binary last compiled 14 minutes ago
🏗️  architecture arm64
🗃️  files included in the zip file:
  - bootstrap
🛫  AWS SDK configuration:
  - region: us-east-2
🍿 function configuration:
  - timeout: None
  - memory: None
  - enable_function_url: false
  - disable_function_url: false
  - tracing: None
  - role: None
  - layer: None
  - runtime: "provided.al2023"
  - env_options: {} 

Activity

  1. calavera commented on Jul 10, 2025

    @calavera
    Collaborator

    This might be related to #864 . If you want to try to fix it, I really appreciate the contributions.

  2. nemosupremo commented on Jul 10, 2025

    @nemosupremo
    Author

    I’ve been trying to look into it - main hurdle is just trying to understand the code architecture. If you can point me to where the cargo metadata should be loaded I can take a stab at it

  3. calavera commented on Jul 10, 2025

    @calavera
    Collaborator

    Of course. Everything related to Cargo’s metadata should be in the cargo-lambda-metadata crate. You can probably start here:

    Thanks a lot for your help!

  4. nemosupremo commented on Jul 10, 2025

    @nemosupremo
    Author

    I see now that the cargo-lambda-metadata assumes that the function name is also the package name; so name is kind of overloaded here.

    Thoughts

    1. Override ConfigOptions.name to --binary-name
    2. Add a --package-name (or assume --binary-name is a package name), and add that to ConfigOptions. (e.g. name would be options.package_name.as_deref().or(options.name.as_deref()))
    3. Add a --function-name parameter (potentially more confusing)

    (1) would probably be the easiest, but I can only assume that will break things. (2) probably makes the most sense.

  5. github-actions commented on Jul 15, 2025

    @github-actions
    Contributor

    This issue has been automatically locked. Create a new discussion if you'd like to continue the conversation. https://github.com/cargo-lambda/cargo-lambda/discussions/new?category=general

  6. locked as resolved and limited conversation to collaborators on Jul 15, 2025
  7. calavera commented on Jul 18, 2025

    @calavera
    Collaborator

    Version 1.8.6 released with a fix for this issue: https://github.com/cargo-lambda/cargo-lambda/releases/tag/v1.8.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions