Skip to content
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

zstd 1.5.0 no longer preserves modification time #2739

Closed
0x9fff00 opened this issue Aug 3, 2021 · 1 comment
Closed

zstd 1.5.0 no longer preserves modification time #2739

0x9fff00 opened this issue Aug 3, 2021 · 1 comment
Assignees
Labels

Comments

@0x9fff00
Copy link

0x9fff00 commented Aug 3, 2021

Describe the bug
In zstd 1.4.9 and earlier, the modification time of a compressed file was the same as the uncompressed file, but in 1.5.0 this is no longer the case and the modification time is set to the compression time.

To Reproduce
Steps to reproduce the behavior:

  1. Create a file: touch testfile
  2. Compress it: zstd testfile
  3. Compare the modification times: stat testfile{,.zst}

Using zstd 1.5.0, testfile and testfile.zst have different modification times.

Expected behavior
The modification times would be the same, like in zstd 1.4.9. gzip, bzip2 and xz also have this behavior.

Desktop (please complete the following information):

  • OS: Arch Linux
  • Version: zstd 1.5.0
  • Compiler: gcc 11.1.0
  • Flags: CFLAGS="-march=native -mtune=native -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection", CXXFLAGS="$CFLAGS -Wp,-D_GLIBCXX_ASSERTIONS", LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now"
  • Build system: Makefile

Additional context
git bisect shows that b87f97b is the first commit with this issue. The associated pull request (#2525) only mentions file permissions and not modification times.

@terrelln
Copy link
Contributor

terrelln commented Aug 3, 2021

Thanks for the bug report!

Looks like we're missing a test case that checks that we don't change the mtime. We'll have to add that when we fix this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants