glob icon indicating copy to clipboard operation
glob copied to clipboard

Glob-0.10.0 release tarball has strange file permissions

Open peti opened this issue 5 years ago • 4 comments

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

peti avatar Dec 21 '18 10:12 peti

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.

Deewiant avatar Dec 21 '18 21:12 Deewiant

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

peti avatar Dec 22 '18 20:12 peti

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. :)

juhp avatar Apr 14 '20 05:04 juhp

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.

Deewiant avatar Apr 14 '20 17:04 Deewiant