Unverified Commit 1c5fb94b authored by Nick Cao's avatar Nick Cao Committed by GitHub
Browse files

julia_111{,-bin}: init at 1.11.0 (#347361)

parents 2a55bdc8 bc84d24e
Loading
Loading
Loading
Loading
+0 −72
Original line number Diff line number Diff line
{ autoPatchelfHook, fetchurl, lib, stdenv }:

stdenv.mkDerivation rec {
  pname = "julia-bin";
  version = "1.6.7";

  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-bEUi1ZXky80AFXrEWKcviuwBdXBT0gc/mdqjnkQrKjY=";
    };
  }.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");

  # Julia’s source files are in different locations for source and binary
  # releases. Thus we temporarily create a symlink to allow us to share patches
  # with source releases.
  prePatch = ''
    ln -s share/julia/test
  '';
  patches = [
    # Source release Nix patch(es) relevant for binary releases as well.
    ./patches/1.6-bin/0005-nix-Enable-parallel-unit-tests-for-sandbox.patch
  ];
  postPatch = ''
    # Revert symlink hack.
    rm test

    # 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 = [ autoPatchelfHook ];

  installPhase = ''
    runHook preInstall
    cp -r . $out
    runHook postInstall
  '';

  # Breaks backtraces, etc.
  dontStrip = true;

  doInstallCheck = true;
  preInstallCheck = ''
    # 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
    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 thomasjm ];
    platforms = [ "x86_64-linux" ];
    mainProgram = "julia";
  };
}
+20 −1
Original line number Diff line number Diff line
@@ -12,7 +12,6 @@ let
in

{
  julia_16-bin = wrapJulia (callPackage ./1.6-bin.nix { });
  julia_19-bin = wrapJulia (callPackage
    (import ./generic-bin.nix {
      version = "1.9.4";
@@ -39,6 +38,17 @@ in
      };
    })
    { });
  julia_111-bin = wrapJulia (callPackage
    (import ./generic-bin.nix {
      version = "1.11.1";
      sha256 = {
        x86_64-linux = "cca8d13dc4507e4f62a129322293313ee574f300d4df9e7db30b7b41c5f8a8f3";
        aarch64-linux = "bd623ef3801c5a56103464d349c7901d5cc034405ad289332c67f1e8ecc05840";
        x86_64-darwin = "59885de9310788c1ed12f41e7d2c2f05eabd314888cd105d299837b76a4a7240";
        aarch64-darwin = "e09d13e1c6c98452e91e698220688dd784ec8e5367e9e6443099c5f9aa2add78";
      };
    })
    { });
  julia_19 = wrapJulia (callPackage
    (import ./generic.nix {
      version = "1.9.4";
@@ -57,4 +67,13 @@ in
      ];
    })
    { });
  julia_111 = wrapJulia (callPackage
    (import ./generic.nix {
      version = "1.11.1";
      hash = "sha256-pJuATeboagP+Jsc/WIUeruH/JD1yBPK1rk28XB3CdY0=";
      patches = [
        ./patches/1.11/0002-skip-failing-and-flaky-tests.patch
      ];
    })
    { });
}
+5 −0
Original line number Diff line number Diff line
@@ -24,6 +24,11 @@ let
    "REPL"
    # Test flaky
    "ccall"
  ] ++ lib.optionals (lib.versionAtLeast version "1.11") [
    # Test flaky
    # https://github.com/JuliaLang/julia/issues/54280
    "loading"
    "cmdlineargs"
  ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
    # Test flaky on ofborg
    "FileWatching"
+8 −0
Original line number Diff line number Diff line
@@ -9,12 +9,14 @@
, which
, python3
, gfortran
, cacert
, cmake
, perl
, gnum4
, openssl
, libxml2
, zlib
, buildPackages
}:

stdenv.mkDerivation rec {
@@ -42,12 +44,18 @@ stdenv.mkDerivation rec {
  buildInputs = [
    libxml2
    zlib
  ] ++ lib.optionals (lib.versionAtLeast version "1.11") [
    cacert
  ];

  dontUseCmakeConfigure = true;

  postPatch = ''
    patchShebangs .
  '' + lib.optionalString (lib.versionAtLeast version "1.11") ''
    substituteInPlace deps/curl.mk \
      --replace-fail 'cd $(dir $<) && $(TAR) jxf $(notdir $<)' \
                     'cd $(dir $<) && $(TAR) jxf $(notdir $<) && sed -i "s|/usr/bin/env perl|${lib.getExe buildPackages.perl}|" curl-$(CURL_VER)/scripts/cd2nroff'
  '';

  makeFlags = [
+25 −0
Original line number Diff line number Diff line
From 9da2f2596db9f4f1a61825d82d9b8c3f3b2e99aa 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..a2a7a55e20 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 FileWatching ccall loading cmdlineargs $@)
 
 $(addprefix revise-, $(TESTS)): revise-% :
 	@cd $(SRCDIR) && \
-- 
2.43.0
Loading