3 ms·
but why should different timestamps on the filesystem cause different binary?
by 400thecat 5y ago
but why should different timestamps on the filesystem cause different binary?
- icegreentea2 5y agoDon't think binaries, think build outputs. Imagine part of your build is generating a bunch of different files, and then packaging into an archive file, or into your installer bundle (or whatever). If your archive preserves file timestamps, then your end up with different archive files.
- comex 5y agoThere’s a long list of tools that follow a general pattern: they take an input file and produce an output file, but the output file doesn’t just depend on the contents of the input file; it also embeds its modification time somewhere. Sometimes the goal is to be able to automatically regenerate the output if the input changes, by comparing timestamps. Sometimes it’s just intended as general-purpose metadata. Debian’s reproducible builds wiki page has many examples: https://wiki.debian.org/ReproducibleBuilds/Howto#Files_in_data.tar_contain_timestamps https://wiki.debian.org/ReproducibleBuilds/Howto#Files_in_da... Notably, this affects archivers such as tar and zip, but there’s also a long tail of application-specific tools.
- electroly 5y agoOP misspoke; the timestamp in the filesystem metadata doesn't matter for this. This is only about timestamps embedded in the binary itself.
- michaelt 5y agoPlenty of build outputs are compressed collections of files. Maybe you want to distribute a .jar, .deb, .whl, or docker image?