Files mtime changes when TMPDIR is on another partition
- Dominant language
- PHP
- Stars
- 3.3k
- Forks
- 530
- Avg merge
- 6h 53m
- Merged PRs (30d)
- 13
Description
Hi,
We've faced a bug with files mtime was changed in ZIP archives to current system time. First Composer and Satis download packages, then unpack them via TMPDIR, then pack them back to the archive dist directory.
When TMPDIR is located on another partition, PHP move function copies the file (which is obvious), and it changes the modification time. This leads to different SHA1 hash compared to the original package, and it is new every time we perform purge/build sequence.
The workaround for this was to set TMPDIR environment variable for satis build command to a location on the same partition.
I'm not sure the code should be changed to also copy the file attributes, but perhaps this nuance should be mentioned in the documentation.
Contributor guide
Assessment
This issue has not been assessed yet.