From 0ce32a5a5cc966d88bf52551c52ac66621176c4b Mon Sep 17 00:00:00 2001 From: euxane Date: Mon, 8 Jul 2024 20:10:07 +0200 Subject: [PATCH 1/3] mercurial: 6.7.4 -> 6.8 This release also fixes Rust support with Python 3.12, allowing us to re-enable rustSupport for that version of Python. Changelog: https://wiki.mercurial-scm.org/Release6.8 --- .../version-management/mercurial/default.nix | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pkgs/applications/version-management/mercurial/default.nix b/pkgs/applications/version-management/mercurial/default.nix index 5057e725010e..feb7a77a6af9 100644 --- a/pkgs/applications/version-management/mercurial/default.nix +++ b/pkgs/applications/version-management/mercurial/default.nix @@ -1,8 +1,6 @@ { lib, stdenv, fetchurl, python3Packages, makeWrapper, gettext, installShellFiles , re2Support ? true -# depends on rust-cpython which won't support python312 -# https://github.com/dgrunwald/rust-cpython/commit/e815555629e557be084813045ca1ddebc2f76ef9 -, rustSupport ? (stdenv.hostPlatform.isLinux && python3Packages.pythonOlder "3.12"), cargo, rustPlatform, rustc +, rustSupport ? stdenv.hostPlatform.isLinux, cargo, rustPlatform, rustc , fullBuild ? false , gitSupport ? fullBuild , guiSupport ? fullBuild, tk @@ -23,11 +21,11 @@ let self = python3Packages.buildPythonApplication rec { pname = "mercurial${lib.optionalString fullBuild "-full"}"; - version = "6.7.4"; + version = "6.8"; src = fetchurl { url = "https://mercurial-scm.org/release/mercurial-${version}.tar.gz"; - hash = "sha256-dHCPhzQFwSJy/sEWxt1Shi6O0RwQARx+V19eqBJj6l4="; + hash = "sha256-COTQ5dqK8RMrUea8M1AYCtV63Nk18Je20LwRmiwsChA="; }; format = "other"; @@ -37,7 +35,7 @@ let cargoDeps = if rustSupport then rustPlatform.fetchCargoTarball { inherit src; name = "mercurial-${version}"; - hash = "sha256-FRa7frX2z9jQGFBXS2TpOUANs0+xwegNETUAQIU0S4o="; + hash = "sha256-mP82UtASD0Fh8ilDDCB6ubY7/MGPoRP6hg6/xRwzwAw="; sourceRoot = "mercurial-${version}/rust"; } else null; cargoRoot = if rustSupport then "rust" else null; From 47f435dbbf023caa27bbd5b955d3286fb700c32a Mon Sep 17 00:00:00 2001 From: euxane Date: Sun, 14 Jul 2024 15:06:18 +0200 Subject: [PATCH 2/3] mercurial: add setuptools' distutils to test env The distutils module is required for the test suite to run. Upstream issue: https://bz.mercurial-scm.org/show_bug.cgi?id=6887 --- .../version-management/mercurial/default.nix | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/version-management/mercurial/default.nix b/pkgs/applications/version-management/mercurial/default.nix index feb7a77a6af9..7cdacd4c6f4f 100644 --- a/pkgs/applications/version-management/mercurial/default.nix +++ b/pkgs/applications/version-management/mercurial/default.nix @@ -17,7 +17,7 @@ }: let - inherit (python3Packages) docutils python fb-re2 pygit2 pygments; + inherit (python3Packages) docutils python fb-re2 pygit2 pygments setuptools; self = python3Packages.buildPythonApplication rec { pname = "mercurial${lib.optionalString fullBuild "-full"}"; @@ -43,7 +43,7 @@ let propagatedBuildInputs = lib.optional re2Support fb-re2 ++ lib.optional gitSupport pygit2 ++ lib.optional highlightSupport pygments; - nativeBuildInputs = [ makeWrapper gettext installShellFiles python3Packages.setuptools ] + nativeBuildInputs = [ makeWrapper gettext installShellFiles setuptools ] ++ lib.optionals rustSupport [ rustPlatform.cargoSetupHook cargo @@ -112,6 +112,9 @@ let gnupg ]; + # https://bz.mercurial-scm.org/show_bug.cgi?id=6887 + propagatedBuildInputs = [ setuptools ]; + postPatch = '' patchShebangs . @@ -125,6 +128,12 @@ let --replace '*/hg:' '*/*hg*:' \${/* paths emitted by our wrapped hg look like ..hg-wrapped-wrapped */""} --replace '"$PYTHON" "$BINDIR"/hg' '"$BINDIR"/hg' ${/* 'hg' is a wrapper; don't run using python directly */""} done + + # https://bz.mercurial-scm.org/show_bug.cgi?id=6887 + # Adding setuptools to the python path is not enough for the distutils + # module to be found, so we patch usage directly: + substituteInPlace tests/hghave.py \ + --replace-fail "distutils" "setuptools._distutils" ''; # This runs Mercurial _a lot_ of times. From a01e0a2617246944f44ed55d527630c99f57846d Mon Sep 17 00:00:00 2001 From: euxane Date: Tue, 16 Jul 2024 11:37:16 +0200 Subject: [PATCH 3/3] mercurial: skip some tests broken with python 3.12 --- .../version-management/mercurial/default.nix | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/pkgs/applications/version-management/mercurial/default.nix b/pkgs/applications/version-management/mercurial/default.nix index 7cdacd4c6f4f..f60813a7eea6 100644 --- a/pkgs/applications/version-management/mercurial/default.nix +++ b/pkgs/applications/version-management/mercurial/default.nix @@ -163,6 +163,21 @@ let # Python 3.10-3.12 deprecation warning: asyncore # https://bz.mercurial-scm.org/show_bug.cgi?id=6727 test-patchbomb-tls.t + + # Python 3.12 _lsprof module change, breaking profile test + # https://bz.mercurial-scm.org/show_bug.cgi?id=6846 + test-profile.t + + # Python 3.12 deprecation warning: multi-threaded fork in worker.py + # https://bz.mercurial-scm.org/show_bug.cgi?id=6892 + test-clone-stream.t + test-clonebundles.t + test-fix-topology.t + test-fix.t + test-persistent-nodemap.t + test-profile.t + test-simple-update.t + EOF export HGTEST_REAL_HG="${mercurial}/bin/hg"