Deewiant / glob

Haskell library for glob matching
https://deewiant.iki.fi/projects/glob/
Other
25 stars 8 forks source link

Glob-0.10.0 release tarball has strange file permissions #31

Open peti opened 5 years ago

peti commented 5 years ago

I noticed the following issues with the latest Hackage release tarball:

  1. Files don't seem to have a valid modification / creation date.
  2. Various *.txt files have an executable bit set.

Is that intentional?

$ tar tfv Glob-0.10.0.tar.gz
drwxr-xr-x 0/0               0 1970-01-01 01:00 Glob-0.10.0/
-rwxr-xr-x 0/0            9294 1970-01-01 01:00 Glob-0.10.0/CHANGELOG.txt
-rwxr-xr-x 0/0             112 1970-01-01 01:00 Glob-0.10.0/CREDITS.txt
-rw-r--r-- 0/0            2933 1970-01-01 01:00 Glob-0.10.0/Glob.cabal
-rw-r--r-- 0/0            1651 1970-01-01 01:00 Glob-0.10.0/LICENSE.txt
-rwxr-xr-x 0/0             746 1970-01-01 01:00 Glob-0.10.0/README.txt
-rw-r--r-- 0/0              46 1970-01-01 01:00 Glob-0.10.0/Setup.hs
drwxr-xr-x 0/0               0 1970-01-01 01:00 Glob-0.10.0/System/FilePath/
-rw-r--r-- 0/0            2378 1970-01-01 01:00 Glob-0.10.0/System/FilePath/Glob.hs
drwxr-xr-x 0/0               0 1970-01-01 01:00 Glob-0.10.0/System/FilePath/Glob/
-rw-r--r-- 0/0           25538 1970-01-01 01:00 Glob-0.10.0/System/FilePath/Glob/Base.hs
-rw-r--r-- 0/0           16160 1970-01-01 01:00 Glob-0.10.0/System/FilePath/Glob/Directory.hs
-rw-r--r-- 0/0            7260 1970-01-01 01:00 Glob-0.10.0/System/FilePath/Glob/Match.hs
-rw-r--r-- 0/0            2183 1970-01-01 01:00 Glob-0.10.0/System/FilePath/Glob/Primitive.hs
-rw-r--r-- 0/0            1477 1970-01-01 01:00 Glob-0.10.0/System/FilePath/Glob/Simplify.hs
-rw-r--r-- 0/0            4911 1970-01-01 01:00 Glob-0.10.0/System/FilePath/Glob/Utils.hs
drwxr-xr-x 0/0               0 1970-01-01 01:00 Glob-0.10.0/tests/
-rw-r--r-- 0/0             890 1970-01-01 01:00 Glob-0.10.0/tests/Main.hs
drwxr-xr-x 0/0               0 1970-01-01 01:00 Glob-0.10.0/tests/Tests/
-rw-r--r-- 0/0            2462 1970-01-01 01:00 Glob-0.10.0/tests/Tests/Base.hs
-rw-r--r-- 0/0            1221 1970-01-01 01:00 Glob-0.10.0/tests/Tests/Compiler.hs
-rw-r--r-- 0/0            5553 1970-01-01 01:00 Glob-0.10.0/tests/Tests/Directory.hs
-rw-r--r-- 0/0            2290 1970-01-01 01:00 Glob-0.10.0/tests/Tests/Instances.hs
-rw-r--r-- 0/0            2702 1970-01-01 01:00 Glob-0.10.0/tests/Tests/Matcher.hs
-rw-r--r-- 0/0            1724 1970-01-01 01:00 Glob-0.10.0/tests/Tests/Optimizer.hs
-rw-r--r-- 0/0            5534 1970-01-01 01:00 Glob-0.10.0/tests/Tests/Regression.hs
-rw-r--r-- 0/0            1034 1970-01-01 01:00 Glob-0.10.0/tests/Tests/Simplifier.hs
-rw-r--r-- 0/0            1632 1970-01-01 01:00 Glob-0.10.0/tests/Tests/Utils.hs
Deewiant commented 5 years ago

This might be the first tarball I created using cabal new-sdist instead of cabal sdist.

The timestamps are probably a reproducibility feature — as https://www.haskell.org/cabal/users-guide/nix-local-build.html#cabal-new-sdist states:

These archives are stable and two archives of the same format built from the same source will hash to the same value.

I don't know why the text files are made executable though. They certainly aren't in my source directory.

peti commented 5 years ago

I opened https://github.com/haskell/cabal/issues/5813 about this issue. Let's see what the cabal gurus think about this.

juhp commented 4 years ago

BTW I was trying to reproduce this for other projects and so far from my limited testing this happens only(?) with Extra-Source-Files but not Extra-Doc-Files. I forget when exactly the latter was introduced but I think it was well before Cabal-2 anyway... and I reckon all the Glob Extra-Source-Files are actually Extra-Doc-Files. :)

Deewiant commented 4 years ago

Apparently extra-doc-files was introduced in 1.20 — according to the changelog at https://github.com/haskell/cabal/blob/master/Cabal/ChangeLog.md#12000-johan-tibell-april-2014 at least, although the docs at https://www.haskell.org/cabal/users-guide/developing-packages.html#pkg-field-extra-doc-files say it's in since 1.18.

This seems to have grown organically in Glob.cabal anyway, since originally only the tests were added as extras and the other documentation came only later. My bad for not realizing the more suitable field at the time, I guess.