git.iko.soy/typeable/nixpkgs
on master help sign in
julia: init julia_10-bin at 1.0.5

Almost as clean as it could be, but was forced to set `LD_LIBRARY_PATH` to work around a `Libdl` failure that is unique to v1.0.x.

commit8949ae188a04bee92b57778ad4d94948fd4b4b0b authorPontus Stenetorp <pontus@stenetorp.se> dateTue 27 Apr 2021, 14:39 (6 years ago) parent351f911
3 files changed+163−1
pkgs/development/compilers/julia/1.0-bin.nix+72 pkgs/development/compilers/julia/patches/1.0-bin/0002-nix-Skip-tests-that-require-network-access.patch+87 pkgs/top-level/all-packages.nix+4−1
pkgs/development/compilers/julia/1.0-bin.nixnew file+72
@@ -0,0 +1,72 @@
1+{ autoPatchelfHook, fetchurl, lib, makeWrapper, openssl, stdenv }:
2+
3+stdenv.mkDerivation rec {
4+ pname = "julia-bin";
5+ version = "1.0.5";
6+
7+ src = {
8+ x86_64-linux = fetchurl {
9+ url = "https://julialang-s3.julialang.org/bin/linux/x64/${lib.versions.majorMinor version}/julia-${version}-linux-x86_64.tar.gz";
10+ sha256 = "00vbszpjmz47nqy19v83xa463ajhzwanjyg5mvcfp9kvfw9xdvcx";
11+ };
12+ }.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
13+
14+ # Julia’s source files are in different locations for source and binary
15+ # releases. Thus we temporarily create symlinks to allow us to share patches
16+ # with source releases.
17+ prePatch = ''
18+ ln -s share/julia/stdlib/v${lib.versions.majorMinor version} stdlib
19+ ln -s share/julia/test
20+ '';
21+ patches = [
22+ # Source release Nix patch(es) relevant for binary releases as well.
23+ ./patches/1.0-bin/0002-nix-Skip-tests-that-require-network-access.patch
24+ ];
25+ postPatch = ''
26+ # Revert symlink hack.
27+ rm stdlib test
28+ '';
29+
30+ buildInputs = [ makeWrapper ];
31+ nativeBuildInputs = [ autoPatchelfHook ];
32+
33+ installPhase = ''
34+ runHook preInstall
35+ cp -r . $out
36+ # Setting `LD_LIBRARY_PATH` resolves `Libdl` failures. Not sure why this is
37+ # only necessary on v1.0.x and a cleaner solution is welcome, but after
38+ # staring at `strace` for a few hours this is as clean as I could make it.
39+ wrapProgram $out/bin/julia \
40+ --suffix LD_LIBRARY_PATH : $out/lib
41+ runHook postInstall
42+ '';
43+
44+ # Breaks backtraces, etc.
45+ dontStrip = true;
46+
47+ doInstallCheck = true;
48+ installCheckInputs = [ openssl ];
49+ preInstallCheck = ''
50+ # Some tests require read/write access to $HOME.
51+ export HOME="$TMPDIR"
52+ '';
53+ installCheckPhase = ''
54+ runHook preInstallCheck
55+ # Command lifted from `test/Makefile`.
56+ $out/bin/julia \
57+ --check-bounds=yes \
58+ --startup-file=no \
59+ --depwarn=error \
60+ $out/share/julia/test/runtests.jl
61+ runHook postInstallCheck
62+ '';
63+
64+ meta = {
65+ description = "High-level, high-performance dynamic language for technical computing";
66+ homepage = "https://julialang.org";
67+ # Bundled and linked with various GPL code, although Julia itself is MIT.
68+ license = lib.licenses.gpl2Plus;
69+ maintainers = with lib.maintainers; [ ninjin raskin ];
70+ platforms = [ "x86_64-linux" ];
71+ };
72+}
pkgs/development/compilers/julia/patches/1.0-bin/0002-nix-Skip-tests-that-require-network-access.patchnew file+87
@@ -0,0 +1,87 @@
1+From 4954b99efae367da49412edd31a7bd832ec62c69 Mon Sep 17 00:00:00 2001
2+From: Pontus Stenetorp <pontus@stenetorp.se>
3+Date: Mon, 15 Mar 2021 05:55:18 +0000
4+Subject: [PATCH 2/3] nix: Skip tests that require network access
5+
6+Necessary as the Nix build sandbox does not permit network access.
7+---
8+ stdlib/Sockets/test/runtests.jl | 40 ++++++++++++++++-----------------
9+ test/file.jl | 4 ++--
10+ 2 files changed, 22 insertions(+), 22 deletions(-)
11+
12+diff --git a/stdlib/Sockets/test/runtests.jl b/stdlib/Sockets/test/runtests.jl
13+index 6145f87616..9cc7a001e5 100644
14+--- a/stdlib/Sockets/test/runtests.jl
15++++ b/stdlib/Sockets/test/runtests.jl
16+@@ -151,33 +151,33 @@ defaultport = rand(2000:4000)
17+ end
18+
19+ @testset "getnameinfo on some unroutable IP addresses (RFC 5737)" begin
20+- @test getnameinfo(ip"192.0.2.1") == "192.0.2.1"
21+- @test getnameinfo(ip"198.51.100.1") == "198.51.100.1"
22+- @test getnameinfo(ip"203.0.113.1") == "203.0.113.1"
23+- @test getnameinfo(ip"0.1.1.1") == "0.1.1.1"
24+- @test getnameinfo(ip"::ffff:0.1.1.1") == "::ffff:0.1.1.1"
25+- @test getnameinfo(ip"::ffff:192.0.2.1") == "::ffff:192.0.2.1"
26+- @test getnameinfo(ip"2001:db8::1") == "2001:db8::1"
27++ @test_skip getnameinfo(ip"192.0.2.1") == "192.0.2.1"
28++ @test_skip getnameinfo(ip"198.51.100.1") == "198.51.100.1"
29++ @test_skip getnameinfo(ip"203.0.113.1") == "203.0.113.1"
30++ @test_skip getnameinfo(ip"0.1.1.1") == "0.1.1.1"
31++ @test_skip getnameinfo(ip"::ffff:0.1.1.1") == "::ffff:0.1.1.1"
32++ @test_skip getnameinfo(ip"::ffff:192.0.2.1") == "::ffff:192.0.2.1"
33++ @test_skip getnameinfo(ip"2001:db8::1") == "2001:db8::1"
34+ end
35+
36+ @testset "getnameinfo on some valid IP addresses" begin
37+ @test !isempty(getnameinfo(ip"::")::String)
38+- @test !isempty(getnameinfo(ip"0.0.0.0")::String)
39+- @test !isempty(getnameinfo(ip"10.1.0.0")::String)
40+- @test !isempty(getnameinfo(ip"10.1.0.255")::String)
41+- @test !isempty(getnameinfo(ip"10.1.255.1")::String)
42+- @test !isempty(getnameinfo(ip"255.255.255.255")::String)
43+- @test !isempty(getnameinfo(ip"255.255.255.0")::String)
44+- @test !isempty(getnameinfo(ip"192.168.0.1")::String)
45+- @test !isempty(getnameinfo(ip"::1")::String)
46++ @test_skip !isempty(getnameinfo(ip"0.0.0.0")::String)
47++ @test_skip !isempty(getnameinfo(ip"10.1.0.0")::String)
48++ @test_skip !isempty(getnameinfo(ip"10.1.0.255")::String)
49++ @test_skip !isempty(getnameinfo(ip"10.1.255.1")::String)
50++ @test_skip !isempty(getnameinfo(ip"255.255.255.255")::String)
51++ @test_skip !isempty(getnameinfo(ip"255.255.255.0")::String)
52++ @test_skip !isempty(getnameinfo(ip"192.168.0.1")::String)
53++ @test_skip !isempty(getnameinfo(ip"::1")::String)
54+ end
55+
56+ @testset "getaddrinfo" begin
57+- let localhost = getnameinfo(ip"127.0.0.1")::String
58+- @test !isempty(localhost) && localhost != "127.0.0.1"
59+- @test !isempty(getalladdrinfo(localhost)::Vector{IPAddr})
60+- @test getaddrinfo(localhost, IPv4)::IPv4 != ip"0.0.0.0"
61+- @test try
62++ let localhost = getnameinfo(ip"::")::String
63++ @test_skip !isempty(localhost) && localhost != "127.0.0.1"
64++ @test_skip !isempty(getalladdrinfo(localhost)::Vector{IPAddr})
65++ @test_skip getaddrinfo(localhost, IPv4)::IPv4 != ip"0.0.0.0"
66++ @test_skip try
67+ getaddrinfo(localhost, IPv6)::IPv6 != ip"::"
68+ catch ex
69+ isa(ex, Sockets.DNSError) && ex.code == Base.UV_EAI_NONAME && ex.host == localhost
70+diff --git a/test/file.jl b/test/file.jl
71+index e86476f975..579276f82c 100644
72+--- a/test/file.jl
73++++ b/test/file.jl
74+@@ -874,8 +874,8 @@ if !Sys.iswindows() || (Sys.windows_version() >= Sys.WINDOWS_VISTA_VER)
75+ else
76+ @test_throws ErrorException symlink(file, "ba\0d")
77+ end
78+-@test_throws ArgumentError download("good", "ba\0d")
79+-@test_throws ArgumentError download("ba\0d", "good")
80++@test_skip @test_throws ArgumentError download("good", "ba\0d")
81++@test_skip @test_throws ArgumentError download("ba\0d", "good")
82+
83+ ###################
84+ # walkdir #
85+--
86+2.29.3
87+
pkgs/top-level/all-packages.nix+4−1
@@ -11113,9 +11113,12 @@ in
1111311113 julia-stable = julia_15;
1111411114 julia = julia-lts;
1111511115
11116+ julia_10-bin = callPackage ../development/compilers/julia/1.0-bin.nix { };
1111611117 julia_16-bin = callPackage ../development/compilers/julia/1.6-bin.nix { };
11117− julia-stable-bin = julia_16-bin;
1111811118
11119+ julia-lts-bin = julia_10-bin;
11120+ julia-stable-bin = julia_16-bin;
11121+ julia-bin = julia-lts-bin;
1111911122
1112011123 jwasm = callPackage ../development/compilers/jwasm { };
1112111124