question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dotnet lambda package is not reproducible

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
rittnejecommented, Aug 4, 2022

Regardless of whether you want to consider it a bug or a feature request, the problem is that dotnet lambda package is currently incompatible with cdk. And it is incompatible because it does not allow for byte-for-byte reproducible builds (hence the issue title).

0reactions
Dreamescapercommented, Nov 1, 2022
Read more comments on GitHub >

github_iconTop Results From Across the Web

c# - .NET Binaries Missing AWS Lambda
In my case, I use Upload from - .zip features of Lambda. ... That's created an issue. When you upload .zip files, make...
Read more >
Error deploying c# .net core aws lambda function
I am trying to deploy a lambda function using .NET Core CLI and am not able to deploy the function. I'm not really...
Read more >
Debugging .NET Core AWS Lambda functions using the ...
The best practice is to write repeatable and automated tests to ensure that your functions stay correct as you make changes to them...
Read more >
Grinding by Hand: How to Manually Build an ASP.NET Core ...
The package Amazon.Lambda.AspNetCoreServer, along with its dependencies, allows you to host an ASP.NET Core application as a Lambda function ...
Read more >
Untitled
Dotnet lambda package not working dotnet-lambda tool is not auto installed · Issue #259 - GitHub Building serverless .NET applications on AWS Lambda...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found