From 1233e6952ecd363ad9f188ab38daf33b8768250a Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Wed, 10 Jan 2024 18:33:30 -0500 Subject: [PATCH 1/6] julia_110-bin: init at 1.10.0 --- pkgs/development/compilers/julia/1.10-bin.nix | 104 ++++++++++++++++++ pkgs/development/compilers/julia/default.nix | 1 + pkgs/top-level/all-packages.nix | 1 + 3 files changed, 106 insertions(+) create mode 100644 pkgs/development/compilers/julia/1.10-bin.nix diff --git a/pkgs/development/compilers/julia/1.10-bin.nix b/pkgs/development/compilers/julia/1.10-bin.nix new file mode 100644 index 000000000000..0575469cfe2d --- /dev/null +++ b/pkgs/development/compilers/julia/1.10-bin.nix @@ -0,0 +1,104 @@ +{ 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" + + # Test flaky + # https://github.com/JuliaLang/julia/issues/52739 + "REPL" + ] ++ 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.10.0"; + + 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 = "a7298207f72f2b27b2ab1ce392a6ea37afbd1fbee0f1f8d190b054dcaba878fe"; + }; + aarch64-linux = fetchurl { + url = "https://julialang-s3.julialang.org/bin/linux/aarch64/${lib.versions.majorMinor version}/julia-${version}-linux-aarch64.tar.gz"; + sha256 = "048d96b4398efd524e94be3f49e8829cf6b30c8f3f4b46c75751a4679635e45b"; + }; + x86_64-darwin = fetchurl { + url = "https://julialang-s3.julialang.org/bin/mac/x64/${lib.versions.majorMinor version}/julia-${version}-mac64.tar.gz"; + sha256 = "eb1cdf2d373ee40412e8f5ee6b4681916f1ead6d794883903619c7bf147d4f46"; + }; + aarch64-darwin = fetchurl { + url = "https://julialang-s3.julialang.org/bin/mac/aarch64/${lib.versions.majorMinor version}/julia-${version}-macaarch64.tar.gz"; + sha256 = "dc4ca01b1294c02d47b33ef26d489dc288ac68655a03774870c6872b82a9a7d6"; + }; + }.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}"); + + 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 + # https://github.com/JuliaLang/julia/blob/v1.9.0/NEWS.md#external-dependencies + stdenv.cc.cc + ]; + + 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. + # And $HOME cannot be equal to $TMPDIR as it causes test failures + export HOME=$(mktemp -d) + ''; + 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"; + }; +} diff --git a/pkgs/development/compilers/julia/default.nix b/pkgs/development/compilers/julia/default.nix index d4cd0ab6b83e..b374457c5f4c 100644 --- a/pkgs/development/compilers/julia/default.nix +++ b/pkgs/development/compilers/julia/default.nix @@ -15,6 +15,7 @@ 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_110-bin = wrapJulia (callPackage ./1.10-bin.nix {}); julia_18 = wrapJulia (callPackage ./1.8.nix {}); julia_19 = wrapJulia (callPackage ./1.9.nix {}); } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index fbde424d67a3..28fe7f57b046 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16500,6 +16500,7 @@ with pkgs; julia_16-bin julia_18-bin julia_19-bin + julia_110-bin julia_18 julia_19; From 19799b28e154c5deca0b7d92c23395a264e56717 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Tue, 26 Dec 2023 16:58:17 -0500 Subject: [PATCH 2/6] julia_110: init at 1.10.0 --- pkgs/development/compilers/julia/1.10.nix | 88 +++++++++++++++++++ pkgs/development/compilers/julia/default.nix | 1 + ...g-docs-as-it-requires-network-access.patch | 34 +++++++ .../0002-skip-failing-and-flaky-tests.patch | 25 ++++++ pkgs/top-level/all-packages.nix | 3 +- 5 files changed, 150 insertions(+), 1 deletion(-) create mode 100644 pkgs/development/compilers/julia/1.10.nix create mode 100644 pkgs/development/compilers/julia/patches/1.10/0001-skip-building-docs-as-it-requires-network-access.patch create mode 100644 pkgs/development/compilers/julia/patches/1.10/0002-skip-failing-and-flaky-tests.patch diff --git a/pkgs/development/compilers/julia/1.10.nix b/pkgs/development/compilers/julia/1.10.nix new file mode 100644 index 000000000000..620f235e4ee9 --- /dev/null +++ b/pkgs/development/compilers/julia/1.10.nix @@ -0,0 +1,88 @@ +{ lib +, stdenv +, fetchurl +, which +, python3 +, gfortran +, cmake +, perl +, gnum4 +, openssl +, libxml2 +}: + +stdenv.mkDerivation rec { + pname = "julia"; + version = "1.10.0"; + + src = fetchurl { + url = "https://github.com/JuliaLang/julia/releases/download/v${version}/julia-${version}-full.tar.gz"; + 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 + ]; + + strictDeps = true; + + nativeBuildInputs = [ + which + python3 + gfortran + cmake + perl + gnum4 + openssl + ]; + + buildInputs = [ + libxml2 + ]; + + dontUseCmakeConfigure = true; + + postPatch = '' + patchShebangs . + ''; + + makeFlags = [ + "prefix=$(out)" + "USE_BINARYBUILDER=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 libmpfr.so; do + patchelf --shrink-rpath --allowed-rpath-prefixes ${builtins.storeDir} "$out/lib/julia/$file" + done + ''; + + doInstallCheck = true; + installCheckTarget = "testall"; + + preInstallCheck = '' + 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; + + 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 joshniemela thomasjm ]; + platforms = [ "x86_64-linux" "aarch64-linux" ]; + }; +} diff --git a/pkgs/development/compilers/julia/default.nix b/pkgs/development/compilers/julia/default.nix index b374457c5f4c..d694e93f917d 100644 --- a/pkgs/development/compilers/julia/default.nix +++ b/pkgs/development/compilers/julia/default.nix @@ -18,4 +18,5 @@ in julia_110-bin = wrapJulia (callPackage ./1.10-bin.nix {}); julia_18 = wrapJulia (callPackage ./1.8.nix {}); julia_19 = wrapJulia (callPackage ./1.9.nix {}); + julia_110 = wrapJulia (callPackage ./1.10.nix {}); } diff --git a/pkgs/development/compilers/julia/patches/1.10/0001-skip-building-docs-as-it-requires-network-access.patch b/pkgs/development/compilers/julia/patches/1.10/0001-skip-building-docs-as-it-requires-network-access.patch new file mode 100644 index 000000000000..e7bc9187cead --- /dev/null +++ b/pkgs/development/compilers/julia/patches/1.10/0001-skip-building-docs-as-it-requires-network-access.patch @@ -0,0 +1,34 @@ +From da7e7b2c622bcfdc3e6484a64ade50d22d52c4dd Mon Sep 17 00:00:00 2001 +From: Nick Cao +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 + diff --git a/pkgs/development/compilers/julia/patches/1.10/0002-skip-failing-and-flaky-tests.patch b/pkgs/development/compilers/julia/patches/1.10/0002-skip-failing-and-flaky-tests.patch new file mode 100644 index 000000000000..2b9986107faf --- /dev/null +++ b/pkgs/development/compilers/julia/patches/1.10/0002-skip-failing-and-flaky-tests.patch @@ -0,0 +1,25 @@ +From c7e2f6ed00c170b68d5d156faac38aa76d4490fd Mon Sep 17 00:00:00 2001 +From: Nick Cao +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 + diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 28fe7f57b046..4f09ca66ddab 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16502,7 +16502,8 @@ with pkgs; julia_19-bin julia_110-bin julia_18 - julia_19; + julia_19 + julia_110; julia-lts = julia_16-bin; julia-stable = julia_19; From 2b3c8a1158d5d971cd5e50adeba4558b731c2182 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Thu, 11 Jan 2024 11:11:22 -0500 Subject: [PATCH 3/6] julia-stable{,-bin}: default to julia_110{,-bin} --- pkgs/top-level/all-packages.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4f09ca66ddab..d836ff8437a2 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16506,11 +16506,11 @@ with pkgs; 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 { }; From fd37c3101b402e860d996526963acd04d92f4c5a Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Thu, 11 Jan 2024 11:17:34 -0500 Subject: [PATCH 4/6] julia_18{,-bin}: drop as it has reached end of life --- pkgs/development/compilers/julia/1.8-bin.nix | 96 ------------------- pkgs/development/compilers/julia/1.8.nix | 86 ----------------- pkgs/development/compilers/julia/1.9.nix | 2 +- pkgs/development/compilers/julia/default.nix | 2 - ...low-skipping-internet-required-tests.patch | 47 --------- .../{1.8 => 1.9}/0001-skip-building-doc.patch | 0 .../0002-skip-failing-and-flaky-tests.patch | 0 pkgs/top-level/aliases.nix | 3 +- pkgs/top-level/all-packages.nix | 2 - 9 files changed, 3 insertions(+), 235 deletions(-) delete mode 100644 pkgs/development/compilers/julia/1.8-bin.nix delete mode 100644 pkgs/development/compilers/julia/1.8.nix delete mode 100644 pkgs/development/compilers/julia/patches/1.8-bin/0001-allow-skipping-internet-required-tests.patch rename pkgs/development/compilers/julia/patches/{1.8 => 1.9}/0001-skip-building-doc.patch (100%) rename pkgs/development/compilers/julia/patches/{1.8 => 1.9}/0002-skip-failing-and-flaky-tests.patch (100%) diff --git a/pkgs/development/compilers/julia/1.8-bin.nix b/pkgs/development/compilers/julia/1.8-bin.nix deleted file mode 100644 index d7a548a8d137..000000000000 --- a/pkgs/development/compilers/julia/1.8-bin.nix +++ /dev/null @@ -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"; - }; -} diff --git a/pkgs/development/compilers/julia/1.8.nix b/pkgs/development/compilers/julia/1.8.nix deleted file mode 100644 index 8bd0b536e149..000000000000 --- a/pkgs/development/compilers/julia/1.8.nix +++ /dev/null @@ -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" ]; - }; -} diff --git a/pkgs/development/compilers/julia/1.9.nix b/pkgs/development/compilers/julia/1.9.nix index 8c0585fd4e19..34da443c2689 100644 --- a/pkgs/development/compilers/julia/1.9.nix +++ b/pkgs/development/compilers/julia/1.9.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation rec { }; patches = [ - ./patches/1.8/0002-skip-failing-and-flaky-tests.patch + ./patches/1.9/0002-skip-failing-and-flaky-tests.patch ]; strictDeps = true; diff --git a/pkgs/development/compilers/julia/default.nix b/pkgs/development/compilers/julia/default.nix index d694e93f917d..60ca5a9b9633 100644 --- a/pkgs/development/compilers/julia/default.nix +++ b/pkgs/development/compilers/julia/default.nix @@ -13,10 +13,8 @@ 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_110-bin = wrapJulia (callPackage ./1.10-bin.nix {}); - julia_18 = wrapJulia (callPackage ./1.8.nix {}); julia_19 = wrapJulia (callPackage ./1.9.nix {}); julia_110 = wrapJulia (callPackage ./1.10.nix {}); } diff --git a/pkgs/development/compilers/julia/patches/1.8-bin/0001-allow-skipping-internet-required-tests.patch b/pkgs/development/compilers/julia/patches/1.8-bin/0001-allow-skipping-internet-required-tests.patch deleted file mode 100644 index ab256f54848e..000000000000 --- a/pkgs/development/compilers/julia/patches/1.8-bin/0001-allow-skipping-internet-required-tests.patch +++ /dev/null @@ -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 |> diff --git a/pkgs/development/compilers/julia/patches/1.8/0001-skip-building-doc.patch b/pkgs/development/compilers/julia/patches/1.9/0001-skip-building-doc.patch similarity index 100% rename from pkgs/development/compilers/julia/patches/1.8/0001-skip-building-doc.patch rename to pkgs/development/compilers/julia/patches/1.9/0001-skip-building-doc.patch diff --git a/pkgs/development/compilers/julia/patches/1.8/0002-skip-failing-and-flaky-tests.patch b/pkgs/development/compilers/julia/patches/1.9/0002-skip-failing-and-flaky-tests.patch similarity index 100% rename from pkgs/development/compilers/julia/patches/1.8/0002-skip-failing-and-flaky-tests.patch rename to pkgs/development/compilers/julia/patches/1.9/0002-skip-failing-and-flaky-tests.patch diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 068e3c113418..5d0594d043a6 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -445,7 +445,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 ### diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d836ff8437a2..4dfec4452e51 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16498,10 +16498,8 @@ with pkgs; inherit (callPackage ../development/compilers/julia { }) julia_16-bin - julia_18-bin julia_19-bin julia_110-bin - julia_18 julia_19 julia_110; From e2ada3ce79e7e3a180d6943236184c10a66e573a Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Thu, 11 Jan 2024 11:28:44 -0500 Subject: [PATCH 5/6] julia_1{9,10}: deduplicate common code --- pkgs/development/compilers/julia/1.9.nix | 85 ------------------- pkgs/development/compilers/julia/default.nix | 31 +++++-- .../compilers/julia/{1.10.nix => generic.nix} | 19 +++-- 3 files changed, 35 insertions(+), 100 deletions(-) delete mode 100644 pkgs/development/compilers/julia/1.9.nix rename pkgs/development/compilers/julia/{1.10.nix => generic.nix} (86%) diff --git a/pkgs/development/compilers/julia/1.9.nix b/pkgs/development/compilers/julia/1.9.nix deleted file mode 100644 index 34da443c2689..000000000000 --- a/pkgs/development/compilers/julia/1.9.nix +++ /dev/null @@ -1,85 +0,0 @@ -{ lib -, stdenv -, fetchurl -, which -, python3 -, gfortran -, cmake -, perl -, gnum4 -, openssl -, libxml2 -}: - -stdenv.mkDerivation rec { - pname = "julia"; - version = "1.9.4"; - - src = fetchurl { - url = "https://github.com/JuliaLang/julia/releases/download/v${version}/julia-${version}-full.tar.gz"; - hash = "sha256-YYQ7lkf9BtOymU8yd6ZN4ctaWlKX2TC4yOO8DpN0ACQ="; - }; - - patches = [ - ./patches/1.9/0002-skip-failing-and-flaky-tests.patch - ]; - - strictDeps = true; - - nativeBuildInputs = [ - which - python3 - gfortran - cmake - perl - gnum4 - openssl - ]; - - buildInputs = [ - libxml2 - ]; - - dontUseCmakeConfigure = true; - - postPatch = '' - patchShebangs . - ''; - - makeFlags = [ - "prefix=$(out)" - "USE_BINARYBUILDER=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 libmpfr.so; do - patchelf --shrink-rpath --allowed-rpath-prefixes ${builtins.storeDir} "$out/lib/julia/$file" - done - ''; - - doInstallCheck = !stdenv.hostPlatform.isAarch64; # tests are flaky for aarch64-linux on hydra - 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 joshniemela thomasjm ]; - platforms = [ "x86_64-linux" "aarch64-linux" ]; - }; -} diff --git a/pkgs/development/compilers/julia/default.nix b/pkgs/development/compilers/julia/default.nix index 60ca5a9b9633..e59efcc61382 100644 --- a/pkgs/development/compilers/julia/default.nix +++ b/pkgs/development/compilers/julia/default.nix @@ -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,26 @@ let in { - julia_16-bin = wrapJulia (callPackage ./1.6-bin.nix {}); - julia_19-bin = wrapJulia (callPackage ./1.9-bin.nix {}); - julia_110-bin = wrapJulia (callPackage ./1.10-bin.nix {}); - julia_19 = wrapJulia (callPackage ./1.9.nix {}); - julia_110 = wrapJulia (callPackage ./1.10.nix {}); + julia_16-bin = wrapJulia (callPackage ./1.6-bin.nix { }); + julia_19-bin = wrapJulia (callPackage ./1.9-bin.nix { }); + julia_110-bin = wrapJulia (callPackage ./1.10-bin.nix { }); + 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 + ]; + }) + { }); } diff --git a/pkgs/development/compilers/julia/1.10.nix b/pkgs/development/compilers/julia/generic.nix similarity index 86% rename from pkgs/development/compilers/julia/1.10.nix rename to pkgs/development/compilers/julia/generic.nix index 620f235e4ee9..4ab317618a41 100644 --- a/pkgs/development/compilers/julia/1.10.nix +++ b/pkgs/development/compilers/julia/generic.nix @@ -1,3 +1,8 @@ +{ version +, hash +, patches +}: + { lib , stdenv , fetchurl @@ -13,18 +18,14 @@ stdenv.mkDerivation rec { pname = "julia"; - version = "1.10.0"; + + inherit version patches; src = fetchurl { url = "https://github.com/JuliaLang/julia/releases/download/v${version}/julia-${version}-full.tar.gz"; - hash = "sha256-pfjAzgjPEyvdkZygtbOytmyJ4OX35/sqgf+n8iXj20w="; + inherit hash; }; - patches = [ - ./patches/1.10/0001-skip-building-docs-as-it-requires-network-access.patch - ./patches/1.10/0002-skip-failing-and-flaky-tests.patch - ]; - strictDeps = true; nativeBuildInputs = [ @@ -64,7 +65,9 @@ stdenv.mkDerivation rec { done ''; - doInstallCheck = true; + # tests are flaky for aarch64-linux on hydra + doInstallCheck = if (lib.versionOlder version "1.10") then !stdenv.hostPlatform.isAarch64 else true; + installCheckTarget = "testall"; preInstallCheck = '' From 849371a0a56f4295f74953ac5a89da61f2bad636 Mon Sep 17 00:00:00 2001 From: Nick Cao Date: Thu, 11 Jan 2024 21:48:47 -0500 Subject: [PATCH 6/6] julia_1{9,10}-bin: deduplicate common code --- pkgs/development/compilers/julia/1.9-bin.nix | 104 ------------------ pkgs/development/compilers/julia/default.nix | 28 ++++- .../julia/{1.10-bin.nix => generic-bin.nix} | 29 +++-- 3 files changed, 46 insertions(+), 115 deletions(-) delete mode 100644 pkgs/development/compilers/julia/1.9-bin.nix rename pkgs/development/compilers/julia/{1.10-bin.nix => generic-bin.nix} (88%) diff --git a/pkgs/development/compilers/julia/1.9-bin.nix b/pkgs/development/compilers/julia/1.9-bin.nix deleted file mode 100644 index a52e62139abe..000000000000 --- a/pkgs/development/compilers/julia/1.9-bin.nix +++ /dev/null @@ -1,104 +0,0 @@ -{ 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 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.9.4"; - - 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"; - }; - aarch64-linux = fetchurl { - url = "https://julialang-s3.julialang.org/bin/linux/aarch64/${lib.versions.majorMinor version}/julia-${version}-linux-aarch64.tar.gz"; - sha256 = "541d0c5a9378f8d2fc384bb8595fc6ffe20d61054629a6e314fb2f8dfe2f2ade"; - }; - x86_64-darwin = fetchurl { - url = "https://julialang-s3.julialang.org/bin/mac/x64/${lib.versions.majorMinor version}/julia-${version}-mac64.tar.gz"; - sha256 = "67eec264f6afc9e9bf72c0f62c84d91c2ebdfaed6a0aa11606e3c983d278b441"; - }; - aarch64-darwin = fetchurl { - url = "https://julialang-s3.julialang.org/bin/mac/aarch64/${lib.versions.majorMinor version}/julia-${version}-macaarch64.tar.gz"; - sha256 = "67542975e86102eec95bc4bb7c30c5d8c7ea9f9a0b388f0e10f546945363b01a"; - }; - }.${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 - # 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 - # https://github.com/JuliaLang/julia/blob/v1.9.0/NEWS.md#external-dependencies - stdenv.cc.cc - ]; - - 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"; - }; -} diff --git a/pkgs/development/compilers/julia/default.nix b/pkgs/development/compilers/julia/default.nix index e59efcc61382..b094759387fd 100644 --- a/pkgs/development/compilers/julia/default.nix +++ b/pkgs/development/compilers/julia/default.nix @@ -13,8 +13,32 @@ in { julia_16-bin = wrapJulia (callPackage ./1.6-bin.nix { }); - julia_19-bin = wrapJulia (callPackage ./1.9-bin.nix { }); - julia_110-bin = wrapJulia (callPackage ./1.10-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"; diff --git a/pkgs/development/compilers/julia/1.10-bin.nix b/pkgs/development/compilers/julia/generic-bin.nix similarity index 88% rename from pkgs/development/compilers/julia/1.10-bin.nix rename to pkgs/development/compilers/julia/generic-bin.nix index 0575469cfe2d..e19a0e020a4a 100644 --- a/pkgs/development/compilers/julia/1.10-bin.nix +++ b/pkgs/development/compilers/julia/generic-bin.nix @@ -1,14 +1,22 @@ -{ 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" @@ -26,26 +34,27 @@ let "misc" ]; in -stdenv.mkDerivation rec { +stdenv.mkDerivation { pname = "julia-bin"; - version = "1.10.0"; + + 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 = "a7298207f72f2b27b2ab1ce392a6ea37afbd1fbee0f1f8d190b054dcaba878fe"; + 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 = "048d96b4398efd524e94be3f49e8829cf6b30c8f3f4b46c75751a4679635e45b"; + 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 = "eb1cdf2d373ee40412e8f5ee6b4681916f1ead6d794883903619c7bf147d4f46"; + 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 = "dc4ca01b1294c02d47b33ef26d489dc288ac68655a03774870c6872b82a9a7d6"; + sha256 = sha256.aarch64-darwin; }; }.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}"); @@ -74,12 +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. # And $HOME cannot be equal to $TMPDIR as it causes test failures export HOME=$(mktemp -d) ''; + installCheckPhase = '' runHook preInstallCheck # Command lifted from `test/Makefile`.