Merge pull request #280153 from NickCao/julia_110

julia_110: init at 1.10.0
This commit is contained in:
Nick Cao 2024-01-12 10:53:39 -05:00 committed by GitHub
commit 0d6aa42a34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 153 additions and 264 deletions

View File

@ -1,96 +0,0 @@
{ autoPatchelfHook, fetchurl, lib, stdenv }:
let
skip_tests = [
# Test flaky on ofborg
"channels"
] ++ lib.optionals stdenv.isDarwin [
# Test flaky on ofborg
"FileWatching"
# Test requires pbcopy
"InteractiveUtils"
# Test requires network access
"Sockets"
] ++ lib.optionals (stdenv.isDarwin && stdenv.isx86_64) [
# Test Failed at $out/share/julia/stdlib/v1.8/LinearAlgebra/test/blas.jl:702
"LinearAlgebra/blas"
# Test Failed at $out/share/julia/test/misc.jl:724
"misc"
];
in
stdenv.mkDerivation rec {
pname = "julia-bin";
version = "1.8.5";
src = {
x86_64-linux = fetchurl {
url = "https://julialang-s3.julialang.org/bin/linux/x64/${lib.versions.majorMinor version}/julia-${version}-linux-x86_64.tar.gz";
sha256 = "sha256-5xokgW6P6dX0gHZky7tCc49aqf4FOX01yB1MXWSbnQU=";
};
aarch64-linux = fetchurl {
url = "https://julialang-s3.julialang.org/bin/linux/aarch64/${lib.versions.majorMinor version}/julia-${version}-linux-aarch64.tar.gz";
sha256 = "sha256-ofY3tExx6pvJbXw+80dyTAVKHlInuYCt6/wzWZ5RU6Q=";
};
x86_64-darwin = fetchurl {
url = "https://julialang-s3.julialang.org/bin/mac/x64/${lib.versions.majorMinor version}/julia-${version}-mac64.tar.gz";
sha256 = "sha256-oahZ7af7QaC1VGczmhHDwcDfeLJ9HhYOgLxnWLPY2uA=";
};
aarch64-darwin = fetchurl {
url = "https://julialang-s3.julialang.org/bin/mac/aarch64/${lib.versions.majorMinor version}/julia-${version}-macaarch64.tar.gz";
sha256 = "sha256-6oXgSJw2MkxNpiFjqhuC/PL1L3LRc+590hOjqSmSyrc=";
};
}.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
patches = [
# https://github.com/JuliaLang/julia/commit/f5eeba35d9bf20de251bb9160cc935c71e8b19ba
./patches/1.8-bin/0001-allow-skipping-internet-required-tests.patch
];
postPatch = ''
# Julia fails to pick up our Certification Authority root certificates, but
# it provides its own so we can simply disable the test. Patching in the
# dynamic path to ours require us to rebuild the Julia system image.
substituteInPlace share/julia/stdlib/v${lib.versions.majorMinor version}/NetworkOptions/test/runtests.jl \
--replace '@test ca_roots_path() != bundled_ca_roots()' \
'@test_skip ca_roots_path() != bundled_ca_roots()'
'';
nativeBuildInputs = lib.optionals stdenv.isLinux [ autoPatchelfHook ];
installPhase = ''
runHook preInstall
cp -r . $out
runHook postInstall
'';
# Breaks backtraces, etc.
dontStrip = true;
doInstallCheck = true;
preInstallCheck = ''
export JULIA_TEST_USE_MULTIPLE_WORKERS=true
# Some tests require read/write access to $HOME.
export HOME="$TMPDIR"
'';
installCheckPhase = ''
runHook preInstallCheck
# Command lifted from `test/Makefile`.
$out/bin/julia \
--check-bounds=yes \
--startup-file=no \
--depwarn=error \
$out/share/julia/test/runtests.jl \
--skip internet_required ${toString skip_tests}
runHook postInstallCheck
'';
meta = {
description = "High-level, high-performance, dynamic language for technical computing";
homepage = "https://julialang.org";
# Bundled and linked with various GPL code, although Julia itself is MIT.
license = lib.licenses.gpl2Plus;
maintainers = with lib.maintainers; [ raskin nickcao wegank thomasjm ];
platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
mainProgram = "julia";
};
}

