-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Description:
When you run sam build and sam package in two instances of the same projects with different absolute paths and upload to the same S3 bucket, the compiled binaries will be uploaded both times, even though the binaries are identical.
According to #2110 this has been fixed, but I can still reproduce the issue on Windows.
Steps to reproduce:
- Clone this repository into a directory on your local Windows machine.
cdinto the directory.- Run
sam build. - Run
sam package --s3-bucket YOUR_BUCKETNAME - Clone the same repository into a second directory on your local windows machine.
- Copy the second directory into a third directory using
xcopy seconddirectory thirddirectory /s /e. cdinto the second directory.- Run
sam build. - Run
sam package --s3-bucket YOUR_BUCKETNAME cdinto the third directory.- Run
sam build. - Run
sam package --s3-bucket YOUR_BUCKETNAME
Observed result:
The calculated hashes change, when the parent directory changes. This results in the compiled binaries being re-uploaded for every directory, although no files have been modified.
Expected result:
Hashes should not depend on the parent directory. Compiled binaries should only be uploaded, when they have been modified.
Additional environment details (Ex: Windows, Mac, Amazon Linux etc)
- OS: Windows 10 Pro Version 20H2 (Build 19042.1165)
sam --version: 1.31.0- AWS region: eu-central-1
Further notes:
I can imagine this is also the cause for the issue #2872, where running sam package in an ephemeral container results in the files being uploaded every time.