From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id cEEEE23lR2RPNQAASxT56A (envelope-from ) for ; Tue, 25 Apr 2023 16:36:29 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 4P/9Em3lR2QF7wAA9RJhRA (envelope-from ) for ; Tue, 25 Apr 2023 16:36:29 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id A3D3E1F63D for ; Tue, 25 Apr 2023 16:36:28 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1prJm4-0002Me-Nn; Tue, 25 Apr 2023 10:36:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1prJly-0002HJ-Li for guix-patches@gnu.org; Tue, 25 Apr 2023 10:36:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1prJly-0007KB-E6 for guix-patches@gnu.org; Tue, 25 Apr 2023 10:36:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1prJlx-0000FV-Ui for guix-patches@gnu.org; Tue, 25 Apr 2023 10:36:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63044] [PATCH v2] gnu: python: Disable date checking in bdist_egg.py References: <87ildm3zf6.fsf@psyduck.jhoto.kublai.com> In-Reply-To: <87ildm3zf6.fsf@psyduck.jhoto.kublai.com> Resent-From: Brian Cully Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 25 Apr 2023 14:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63044 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63044@debbugs.gnu.org Cc: Brian Cully Received: via spool by 63044-submit@debbugs.gnu.org id=B63044.1682433348929 (code B ref 63044); Tue, 25 Apr 2023 14:36:01 +0000 Received: (at 63044) by debbugs.gnu.org; 25 Apr 2023 14:35:48 +0000 Received: from localhost ([127.0.0.1]:53338 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1prJlj-0000Ev-Va for submit@debbugs.gnu.org; Tue, 25 Apr 2023 10:35:48 -0400 Received: from coleridge.kublai.com ([166.84.7.167]:50290 helo=mail.spork.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1prJlh-0000Ei-QO for 63044@debbugs.gnu.org; Tue, 25 Apr 2023 10:35:47 -0400 Received: from psyduck.jhoto.kublai.com (ool-18b8e9e7.dyn.optonline.net [24.184.233.231]) by mail.spork.org (Postfix) with ESMTPSA id 539079014; Tue, 25 Apr 2023 10:35:45 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=spork.org; s=dkim; t=1682433345; bh=GeIxMVo84lrwdULacoXCEDXeCwMRw1wqlysh+WJlYA0=; h=From:To:Cc:Subject:Date; b=qIrVKx54JyxwSku1vnH0GrZemWlsvy9ZEJD5s2qdQ1iUnJso/C+a8iHerIme6ROs7 pV69fq3T3QrQ7MsDMYDML6hsBS5lpwypLiXXhPe41JRxBBX7z3U5Z1KTNLsGkKCglN mozc0ppIrbRncD6iND8+ebscfDPcGu4TKLNsnUO4= Date: Tue, 25 Apr 2023 10:35:31 -0400 Message-Id: <4c971471e09fa2a57ac26b701f8b8e224899b86e.1682433331.git.bjc@spork.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Brian Cully X-ACL-Warn: , Brian Cully via Guix-patches From: Brian Cully via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Seal: i=1; s=key1; d=yhetil.org; t=1682433389; a=rsa-sha256; cv=none; b=mit5/ek11F46AuHxqw3saDtYrNOsLowXxm02zRyayzsMKdkxHAqBN9soPDH5/EZdUOoRn6 9YXqvWxuYTspdlXkYiftg1EbG7oM97qc88AL7C1NFsN8X7dthYFrln8Z/jpwUppk5FGmzV KGrCj/L8ui+i9WvJiSPg4MqWwNO5OzaRNWwrddAVFgWsERnY3cC9bjigVoE6Yozj+aKwRc vf5gveeSjem5p2L16OPq/vxHxEIKQxVTlIeE8gGtaaagamhNZymESHyOH2VmNgNpq0TvWF hWVWXTCOclqTP46E+Zjeu761weGiolShy8Bu6DoQaVNn39jdkYmCAKdtruhx4A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=spork.org header.s=dkim header.b=qIrVKx54; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1682433389; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=9PMxUIhxoP3x61wwa9cSSxvKisFSNJjhaBUlZ4iOCS4=; b=UvFaVwOMDtirwPn0ETqNfkIz6pAnFSD41NYr3vlnRWXXb8QBgSrhbY/opRPCKtwV5KbRin 123nyrMDDFfKPvXMC+16YEEao1j0Ap6CuDlHfYnFtP4PjgVEOm1pEu1T2j0POVNm/5gJvh kQSG3YFj7dfgqJANBrps6nCvAg3q8v0mWqRHPrYT/h+yUlkm+eFCT68c7umbIJGpvq7UMq A3n+mC7rpsa3DgTpqJ06tU1/+Pv0PiUTCppJ8ylofCgoHPMd3/YN7wqGsakLvPSWMgjgNf WhMVhAD2lXM7eLyUzTFGqZEsjYg8rY0w2rxGM32AMnUHf0Ps4LZ8o0NP9u35Vw== X-Migadu-Scanner: scn1.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=spork.org header.s=dkim header.b=qIrVKx54; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -3.21 X-Spam-Score: -3.21 X-Migadu-Queue-Id: A3D3E1F63D X-TUID: KQcnIO4NhD/h This fixes errors when packing Python eggs, where ZipFile fails due to Guix setting file timestamps to 0 epoch seconds, where ZipFile wants all files to date from at least 1980. * gnu/packages/python-build.scm (python-setuptools) [disable-zipfile-date-check]: new phase * gnu/packages/python.scm (python-3.10) [disable-zipfile-date-check]: new phase --- gnu/packages/python-build.scm | 16 +++++++++++++++- gnu/packages/python.scm | 25 +++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/gnu/packages/python-build.scm b/gnu/packages/python-build.scm index 70719c44d4..d9f6f5beff 100644 --- a/gnu/packages/python-build.scm +++ b/gnu/packages/python-build.scm @@ -299,7 +299,21 @@ (define-public python-setuptools (build-system python-build-system) ;; FIXME: Tests require pytest, which itself relies on setuptools. ;; One could bootstrap with an internal untested setuptools. - (arguments (list #:tests? #f)) + (arguments + (list + #:tests? #f + #:phases + #~(modify-phases %standard-phases + ;; Disable the check which requires files to be dated from at least + ;; 1980. + ;; + ;; This phase is also in the base python package, as it includes its + ;; own setuptools. + (add-after 'unpack 'disable-zipfile-date-check + (lambda _ + (substitute* "setuptools/command/bdist_egg.py" + (("zipfile.ZipFile\\(zip_filename, mode, compression=compression\\)") + "zipfile.ZipFile(zip_filename, mode, compression=compression, strict_timestamps=False)"))))))) (home-page "https://pypi.org/project/setuptools/") (synopsis "Library designed to facilitate packaging Python projects") (description "Setuptools is a fully-featured, stable library designed to diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index bfe8a68352..8e30fc127a 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -518,6 +518,31 @@ (define-public python-3.10 (find-files "." #:directories? #t)))) (delete-file-recursively dir))) (find-files "Lib/ensurepip" "\\.whl$")))) + (add-after 'unpack 'disable-zipfile-date-check + (lambda _ + ;; Disable pre-1980 check in setuptools, because Guix mostly + ;; sets timestamps to 0 epoch seconds when building. + ;; + ;; This phase is also included in the python-setuptools + ;; package. + (let ((dir "whl-content") + (circa-1980 (* 10 366 24 60 60)) + (setuptools-whl "../Lib/ensurepip/_bundled/setuptools-63.2.0-py3-none-any.whl")) + (mkdir-p dir) + (with-directory-excursion dir + (invoke "unzip" setuptools-whl) + (substitute* "setuptools/command/bdist_egg.py" + (("zipfile.ZipFile\\(zip_filename, mode, compression=compression\\)") + "zipfile.ZipFile(zip_filename, mode, compression=compression, strict_timestamps=False)")) + (delete-file setuptools-whl) + ;; Reset timestamps to prevent them from ending + ;; up in the Zip archive. + (ftw "." (lambda (file stat flag) + (utime file circa-1980 circa-1980) + #t)) + (apply invoke "zip" "-X" setuptools-whl + (find-files "." #:directories? #t))) + (delete-file-recursively dir)))) (add-before 'check 'set-TZDIR (lambda* (#:key inputs native-inputs #:allow-other-keys) ;; test_email requires the Olson time zone database. -- 2.39.2