View File

@ -1,86 +0,0 @@
{ lib
, stdenv
, fetchurl
, which
, python3
, gfortran
, cmake
, perl
, gnum4
, libxml2
, openssl
}:
stdenv.mkDerivation rec {
pname = "julia";
version = "1.8.5";
src = fetchurl {
url = "https://github.com/JuliaLang/julia/releases/download/v${version}/julia-${version}-full.tar.gz";
hash = "sha256-NVVAgKS0085S7yICVDBr1CrA2I7/nrhVkqV9BmPbXfI=";
};
patches = [
./patches/1.8/0001-skip-building-doc.patch
./patches/1.8/0002-skip-failing-and-flaky-tests.patch
];
nativeBuildInputs = [
which
python3
gfortran
cmake
perl
gnum4
];
buildInputs = [
libxml2
openssl
];
dontUseCmakeConfigure = true;
postPatch = ''
patchShebangs .
'';
makeFlags = [
"prefix=$(out)"
"USE_BINARYBUILDER=0"
# workaround for https://github.com/JuliaLang/julia/issues/47989
"USE_INTEL_JITEVENTS=0"
] ++ lib.optionals stdenv.isx86_64 [
# https://github.com/JuliaCI/julia-buildbot/blob/master/master/inventory.py
"JULIA_CPU_TARGET=generic;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1)"
] ++ lib.optionals stdenv.isAarch64 [
"JULIA_CPU_TARGET=generic;cortex-a57;thunderx2t99;armv8.2-a,crypto,fullfp16,lse,rdm"
];
# remove forbidden reference to $TMPDIR
preFixup = ''
for file in libcurl.so libgmpxx.so; do
patchelf --shrink-rpath --allowed-rpath-prefixes ${builtins.storeDir} "$out/lib/julia/$file"
done
'';
doInstallCheck = true;
installCheckTarget = "testall";
preInstallCheck = ''
export HOME="$TMPDIR"
export JULIA_TEST_USE_MULTIPLE_WORKERS="true"
'';
dontStrip = true;
enableParallelBuilding = true;
meta = with lib; {
description = "High-level performance-oriented dynamical language for technical computing";
homepage = "https://julialang.org/";
license = licenses.mit;
maintainers = with maintainers; [ nickcao thomasjm ];
platforms = [ "x86_64-linux" "aarch64-linux" ];
};
}

View File

