lean4: 4.18.0 -> 4.19.0

Release notes:
- https://github.com/leanprover/lean4/releases/tag/v4.19.0
- https://github.com/leanprover/lean4/releases/tag/v4.19.0-rc3
- https://github.com/leanprover/lean4/releases/tag/v4.19.0-rc2
- https://github.com/leanprover/lean4/releases/tag/v4.19.0-rc1

jthulhu 0ee203fa 669deec7

+50 -9
+16
pkgs/by-name/le/lean4/mimalloc.patch
··· 1 + --- a/CMakeLists.txt 2 + +++ b/CMakeLists.txt 3 + @@ -77,12 +77,8 @@ 4 + if (USE_MIMALLOC) 5 + ExternalProject_add(mimalloc 6 + PREFIX mimalloc 7 + - GIT_REPOSITORY https://github.com/microsoft/mimalloc 8 + - GIT_TAG v2.2.3 9 + - # just download, we compile it as part of each stage as it is small 10 + - CONFIGURE_COMMAND "" 11 + - BUILD_COMMAND "" 12 + + SOURCE_DIR "MIMALLOC-SRC" 13 + INSTALL_COMMAND "") 14 + list(APPEND EXTRA_DEPENDS mimalloc) 15 + endif() 16 +
+34 -9
pkgs/by-name/le/lean4/package.nix
··· 8 8 cadical, 9 9 pkg-config, 10 10 libuv, 11 + enableMimalloc ? true, 11 12 perl, 12 13 testers, 13 14 }: 14 15 15 16 stdenv.mkDerivation (finalAttrs: { 16 17 pname = "lean4"; 17 - version = "4.18.0"; 18 + version = "4.19.0"; 19 + 20 + # Using a vendored version rather than nixpkgs' version to match the exact version required by 21 + # Lean. Apparently, even a slight version change can impact greatly the final performance. 22 + mimalloc-src = fetchFromGitHub { 23 + owner = "microsoft"; 24 + repo = "mimalloc"; 25 + tag = "v2.2.3"; 26 + hash = "sha256-B0gngv16WFLBtrtG5NqA2m5e95bYVcQraeITcOX9A74="; 27 + }; 18 28 19 29 src = fetchFromGitHub { 20 30 owner = "leanprover"; 21 31 repo = "lean4"; 22 32 tag = "v${finalAttrs.version}"; 23 - hash = "sha256-1hVcRO9RbVUgoKTUTFXBqJZwt50/aw/P9dxUdI7RpCc="; 33 + hash = "sha256-Iw5JSamrty9l6aJ2WwslAolSHfi2q0UO8P8HI1gp+j8="; 24 34 }; 25 35 26 - postPatch = '' 27 - substituteInPlace src/CMakeLists.txt \ 28 - --replace-fail 'set(GIT_SHA1 "")' 'set(GIT_SHA1 "${finalAttrs.src.tag}")' 36 + postPatch = 37 + let 38 + pattern = "\${LEAN_BINARY_DIR}/../mimalloc/src/mimalloc"; 39 + in 40 + '' 41 + substituteInPlace src/CMakeLists.txt \ 42 + --replace-fail 'set(GIT_SHA1 "")' 'set(GIT_SHA1 "${finalAttrs.src.tag}")' 29 43 30 - # Remove tests that fails in sandbox. 31 - # It expects `sourceRoot` to be a git repository. 32 - rm -rf src/lake/examples/git/ 33 - ''; 44 + # Remove tests that fails in sandbox. 45 + # It expects `sourceRoot` to be a git repository. 46 + rm -rf src/lake/examples/git/ 47 + '' 48 + + (lib.optionalString enableMimalloc '' 49 + substituteInPlace CMakeLists.txt \ 50 + --replace-fail 'MIMALLOC-SRC' '${finalAttrs.mimalloc-src}' 51 + for file in src/CMakeLists.txt src/runtime/CMakeLists.txt; do 52 + substituteInPlace "$file" \ 53 + --replace-fail '${pattern}' '${finalAttrs.mimalloc-src}' 54 + done 55 + ''); 34 56 35 57 preConfigure = '' 36 58 patchShebangs stage0/src/bin/ src/bin/ ··· 52 74 perl 53 75 ]; 54 76 77 + patches = [ ./mimalloc.patch ]; 78 + 55 79 cmakeFlags = [ 56 80 "-DUSE_GITHASH=OFF" 57 81 "-DINSTALL_LICENSE=OFF" 82 + "-DUSE_MIMALLOC=${if enableMimalloc then "ON" else "OFF"}" 58 83 ]; 59 84 60 85 passthru.tests = {