alexcrichton / tar-rs

Tar file reading/writing for Rust
https://docs.rs/tar
Apache License 2.0
616 stars 178 forks source link

HeaderMode::Deterministic differs in behaviour on Unix and Windows platforms #341

Closed abizjak closed 1 month ago

abizjak commented 9 months ago

On Windows the mtime is set to the dummy value of https://github.com/alexcrichton/tar-rs/blob/master/src/header.rs#L828

                self.set_mtime(123456789); // see above in unix

but on Unix it is set to https://github.com/alexcrichton/tar-rs/blob/master/src/header.rs#L760

                // We could in theory set the mtime to zero here, but not all
                // tools seem to behave well when ingesting files with a 0
                // timestamp. For example rust-lang/cargo#9512 shows that lldb
                // doesn't ingest files with a zero timestamp correctly.
                //
                // We just need things to be deterministic here so just pick
                // something that isn't zero. This time, chosen after careful
                // deliberation, corresponds to Jul 23, 2006 -- the date of the
                // first commit for what would become Rust.
                self.set_mtime(1153704088);

I don't see why these should be different, and it causes an annoyance in one of our use-cases.

Is there a reason why these two dummy values should be different?