@ -1,10 +1,10 @@
{ callPackage }:
let
juliaWithPackages = callPackage ../../julia-modules {};
juliaWithPackages = callPackage ../../julia-modules { };
wrapJulia = julia: julia.overrideAttrs (oldAttrs: {
passthru = (oldAttrs.passthru or {}) // {
passthru = (oldAttrs.passthru or { }) // {
withPackages = juliaWithPackages.override { inherit julia; };
};
});
@ -12,9 +12,50 @@ let
in
{
julia_16-bin = wrapJulia (callPackage ./1.6-bin.nix {});
julia_18-bin = wrapJulia (callPackage ./1.8-bin.nix {});
julia_19-bin = wrapJulia (callPackage ./1.9-bin.nix {});
julia_18 = wrapJulia (callPackage ./1.8.nix {});
julia_19 = wrapJulia (callPackage ./1.9.nix {});
julia_16-bin = wrapJulia (callPackage ./1.6-bin.nix { });
julia_19-bin = wrapJulia (callPackage
(import ./generic-bin.nix {
version = "1.9.4";
sha256 = {
x86_64-linux = "07d20c4c2518833e2265ca0acee15b355463361aa4efdab858dad826cf94325c";
aarch64-linux = "541d0c5a9378f8d2fc384bb8595fc6ffe20d61054629a6e314fb2f8dfe2f2ade";
x86_64-darwin = "67eec264f6afc9e9bf72c0f62c84d91c2ebdfaed6a0aa11606e3c983d278b441";
aarch64-darwin = "67542975e86102eec95bc4bb7c30c5d8c7ea9f9a0b388f0e10f546945363b01a";
};
patches = [
# https://github.com/JuliaLang/julia/commit/f5eeba35d9bf20de251bb9160cc935c71e8b19ba
./patches/1.9-bin/0001-allow-skipping-internet-required-tests.patch
];
})
{ });
julia_110-bin = wrapJulia (callPackage
(import ./generic-bin.nix {
version = "1.10.0";
sha256 = {
x86_64-linux = "a7298207f72f2b27b2ab1ce392a6ea37afbd1fbee0f1f8d190b054dcaba878fe";
aarch64-linux = "048d96b4398efd524e94be3f49e8829cf6b30c8f3f4b46c75751a4679635e45b";
x86_64-darwin = "eb1cdf2d373ee40412e8f5ee6b4681916f1ead6d794883903619c7bf147d4f46";
aarch64-darwin = "dc4ca01b1294c02d47b33ef26d489dc288ac68655a03774870c6872b82a9a7d6";
};
})
{ });
julia_19 = wrapJulia (callPackage
(import ./generic.nix {
version = "1.9.4";
hash = "sha256-YYQ7lkf9BtOymU8yd6ZN4ctaWlKX2TC4yOO8DpN0ACQ=";
patches = [
./patches/1.9/0002-skip-failing-and-flaky-tests.patch
];
})
{ });
julia_110 = wrapJulia (callPackage
(import ./generic.nix {
version = "1.10.0";
hash = "sha256-pfjAzgjPEyvdkZygtbOytmyJ4OX35/sqgf+n8iXj20w=";
patches = [
./patches/1.10/0001-skip-building-docs-as-it-requires-network-access.patch
./patches/1.10/0002-skip-failing-and-flaky-tests.patch
];
})
{ });
}

View File

