From c60afb9cbe3390e7b57f1dd553774e79864cea4d Mon Sep 17 00:00:00 2001 From: "Matthew \"strager\" Glazar" Date: Sat, 18 Mar 2023 00:53:44 -0700 Subject: sapling: fix build Nixpkgs commit 451c6321 upgraded setuptools from version 65.0.3 to version 67.4.0. This upgrade introduced a breaking change in setuptools [1] which causes the Sapling package's build to fail: setuptools.extern.packaging.version.InvalidVersion: Invalid version: '0.2.20230124-180750-hf8cd450a' This is an upstream issue [2]. For now, work around this issue in Nixpkgs by truncating Sapling's version number. Before 451c6321: $ nix-env -q sapling sapling-0.2.20230228-144002-h9440b05e $ sl --version Sapling 0.2.20230228-144002-h9440b05e After this patch: $ nix-env -q sapling sapling-0.2.20230228-144002-h9440b05e $ sl --version Sapling 0.2.20230228 Refs: 451c63214766d3bb8d078620cff4dc74463c5bc8 [1] https://github.com/pypa/setuptools/blob/be6c0218bcba78dbd4ea0b5a8bb9acd5d5306240/CHANGES.rst#v6600 [2] https://github.com/facebook/sapling/issues/571 --- pkgs/applications/version-management/sapling/default.nix | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'pkgs/applications/version-management/sapling') diff --git a/pkgs/applications/version-management/sapling/default.nix b/pkgs/applications/version-management/sapling/default.nix index 4028c41232ff1..222d77ca71636 100644 --- a/pkgs/applications/version-management/sapling/default.nix +++ b/pkgs/applications/version-management/sapling/default.nix @@ -166,15 +166,20 @@ python3Packages.buildPythonApplication { HGNAME = "sl"; SAPLING_OSS_BUILD = "true"; - SAPLING_VERSION = version; SAPLING_VERSION_HASH = versionHash; + # Python setuptools version 66 and newer does not support upstream Sapling's + # version numbers (e.g. "0.2.20230124-180750-hf8cd450a"). Change the version + # number to something supported by setuptools (e.g. "0.2.20230124"). + # https://github.com/facebook/sapling/issues/571 + SAPLING_VERSION = builtins.elemAt (builtins.split "-" version) 0; + # just a simple check phase, until we have a running test suite. this should # help catch issues like lack of a LOCALE_ARCHIVE setting (see GH PR #202760) doCheck = true; installCheckPhase = '' - echo -n "testing sapling version; should be \"${version}\"... " - $out/bin/sl version | grep -qw "${version}" + echo -n "testing sapling version; should be \"$SAPLING_VERSION\"... " + $out/bin/sl version | grep -qw "$SAPLING_VERSION" echo "OK!" ''; -- cgit 1.4.1