>From fc0bd3f4e8d83898e64fe8cae8c4c61defa7ba4d Mon Sep 17 00:00:00 2001 From: nixo Date: Sat, 16 May 2020 11:56:26 +0200 Subject: [PATCH 2/2] gnu: Add julia-deterministic. * gnu/packages/julia.scm (julia-deterministic): New variable. --- gnu/packages/julia.scm | 64 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/gnu/packages/julia.scm b/gnu/packages/julia.scm index 8db5e66131..0b4cb82966 100644 --- a/gnu/packages/julia.scm +++ b/gnu/packages/julia.scm @@ -493,3 +493,67 @@ computing environments. It provides a sophisticated compiler, distributed parallel execution, numerical accuracy, and an extensive mathematical function library.") (license license:expat))) + +;; Deterministic build of the julia executable +(define-public julia-deterministic + (package + (inherit julia) + (name "julia-deterministic") + (source + (origin + (inherit (package-source julia)) + ;; I wrote this patches to get a deterministic build. + ;; We need to discuss the best way to add them upstream. + (patches + (list + (origin ; timefuncs: support SOURCE_DATE_EPOCH for reproducible builds + (method url-fetch) + (uri "https://github.com/nico202/julia/commit/1c56fb0975c7701596b5bdc9ad4e716a3e2fcfc9.patch") + (sha256 (base32 "0zw5554s0k38kgq8bgyxcjflrbjk6xqfrh8kidwsh6zvmpkmgnf5"))) + (origin ; don't use jl_hrtime to store module build_id + (method url-fetch) + (uri "https://github.com/nico202/julia/commit/c13691df6747849dec8f654180dabc55e8044a64.patch") + (sha256 (base32 "0n7mnbwzr411j9z557jrcib5vr8v8mgqbj5xdrxv7b2n0mrfcp5d"))) + (origin ; contrib: generate_precompile: do not use random temporary files + (method url-fetch) + (uri "https://github.com/nico202/julia/commit/ae2929a5d3d1f724b421a7f04b6c7b84c9987583.patch") + (sha256 (base32 "00vpj4m9f4wzfkvd4flarki58jbfhi0zngw35zrhaph53mfi6y27"))) + ;; (origin ; base: Base: deterministic random + ;; (method url-fetch) + ;; (uri "https://github.com/nico202/julia/commit/49a4edc26e9db110586c590c17df276301c344a7.patch") + ;; (sha256 (base32 "16p4axwr3shf2jp6hq8dk19c9s1l667ki5a8bv3dbv5b0ji9w7ra"))) + (origin ; remove some use of time() + (method url-fetch) + (uri "https://github.com/nico202/julia/commit/5561587256b29761fe3a7d8fac169b4305afa240.patch") + (sha256 (base32 "0s9b90x61jjrc057myqdck52yj4lb4xlm7ypjn5qvpypnxrbkz6b"))) + (origin ; contrib: generate_precompile: bare minimum + (method url-fetch) + (uri "https://github.com/nico202/julia/commit/5cd454695e7f6a7e448c19d8f9b2d41fcdeb812e.patch") + (sha256 (base32 "0c9pz9ligd6wfhvra5wn7k2k2qr1zw3x67b2y9dhf108xf4z79sm"))) + (origin ; src: codegen: don't dump time to precompile stream + (method url-fetch) + (uri "https://github.com/nico202/julia/commit/5445b5dc2ea30f2f39acb0fb45ba552122a7e6f5.patch") + (sha256 (base32 "0sa1a73ajk8cm3a5l25hyc2bg8kq6l16r2vvdn2qbcnpnjff9skx"))) + (origin ; do not import repl + (method url-fetch) + (uri "https://github.com/nico202/julia/commit/9a45d44ba387d7386b14abfe76e18f1f000eecc2.patch") + (sha256 (base32 "0k6yyxr8rd3dcj8rh32pjzlyc0izvi34xglmxsdhqq6q3j0rf0wb"))) + (origin ; no more interactive + (method url-fetch) + (uri "https://github.com/nico202/julia/commit/e78f791e048ed5192d6cb3166fe089207e2e994d.patch") + (sha256 (base32 "1bvgiishhc0csypymknff46cik5dnanyx4q5kgipjk0a47wi80x2"))) + (origin ; generate precompile: sort modules + (method url-fetch) + (uri "https://github.com/nico202/julia/commit/e5359e1ce383d549db87659ecd72dcb615eb649d.patch") + (sha256 (base32 "0slw4jczba88hpqyd0gq9x7jnw75yvq8wmbrl7dd8f83jmci8lzz"))))))) + (arguments + (substitute-keyword-arguments (package-arguments julia) + ((#:phases phases '%standard-phases) + `(modify-phases ,phases + (delete 'check) + (add-after 'unpack 'generic-target + (lambda _ + ;; Not sure is needed/is the best target + (substitute* "contrib/generate_precompile.jl" + (("native") "generic")) + #t)))))))) -- 2.26.2