-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
archive_file changes file permissions on Windows #58
Comments
I have a similar or the same issue.
The "my-src.js" file is a regular file in git:
On unix, the output of the "archive_file" is a zip containing a 644 / "-rw-r--r--" file:
On windows, the file permissions are different:
This causes Terraform to unnecessarily mark the Lambda as changed, as I am using "filebase64sha256" on the zip, which differs by this one byte. How can I persuade archive_file to generate a 644/"-rw-r--r--" file on Windows (or indeed a 666/"-rw-rw-rw-" file on Unix)? Thanks |
It looks like the code that handles this reads the file perms using Go's "os.stat" at archiver.go:28 and hands that file mode off directly to Go's zip.FileInfoHeader at zip_archiver.go:56. According to this blog, Go will always report either 666 or 444 file mode on Windows. Whereas the actual permissions on unix are typically 644. So without a windows-specific workaround to archive_file, I will need to arrange for my file to be 666 on unix to make my builds consistent cross-platform. |
It looks like git won't allow me to make the file 666 mode, only 644 or 755 (cite). |
The workaround in #90 has been released in terraform-provider-archive v2.2.0. If |
Thanks, that workaround fixes this for me! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
This is a re-opening of issue #10 .
This issue is still occurring on Windows. Within the ZIP file created by archive_file when running Terraform v0.12.18 with AWS provider v2.43 on Windows 10, the contained file has 666 permissions (no execute). Running the exact same Terraform plan with the same version on Linux results in the contained file having 777 permissions.
The text was updated successfully, but these errors were encountered: