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

Should cabal.mkDerivation reset modification times? #1280

Closed
ocharles opened this issue Nov 26, 2013 · 8 comments
Closed

Should cabal.mkDerivation reset modification times? #1280

ocharles opened this issue Nov 26, 2013 · 8 comments
Assignees

Comments

@ocharles
Copy link
Contributor

This is a bit of a stab in the dark, so bear with me. I'm trying to install indexed-free at the moment, which appears to incorrectly packed by the maintainer. When I try and nix-build it, I see the following output:

building /nix/store/rqkikv14vsi5gi3bcxqb84v67a543xcq-haskell-indexed-free-ghc7.6.3-0.3.0
unpacking sources
unpacking source archive /nix/store/ig6sad3xx64c284dnlvy2b2rljy8sf2n-indexed-free-0.3.0.tar.gz
tar: indexed-free-0.3.0/Setup.hs: time stamp 2022-10-02 15:39:51 is 279245257.831154454 s in the future
tar: indexed-free-0.3.0/LICENSE: time stamp 2022-10-02 04:31:59 is 279205185.830811917 s in the future
tar: indexed-free-0.3.0/indexed-free.cabal: time stamp 2022-10-03 02:47:03 is 279285289.830739189 s in the future
tar: indexed-free-0.3.0/Control/MonadPlus/Indexed/Free.hs: time stamp 2022-10-01 17:25:03 is 279165169.830552026 s in the future
tar: indexed-free-0.3.0/Control/MonadPlus/Indexed: time stamp 2022-10-01 20:11:50 is 279175176.830515135 s in the future
tar: indexed-free-0.3.0/Control/MonadPlus: time stamp 2022-09-29 20:57:22 is 279005108.830497749 s in the future
tar: indexed-free-0.3.0/Control/Monad/Indexed/Free.hs: time stamp 2022-09-30 05:16:45 is 279035071.830398112 s in the future
tar: indexed-free-0.3.0/Control/Monad/Indexed/Trans/Free.hs: time stamp 2022-10-01 06:17:51 is 279125137.830292212 s in the future
tar: indexed-free-0.3.0/Control/Monad/Indexed/Trans: time stamp 2022-10-01 09:05:52 is 279135218.830250152 s in the future
tar: indexed-free-0.3.0/Control/Monad/Indexed/Free/Class.hs: time stamp 2022-09-30 16:24:03 is 279075109.830143956 s in the future
tar: indexed-free-0.3.0/Control/Monad/Indexed/Free: time stamp 2022-09-30 19:10:44 is 279085110.830058621 s in the future
tar: indexed-free-0.3.0/Control/Monad/Indexed: time stamp 2022-09-30 08:04:46 is 279045152.83003403 s in the future
tar: indexed-free-0.3.0/Control/Monad: time stamp 2022-09-29 09:49:19 is 278965025.830008772 s in the future
tar: indexed-free-0.3.0/Control: time stamp 2022-09-29 18:10:41 is 278995107.829983749 s in the future
tar: indexed-free-0.3.0: time stamp 2022-10-03 05:32:59 is 279295245.829958882 s in the future
source root is indexed-free-0.3.0
patching sources
configuring
[1 of 1] Compiling Main             ( Setup.hs, Setup.o )
Linking Setup ...
configure flags: --enable-split-objs --disable-library-profiling --disable-shared --disable-executable-dynamic --enable-tests 
Configuring indexed-free-0.3.0...
Dependency base ==4.*: using base-4.6.0.1
Dependency indexed <0.2: using indexed-0.1
Using Cabal-1.16.0 compiled by ghc-7.6
Using compiler: ghc-7.6.3
Using install prefix:
/nix/store/rqkikv14vsi5gi3bcxqb84v67a543xcq-haskell-indexed-free-ghc7.6.3-0.3.0
Binaries installed in:
/nix/store/rqkikv14vsi5gi3bcxqb84v67a543xcq-haskell-indexed-free-ghc7.6.3-0.3.0/bin
Libraries installed in:
/nix/store/rqkikv14vsi5gi3bcxqb84v67a543xcq-haskell-indexed-free-ghc7.6.3-0.3.0/lib/ghc-7.6.3/indexed-free-0.3.0
Private binaries installed in:
/nix/store/rqkikv14vsi5gi3bcxqb84v67a543xcq-haskell-indexed-free-ghc7.6.3-0.3.0/libexec
Data files installed in:
/nix/store/rqkikv14vsi5gi3bcxqb84v67a543xcq-haskell-indexed-free-ghc7.6.3-0.3.0/share/indexed-free-0.3.0
Documentation installed in:
/nix/store/rqkikv14vsi5gi3bcxqb84v67a543xcq-haskell-indexed-free-ghc7.6.3-0.3.0/share/doc/indexed-free-0.3.0
No alex found
Using ar found on system at:
/nix/store/46595bx2k3yjznihv898592qnzirbvgm-binutils-2.23.1/bin/ar
No c2hs found
No cpphs found
No ffihugs found
Using gcc version 4.6.3 found on system at:
/nix/store/imgyva7wqc81w91q1agfrqk77b827hqv-gcc-wrapper-4.6.3/bin/gcc
Using ghc version 7.6.3 found on system at:
/nix/store/8jahygmb98mpxzziwf3facnp3z3v1m2h-ghc-7.6.3-wrapper/bin/ghc
Using ghc-pkg version 7.6.3 found on system at:
/nix/store/8jahygmb98mpxzziwf3facnp3z3v1m2h-ghc-7.6.3-wrapper/bin/ghc-pkg
No greencard found
Using haddock version 2.13.2 found on system at:
/nix/store/p01hdsfn3hhkwynwa32zi2y01sch2pa7-ghc-7.6.3/bin/haddock
No happy found
No hmake found
Using hpc version 0.6 found on system at:
/nix/store/8jahygmb98mpxzziwf3facnp3z3v1m2h-ghc-7.6.3-wrapper/bin/hpc
Using hsc2hs version 0.67 found on system at:
/nix/store/8jahygmb98mpxzziwf3facnp3z3v1m2h-ghc-7.6.3-wrapper/bin/hsc2hs
No hscolour found
No hugs found
No jhc found
Using ld found on system at:
/nix/store/imgyva7wqc81w91q1agfrqk77b827hqv-gcc-wrapper-4.6.3/bin/ld
No lhc found
No lhc-pkg found
No nhc98 found
No pkg-config found
Using ranlib found on system at:
/nix/store/46595bx2k3yjznihv898592qnzirbvgm-binutils-2.23.1/bin/ranlib
Using strip found on system at:
/nix/store/46595bx2k3yjznihv898592qnzirbvgm-binutils-2.23.1/bin/strip
Using tar found on system at:
/nix/store/db7c4cg09100f927jw73qrg5nnvqpvc9-gnutar-1.26/bin/tar
No uhc found
building
./indexed-free.cabal has been changed. Re-configuring with most recently used
options. If this fails, please run configure manually.
Configuring indexed-free-0.3.0...
Building indexed-free-0.3.0...
Preprocessing library indexed-free-0.3.0...
[1 of 4] Compiling Control.Monad.Indexed.Free.Class ( Control/Monad/Indexed/Free/Class.hs, dist/build/Control/Monad/Indexed/Free/Class.o )
[2 of 4] Compiling Control.Monad.Indexed.Trans.Free ( Control/Monad/Indexed/Trans/Free.hs, dist/build/Control/Monad/Indexed/Trans/Free.o )
[3 of 4] Compiling Control.MonadPlus.Indexed.Free ( Control/MonadPlus/Indexed/Free.hs, dist/build/Control/MonadPlus/Indexed/Free.o )
[4 of 4] Compiling Control.Monad.Indexed.Free ( Control/Monad/Indexed/Free.hs, dist/build/Control/Monad/Indexed/Free.o )
In-place registering indexed-free-0.3.0...
./indexed-free.cabal has been changed. Re-configuring with most recently used
options. If this fails, please run configure manually.
Configuring indexed-free-0.3.0...
Setup: Use of GHC's environment variable GHC_PACKAGE_PATH is incompatible with
Cabal. Use the flag --package-db to specify a package database (it can be used
multiple times).
builder for `/nix/store/zxbq7chrr3c0r262ag8ba4axa427hfm3-haskell-indexed-free-ghc7.6.3-0.3.0.drv' failed with exit code 1

However, if I jailbreak = true on this expression, that has the effect of changing the modification timestamp on indexed-free.cabal and the build succeeds. I believe the above happens because the modification timestamp is in the future, so Cabal tries to automatically reconfigure at every step - including after we have set GHC_PACKAGE_PATH.

Should we change our builder to touch files to avoid this problem?

@peti
Copy link
Member

peti commented Nov 26, 2013

Catching this problem in the generic builder feels like overkill to me. I would just report the issue upstream. If upstream fixes the tarball, everything is fine. If upstream turns out to be unresponsive, then I'd rather add an postUnpack hook to the expression for this particular package.

Arguably, it might be a good idea to pass the --touch flag to tar in the generic builder stdenv, though, so that our builds never extract the time stamp information set in the source tarball. One problem with this might be that not all variants of tar support that flag, though.

@ocharles
Copy link
Contributor Author

Ok. I've already reported it upstream. I did mention it in #hackage and @dcoutts told me to file a ticket - but you've been me to it :)

@ocharles
Copy link
Contributor Author

In regards to --touch it sounds like a worth while step to me. You mention that not all variants of tar support this flag, but don't we build tar ourselves?

@peti
Copy link
Member

peti commented Nov 26, 2013

Unfortunately, we use many native tools on platforms like FreeBSD and
Darwin. That should be remedied, really, but no-one has expressed an
interest to work on this issue yet.

Related: #874

@ghost ghost assigned nbp Jan 12, 2014
@shlevy
Copy link
Member

shlevy commented Apr 5, 2014

Is there anything more to do on this? It seems like the few cases where this is an issue are best addressed by fixing it upstream.

@ocharles
Copy link
Contributor Author

ocharles commented Apr 5, 2014

I still think cabal.mkDerivation should be resilient to this upstream problem - is there any reason we can't do it, at least on platforms we know can do tar --touch?

@peti
Copy link
Member

peti commented Apr 5, 2014

If we do this, then broken release tarballs go undetected. I consider it a feature that these builds fail, not a bug.

@ocharles
Copy link
Contributor Author

ocharles commented Apr 5, 2014

There's your answer then @shlevy :)

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

No branches or pull requests

4 participants