From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id sBzfIegXnmawNwAA62LTzQ:P1 (envelope-from ) for ; Mon, 22 Jul 2024 08:27:20 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id sBzfIegXnmawNwAA62LTzQ (envelope-from ) for ; Mon, 22 Jul 2024 10:27:20 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; 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=1721636840; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: 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; bh=OFf7nFlkMEggU+ZkzW5Jysat7BGoEwC27AkGfOoPC4E=; b=g1/QsBG7mbyN4efDayL4MSHKhQQQd4/AQFO4kN+CQJaN4AInMDOEaBIiIt1F6KqdhtFXRp H/nDbKSvS5KfhV0aeLoh+M4aAl6de3SpHmbXxLWTuENNNhq2vnZe7ocREuL7wk6MaGq/h4 3cWXUvpapqpaXT3JA89ts6m+vNXsgRrQrGgYrhZr77Af3FDDcCT50sXigIMeAmcurJ/ZkF TZ+HJ7x/fRJ//QZt3FtkdWbs1t2Wm9V89ItdGtM5IiIvAPh2AiJFppiVjGOG7B1Uts52mt tNCloLGaO1ixXquQtCt0+RQT9K6JaioGcEKDYSL2Z3cxicYMZUS8CC44eDEpkw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1721636840; a=rsa-sha256; cv=none; b=kNQC6dLJF1W28A+61AFqLvjmuWukKt5QfCYPFWOevqOD4tt4YgXLMFNssoVqDEFiVVlSM3 nuU6KypeYEmaOF58xFVz3Il1wZUx2psdxDXFd+umsUj9OC4dU2QSFsCaIp8pv8tuRDRlDh tN36GVcISSANNhmPUif9Tbm8B6bcdmFe270R2RfOxuSHch57uxAs7Kq7xOIttIWKAJkE3b YecpBtDRjQe2eSinZGkPyXC8KdweJEqHd0m1oIHtyh+vOa5RPhh+jg/vwlv9xElCtJrhEk lsUqjKTQNLxvMqJU+W01xKKDTnpGer0ZUY8XxIsHswf/7Fneq6JFqoren0/H6Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; 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" 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 1538B39073 for ; Mon, 22 Jul 2024 10:27:20 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sVoNr-0004WC-3F; Mon, 22 Jul 2024 04:27:03 -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 1sVoNo-0004Vv-8N for guix-patches@gnu.org; Mon, 22 Jul 2024 04:27:00 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sVoNo-0005xA-0k for guix-patches@gnu.org; Mon, 22 Jul 2024 04:27:00 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sVoNq-00085y-78; Mon, 22 Jul 2024 04:27:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#71821] [PATCH v3] gnu: petsc: scrub build machine specifics References: In-Reply-To: Resent-From: Lars Bilke Original-Sender: "Debbugs-submit" Resent-CC: andreas@enge.fr, bavier@posteo.net, sharlatanus@gmail.com, guix-patches@gnu.org Resent-Date: Mon, 22 Jul 2024 08:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71821 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 71821@debbugs.gnu.org Cc: Lars Bilke , Andreas Enge , Eric Bavier , Sharlatan Hellseher X-Debbugs-Original-Xcc: Andreas Enge , Eric Bavier , Sharlatan Hellseher Received: via spool by 71821-submit@debbugs.gnu.org id=B71821.172163680031080 (code B ref 71821); Mon, 22 Jul 2024 08:27:02 +0000 Received: (at 71821) by debbugs.gnu.org; 22 Jul 2024 08:26:40 +0000 Received: from localhost ([127.0.0.1]:56803 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sVoNT-00085D-Pq for submit@debbugs.gnu.org; Mon, 22 Jul 2024 04:26:40 -0400 Received: from mailgate4.ufz.de ([141.65.7.211]:54468 helo=mailgate.ufz.de) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sVoNQ-00084w-UH for 71821@debbugs.gnu.org; Mon, 22 Jul 2024 04:26:37 -0400 Received: from imap.intranet.ufz.de (dcs1.intranet.ufz.de [141.65.125.135]) by mailgate.ufz.de (Mailgate4-UFZ) with ESMTP id F168C1602BE for <71821@debbugs.gnu.org>; Mon, 22 Jul 2024 10:26:27 +0200 (CEST) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: TEXT/PLAIN Received: from conversion-daemon.imap.intranet.ufz.de by imap.intranet.ufz.de (Oracle Communications Messaging Server 8.0.2.6.20200227 64bit (built Feb 27 2020)) id <0SH000C00LOAU200@imap.intranet.ufz.de> for 71821@debbugs.gnu.org; Mon, 22 Jul 2024 10:26:27 +0200 (CEST) Received: from smtp1.ufz.de ([141.65.7.216]) by imap.intranet.ufz.de (Oracle Communications Messaging Server 8.0.2.6.20200227 64bit (built Feb 27 2020)) with ESMTPS id <0SH000GYWNG3GD00@imap.intranet.ufz.de> for 71821@debbugs.gnu.org; Mon, 22 Jul 2024 10:26:27 +0200 (CEST) Received: from envinf4.minotaur-alpha.ts.net (unknown [141.65.34.85]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp1.ufz.de (smtp1-UFZ) with ESMTPSA id CAA8F8001A; Mon, 22 Jul 2024 10:26:27 +0200 (CEST) Date: Mon, 22 Jul 2024 10:25:47 +0200 From: Lars Bilke Message-id: <891ca7832b5e73ee35d277ad1f7fe0f070dace8b.1721636747.git.lars.bilke@ufz.de> X-Mailer: git-send-email 2.44.0 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: , 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 X-Migadu-Spam-Score: -1.91 X-Spam-Score: -1.91 X-Migadu-Queue-Id: 1538B39073 X-Migadu-Scanner: mx11.migadu.com X-TUID: Jowi305TuVUs Resending patch because of CI failure. 'Libraries compiled on' does not have to be removed since PETSc 3.9: https: //gitlab.com/petsc/petsc/-/commit/a970bd748978a4e12790be7c36b10e832ec0149f Also merged all add-after 'install phases into `clean-install. Change-Id: I41d82339e43187d7dc7e3fc189a338784c363c68 sort source files in generated makefiles for reproducibility Change-Id: I86e5b9cd0d7184019617bd8ae9a23eaf459891d7 --- gnu/packages/maths.scm | 56 ++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 32 deletions(-) diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index 1265ae13e9..decc7ee67e 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -3545,38 +3545,41 @@ (define-public petsc (let* ((prefix (assoc-ref outputs "out")) (flags `(,(string-append "--prefix=" prefix) ,@configure-flags))) + ;; sort source files in configure (for reproducibility) + (substitute* "config/gmakegen.py" + (("join\\(srcs\\[lang\\]\\)") "join(sorted(srcs[lang]))")) (format #t "build directory: ~s~%" (getcwd)) (format #t "configure flags: ~s~%" flags) (apply invoke "./configure" flags) - + ;; Prevent build directory Linux version from leaking into + ;; compiled code + (substitute* (find-files "." "petscmachineinfo.h") + (((getcwd)) out) + ;; Scrub build machine characteristic + (("Machine characteristics: Linux-[0-9]+\\.[0-9]+\\.[0-9]+") + "Machine characteristics: Linux-x.x.x")) ;; Generate test scripts with the right shebang. (substitute* "config/example_template.py" (("#!/usr/bin/env bash") (string-append "#!" (which "bash"))))))) - (add-after 'configure 'clean-local-references - (lambda* (#:key outputs #:allow-other-keys) - (let ((out (assoc-ref outputs "out"))) - (substitute* (find-files "." "^petsc(conf|machineinfo).h$") - ;; Prevent build directory from leaking into compiled code - (((getcwd)) out) - ;; Scrub timestamp for reproducibility - ((".*Libraries compiled on.*") "")) - (substitute* (find-files "." "petscvariables") - ;; Do not expose build machine characteristics, set to defaults. - (("MAKE_NP = [:digit:]+") "MAKE_NP = 2") - (("NPMAX = [:digit:]+") "NPMAX = 2"))))) (add-after 'install 'clean-install - ;; Try to keep installed files from leaking build directory names. (lambda* (#:key inputs outputs #:allow-other-keys) (let ((out (assoc-ref outputs "out"))) - (substitute* (map (lambda (file) - (string-append out "/lib/petsc/conf/" file)) - '("petscvariables")) - (((getcwd)) out)) - ;; Make compiler references point to the store (substitute* (string-append out "/lib/petsc/conf/petscvariables") - (("= (gcc|g\\+\\+|gfortran)" _ compiler) - (string-append "= " (which compiler)))) + ;; Try to keep installed files from leaking build directory names. + (((getcwd)) out) + ;; Do not expose build machine characteristics, set to defaults. + (("MAKE_NP = [[:digit:]]+") "MAKE_NP = 2") + (("MAKE_TEST_NP = [[:digit:]]+") "MAKE_TEST_NP = 2") + (("MAKE_LOAD = [[:digit:]]+\\.[[:digit:]]+") "MAKE_LOAD = 2.0") + (("NPMAX = [[:digit:]]+") "NPMAX = 2") + ;; Do not retain a reference to GCC and other build only inputs. + (("([[:graph:]]+)/bin/gcc") "gcc") + (("([[:graph:]]+)/bin/g\\+\\+") "g++") + (("([[:graph:]]+)/bin/make") "make") + (("([[:graph:]]+)/bin/diff") "diff") + (("([[:graph:]]+)/bin/sed") "sed") + (("([[:graph:]]+)/bin/gfortran") "gfortran")) ;; PETSc installs some build logs, which aren't necessary. (for-each (lambda (file) (let ((f (string-append out "/lib/petsc/conf/" file))) @@ -3588,17 +3591,6 @@ (define-public petsc "configure-hash" ;; Once installed, should uninstall with Guix "uninstall.py"))))) - (add-after 'clean-install 'clear-reference-to-compiler - (lambda* (#:key inputs outputs #:allow-other-keys) - ;; Do not retain a reference to GCC and other build only inputs. - (let ((out (assoc-ref outputs "out"))) - (substitute* (string-append out "/lib/petsc/conf/petscvariables") - (("([[:graph:]]+)/bin/gcc") "gcc") - (("([[:graph:]]+)/bin/g\\+\\+") "g++") - (("([[:graph:]]+)/bin/make") "make") - (("([[:graph:]]+)/bin/diff") "diff") - (("([[:graph:]]+)/bin/sed") "sed") - (("([[:graph:]]+)/bin/gfortran") "gfortran"))))) (add-after 'install 'move-examples (lambda* (#:key outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out")) base-commit: e5c0b62debc6f48a32a65736d9ba3da0b1e59cb9 -- 2.44.0