Skip to content

--output-format zip zips up all binaries, not just those built in this invocation. #931

Description

@honestlysamuk

My workspace has 5 lambdas in it (pig, duck, goose, cow, farmer). 4 of them require the following configuration to be built:
--arm64
--output-format zip

one of them (farmer) requires
--arm64
--output-format zip
--include tractor

When running
cargo lambda build -p duck -p pig -p goose -p cow --arm64 --output-format zip
and then
cargo lambda build -p farmer --arm64 --output-format zip --include tractor

the resulting zips all contain tractor.

When run in the opposite order, none of them do.

I have attempted the following:
cargo lambda build -p duck -p pig -p goose -p cow -p farmer --arm64 --output-format zip

and added package configuration include = ["tractor"] for just the farmer build to its cargo.toml, but it seems that when more than one package is provided, the package-specific config is ignored.

The workaround appears to be to use a different --lambda-dir for each invocation, since all zips get overwritten on each invocation, regardless of the packages passed in. Is that right? Is it expected?

Thank you for the effort on the tool, it is really excellent.

EDIT:
I have found the issue. --package does accurately build only the specified binaries, but the --output-format zip functionality iterates over all constructed binaries, rather than all constructed binaries specified in this function call. The last call to cargo lambda build --output-format zip determines the content of the zip files for all binaries built in that target directory, even those binaries built in previous invocations.

The actual workaround is to remove the binaries after invoking the cargo lambda build command (but keep the zips) so that the next call, building a different binary, won't zip them up.

Activity

  1. changed the title [-]--include issue. Is this expected behaviour?[/-] [+]--output-format zip zips up all binaries, not just those built in this invocation.[/+] on Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions