If I understand correctly, adding the following to distutils.cfg should stop easy_install from trying to zip eggs, which inevitably leads to the error: "ZIP does not support timestamps before 1980":
[easy_install]
zip_ok = 0
As we anyway use --always-unzip, we probably could use that. Though I don't know whether it would actually solve the problem.
Apart from that a solution is already in stdenv-updates: 6d928ab
The error occurs e.g. for git checkout, where the whole directory is copied into the store and all timestamps set to epoch 0, this is the equivalent to a tarball in the store. For building the package, the directory is copied into a temporary build directory and timestamps where preserved, that is not set to "now".
A temporary workaround is used by charon: https://github.com/NixOS/charon/blob/master/default.nix#L19
Ah ok, that would explain why I noticed the error when using fetchhg.
Can someone check if this is still an issue now that stdenv-updates is merged?
Closing, if problem repeats, open the issue again.
For those coming in from Google on this error, it's very possible there are in fact files that have corrupt touch dates older than 1980. This raises when the mtime
of a file in the packaging tree is older than 1980. This even happened for me when zip_safe was set to False
You can see if you have any of these files with: find . -mtime +13700 -ls
In my case, there were uglify.js node_modules with corrupt dates that I simply needed to exclude through my Manifest.in. Also see https://github.com/aws/aws-cli/issues/2639
I fixed this by invoking export SOURCE_DATE_EPOCH=315532800 # 1980
. My nix-shell
has a mkDerivation
, so I put it in its shellHook
.
I found this workaround in the Python docs. Certainly this is a ridiculous thing to have to do as an end user.
@matthew-piziak your export
suggestion worked. Many thanks!
Most helpful comment
I fixed this by invoking
export SOURCE_DATE_EPOCH=315532800 # 1980
. Mynix-shell
has amkDerivation
, so I put it in itsshellHook
.I found this workaround in the Python docs. Certainly this is a ridiculous thing to have to do as an end user.