composer / satis

Simple static Composer repository generator - For a full private Composer repo use Private Packagist
MIT License
3.15k stars 519 forks source link

Files mtime changes when TMPDIR is on another partition #340

Open boldhedgehog opened 8 years ago

boldhedgehog commented 8 years ago

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.

alcohol commented 8 years ago

Yeah I am not sure if I should mark this as a bug, or just consider it a shortcoming of the features/functionality provided by PHP, and accept that some things just are the way they are. As far as documentation goes, there virtually is none for Satis.

boldhedgehog commented 8 years ago

It would be appreciated by others facing this issue, if you would add this either to the documentation or FAQ.

alcohol commented 8 years ago

We have neither.