about summary refs log tree commit diff
path: root/pkgs/development/compilers
diff options
context:
space:
mode:
authorTom McLaughlin <pyro777@gmail.com>2018-12-12 13:52:03 -0800
committerTom McLaughlin <pyro777@gmail.com>2019-04-23 22:42:03 -0700
commit9fa09748565e917f80db47006ecec48489cdb603 (patch)
tree0a0c335c68c3bd56ffcc746eb6b58f30abbe7acf /pkgs/development/compilers
parent0620e0fdbf4d79df771afd28f741b2159f381d2b (diff)
downloadnixlib-9fa09748565e917f80db47006ecec48489cdb603.tar
nixlib-9fa09748565e917f80db47006ecec48489cdb603.tar.gz
nixlib-9fa09748565e917f80db47006ecec48489cdb603.tar.bz2
nixlib-9fa09748565e917f80db47006ecec48489cdb603.tar.lz
nixlib-9fa09748565e917f80db47006ecec48489cdb603.tar.xz
nixlib-9fa09748565e917f80db47006ecec48489cdb603.tar.zst
nixlib-9fa09748565e917f80db47006ecec48489cdb603.zip
Patch Julia to not recompile packages when mtime is 1
Diffstat (limited to 'pkgs/development/compilers')
-rw-r--r--pkgs/development/compilers/julia/allow_nix_mtime.patch25
-rw-r--r--pkgs/development/compilers/julia/shared.nix6
2 files changed, 31 insertions, 0 deletions
diff --git a/pkgs/development/compilers/julia/allow_nix_mtime.patch b/pkgs/development/compilers/julia/allow_nix_mtime.patch
new file mode 100644
index 000000000000..e4a164cfa1ad
--- /dev/null
+++ b/pkgs/development/compilers/julia/allow_nix_mtime.patch
@@ -0,0 +1,25 @@
+From f79775378a9eeec5b99f18cc95735b12d172aba3 Mon Sep 17 00:00:00 2001
+From: Tom McLaughlin <pyro777@gmail.com>
+Date: Wed, 12 Dec 2018 13:01:32 -0800
+Subject: [PATCH] Patch to make work better with nix
+
+---
+ base/loading.jl | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/base/loading.jl b/base/loading.jl
+index 51201b98b6..b40c0690f6 100644
+--- a/base/loading.jl
++++ b/base/loading.jl
+@@ -1384,7 +1384,7 @@ function stale_cachefile(modpath::String, cachefile::String)
+                 # Issue #13606: compensate for Docker images rounding mtimes
+                 # Issue #20837: compensate for GlusterFS truncating mtimes to microseconds
+                 ftime = mtime(f)
+-                if ftime != ftime_req && ftime != floor(ftime_req) && ftime != trunc(ftime_req, digits=6)
++                if ftime != ftime_req && ftime != floor(ftime_req) && ftime != trunc(ftime_req, digits=6) && ftime != 1.0
+                     @debug "Rejecting stale cache file $cachefile (mtime $ftime_req) because file $f (mtime $ftime) has changed"
+                     return true
+                 end
+-- 
+2.17.1
+
diff --git a/pkgs/development/compilers/julia/shared.nix b/pkgs/development/compilers/julia/shared.nix
index ee08703e4c7e..ffa5e3ba55d0 100644
--- a/pkgs/development/compilers/julia/shared.nix
+++ b/pkgs/development/compilers/julia/shared.nix
@@ -97,6 +97,12 @@ stdenv.mkDerivation rec {
 
   patches = [
     ./0001.1-use-system-utf8proc.patch
+
+    # Julia recompiles a precompiled file if the mtime stored *in* the
+    # .ji file differs from the mtime of the .ji file.  This
+    # doesn't work in Nix because Nix changes the mtime of files in
+    # the Nix store to 1. So patch Julia to accept mtimes of 1.
+    ./allow_nix_mtime.patch
   ];
 
   postPatch = ''