@ -1,13 +1,25 @@
{ autoPatchelfHook, fetchurl, lib, stdenv }:
{ version
, sha256
, patches ? [ ]
}:
{ autoPatchelfHook
, fetchurl
, lib
, stdenv
}:
let
skip_tests = [
# Test flaky on ofborg
"channels"
# Test flaky because of our RPATH patching
# https://github.com/NixOS/nixpkgs/pull/230965#issuecomment-1545336489
"compiler/codegen"
] ++ lib.optionals (lib.versionAtLeast version "1.10") [
# Test flaky
# https://github.com/JuliaLang/julia/issues/52739
"REPL"
] ++ lib.optionals stdenv.isDarwin [
# Test flaky on ofborg
"FileWatching"
@ -22,34 +34,30 @@ let
"misc"
];
in
stdenv.mkDerivation rec {
stdenv.mkDerivation {
pname = "julia-bin";
version = "1.9.4";
inherit version patches;
src = {
x86_64-linux = fetchurl {
url = "https://julialang-s3.julialang.org/bin/linux/x64/${lib.versions.majorMinor version}/julia-${version}-linux-x86_64.tar.gz";
sha256 = "07d20c4c2518833e2265ca0acee15b355463361aa4efdab858dad826cf94325c";
sha256 = sha256.x86_64-linux;
};
aarch64-linux = fetchurl {
url = "https://julialang-s3.julialang.org/bin/linux/aarch64/${lib.versions.majorMinor version}/julia-${version}-linux-aarch64.tar.gz";
sha256 = "541d0c5a9378f8d2fc384bb8595fc6ffe20d61054629a6e314fb2f8dfe2f2ade";
sha256 = sha256.aarch64-linux;
};
x86_64-darwin = fetchurl {
url = "https://julialang-s3.julialang.org/bin/mac/x64/${lib.versions.majorMinor version}/julia-${version}-mac64.tar.gz";
sha256 = "67eec264f6afc9e9bf72c0f62c84d91c2ebdfaed6a0aa11606e3c983d278b441";
sha256 = sha256.x86_64-darwin;
};
aarch64-darwin = fetchurl {
url = "https://julialang-s3.julialang.org/bin/mac/aarch64/${lib.versions.majorMinor version}/julia-${version}-macaarch64.tar.gz";
sha256 = "67542975e86102eec95bc4bb7c30c5d8c7ea9f9a0b388f0e10f546945363b01a";
sha256 = sha256.aarch64-darwin;
};
}.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
patches = [
# https://github.com/JuliaLang/julia/commit/f5eeba35d9bf20de251bb9160cc935c71e8b19ba
./patches/1.9-bin/0001-allow-skipping-internet-required-tests.patch
];
postPatch = ''
# Julia fails to pick up our Certification Authority root certificates, but
# it provides its own so we can simply disable the test. Patching in the
@ -75,11 +83,14 @@ stdenv.mkDerivation rec {
dontStrip = true;
doInstallCheck = true;
preInstallCheck = ''
export JULIA_TEST_USE_MULTIPLE_WORKERS=true
# Some tests require read/write access to $HOME.
export HOME="$TMPDIR"
# And $HOME cannot be equal to $TMPDIR as it causes test failures
export HOME=$(mktemp -d)
'';
installCheckPhase = ''
runHook preInstallCheck
# Command lifted from `test/Makefile`.

View File

@ -1,3 +1,8 @@
{ version
, hash
, patches
}:
{ lib
, stdenv
, fetchurl
@ -13,17 +18,14 @@
stdenv.mkDerivation rec {
pname = "julia";
version = "1.9.4";
inherit version patches;
src = fetchurl {
url = "https://github.com/JuliaLang/julia/releases/download/v${version}/julia-${version}-full.tar.gz";
hash = "sha256-YYQ7lkf9BtOymU8yd6ZN4ctaWlKX2TC4yOO8DpN0ACQ=";
inherit hash;
};
patches = [
./patches/1.8/0002-skip-failing-and-flaky-tests.patch
];
strictDeps = true;
nativeBuildInputs = [
@ -63,12 +65,16 @@ stdenv.mkDerivation rec {
done
'';
doInstallCheck = !stdenv.hostPlatform.isAarch64; # tests are flaky for aarch64-linux on hydra
# tests are flaky for aarch64-linux on hydra
doInstallCheck = if (lib.versionOlder version "1.10") then !stdenv.hostPlatform.isAarch64 else true;
installCheckTarget = "testall";
preInstallCheck = ''
export HOME="$TMPDIR"
export JULIA_TEST_USE_MULTIPLE_WORKERS="true"
# Some tests require read/write access to $HOME.
# And $HOME cannot be equal to $TMPDIR as it causes test failures
export HOME=$(mktemp -d)
'';
dontStrip = true;

View File

@ -0,0 +1,34 @@
From da7e7b2c622bcfdc3e6484a64ade50d22d52c4dd Mon Sep 17 00:00:00 2001
From: Nick Cao <nickcao@nichi.co>
Date: Wed, 10 Jan 2024 19:48:19 -0500
Subject: [PATCH 1/2] skip building docs as it requires network access
---
Makefile | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index 1565014a0f..edd5c65244 100644
--- a/Makefile
+++ b/Makefile
@@ -265,7 +265,7 @@ define stringreplace
endef
-install: $(build_depsbindir)/stringreplace docs
+install: $(build_depsbindir)/stringreplace
@$(MAKE) $(QUIET_MAKE) $(JULIA_BUILD_MODE)
@for subdir in $(bindir) $(datarootdir)/julia/stdlib/$(VERSDIR) $(docdir) $(man1dir) $(includedir)/julia $(libdir) $(private_libdir) $(sysconfdir) $(private_libexecdir); do \
mkdir -p $(DESTDIR)$$subdir; \
@@ -368,8 +368,6 @@ endif
cp -R -L $(JULIAHOME)/base/* $(DESTDIR)$(datarootdir)/julia/base
cp -R -L $(JULIAHOME)/test/* $(DESTDIR)$(datarootdir)/julia/test
cp -R -L $(build_datarootdir)/julia/* $(DESTDIR)$(datarootdir)/julia
- # Copy documentation
- cp -R -L $(BUILDROOT)/doc/_build/html $(DESTDIR)$(docdir)/
# Remove various files which should not be installed
-rm -f $(DESTDIR)$(datarootdir)/julia/base/version_git.sh
-rm -f $(DESTDIR)$(datarootdir)/julia/test/Makefile
--
2.42.0

View File

@ -0,0 +1,25 @@
From c7e2f6ed00c170b68d5d156faac38aa76d4490fd Mon Sep 17 00:00:00 2001
From: Nick Cao <nickcao@nichi.co>
Date: Wed, 10 Jan 2024 20:58:20 -0500
Subject: [PATCH 2/2] skip failing and flaky tests
---
test/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/Makefile b/test/Makefile
index 88dbe5b2b4..f0bdedfdf5 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -28,7 +28,7 @@ default:
$(TESTS):
@cd $(SRCDIR) && \
- $(call PRINT_JULIA, $(call spawn,$(JULIA_EXECUTABLE)) --check-bounds=yes --startup-file=no --depwarn=error ./runtests.jl $@)
+ $(call PRINT_JULIA, $(call spawn,$(JULIA_EXECUTABLE)) --check-bounds=yes --startup-file=no --depwarn=error ./runtests.jl --skip NetworkOptions REPL channels $@)
$(addprefix revise-, $(TESTS)): revise-% :
@cd $(SRCDIR) && \
--
2.42.0

View File

@ -1,47 +0,0 @@
--- a/share/julia/test/choosetests.jl
+++ b/share/julia/test/choosetests.jl
@@ -31,6 +31,19 @@ const TESTNAMES = [
"smallarrayshrink", "opaque_closure", "filesystem", "download",
]
+
+const INTERNET_REQUIRED_LIST = [
+ "Artifacts",
+ "Downloads",
+ "LazyArtifacts",
+ "LibCURL",
+ "LibGit2",
+ "Pkg",
+ "download",
+]
+
+const NETWORK_REQUIRED_LIST = vcat(INTERNET_REQUIRED_LIST, ["Sockets"])
+
"""
`(; tests, net_on, exit_on_error, seed) = choosetests(choices)` selects a set of tests to be
run. `choices` should be a vector of test names; if empty or set to
@@ -147,6 +160,7 @@ function choosetests(choices = [])
filtertests!(tests, "compiler/EscapeAnalysis", [
"compiler/EscapeAnalysis/local", "compiler/EscapeAnalysis/interprocedural"])
filtertests!(tests, "stdlib", STDLIBS)
+ filtertests!(tests, "internet_required", INTERNET_REQUIRED_LIST)
# do ambiguous first to avoid failing if ambiguities are introduced by other tests
filtertests!(tests, "ambiguous")
@@ -157,15 +171,7 @@ function choosetests(choices = [])
filter!(x -> (x != "Profile"), tests)
end
- net_required_for = [
- "Artifacts",
- "Downloads",
- "LazyArtifacts",
- "LibCURL",
- "LibGit2",
- "Sockets",
- "download",
- ]
+ net_required_for = filter!(in(tests), NETWORK_REQUIRED_LIST)
net_on = true
JULIA_TEST_NETWORKING_AVAILABLE = get(ENV, "JULIA_TEST_NETWORKING_AVAILABLE", "") |>
strip |>

View File

@ -447,7 +447,8 @@ mapAliases ({
join-desktop = throw "'join-desktop' has been removed because it is unmaintained upstream"; # Added 2023-10-04
# Julia
julia_18 = throw "'julia_18' has been removed from nixpkgs as it has reached end of life"; # Added 2024-01-11
julia_18-bin = throw "'julia_18-bin' has been removed from nixpkgs as it has reached end of life"; # Added 2024-01-11
### K ###

View File

@ -16526,17 +16526,17 @@ with pkgs;
inherit (callPackage ../development/compilers/julia { })
julia_16-bin
julia_18-bin
julia_19-bin
julia_18
julia_19;
julia_110-bin
julia_19
julia_110;
julia-lts = julia_16-bin;
julia-stable = julia_19;
julia-stable = julia_110;
julia = julia-stable;
julia-lts-bin = julia_16-bin;
julia-stable-bin = julia_19-bin;
julia-stable-bin = julia_110-bin;
julia-bin = julia-stable-bin;
jwasm = callPackage ../development/compilers/jwasm { };