Skip to content

dotnet lambda package is not reproducible #232

@rittneje

Description

@rittneje

Describe the bug

Because dotnet lambda package does not zero out the mtimes of the files in the zip, the zip file itself constantly changes on every build. This means that even rerunning a build of the same exact commit will lead to a cdk diff.

Expected Behavior

dotnet lambda package should produce identical results given identical inputs.

Current Behavior

The original mtimes are preserved, so there is always a diff.

Reproduction Steps

  1. Run dotnet lambda package.
  2. Use cdk deploy to deploy a stack with that lambda function.
  3. Run dotnet lambda package again.
  4. Run cdk diff.

Possible Solution

Set all mtimes to zero (or provide a flag for this).

Additional Information/Context

No response

Targeted .NET platform

.NET Core 3.1

CLI extension version

amazon.lambda.tools 4.0.0 dotnet-lambda

Environment details (OS name and version, etc.)

Debian

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions