Skip to content
Snippets Groups Projects
Unverified Commit 248c8c17 authored by quasicomputational's avatar quasicomputational Committed by GitHub
Browse files

new-sdist: Use a Windows-safe file modification time. (#5611)

Using the Unix epoch is causing problems on Windows because it's
before MS-DOS's epoch of 1980-01-01. Picking a different, memorable
one ought to solve that.

Closes #5596.
parent 62f74dfe
No related branches found
No related tags found
No related merge requests found
......@@ -271,7 +271,13 @@ packageToSdist verbosity projectRootDir format outputFile pkg = do
where
(first, rest) = BSL.splitAt 9 bs
rest' = BSL.tail rest
write . normalize . GZip.compress . Tar.write $ entries
-- The Unix epoch, which is the default value, is
-- unsuitable because it causes unpacking problems on
-- Windows; we need a post-1980 date. One gigasecond
-- after the epoch is during 2001-09-09, so that does
-- nicely. See #5596.
setModTime entry = entry { Tar.entryTime = 1000000000 }
write . normalize . GZip.compress . Tar.write $ fmap setModTime entries
when (outputFile /= "-") $
notice verbosity $ "Wrote tarball sdist to " ++ outputFile ++ "\n"
Archive ZipFormat -> do
......
......@@ -3,6 +3,11 @@
2.6.0.0 (current development version)
* New solver flag: '--reject-unconstrained-dependencies'. (#2568)
2.4.0.1
* 'new-sdist' now generates tarballs with file modification
times from a date in 2001. Using the Unix epoch caused
problems on Windows. (#5596)
2.4.0.0 Mikhail Glushenkov <mikhail.glushenkov@gmail.com> September 2018
* Bugfix: "cabal new-build --ghc-option '--bogus' --ghc-option '-O1'"
no longer ignores all arguments except the last one (#5512).
......
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment