From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id 2Cs7LwhZ6GXdWwAA62LTzQ:P1 (envelope-from ) for ; Wed, 06 Mar 2024 12:52:40 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id 2Cs7LwhZ6GXdWwAA62LTzQ (envelope-from ) for ; Wed, 06 Mar 2024 12:52:40 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1709725960; 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=YwezQ58CYcCvgv3c0lVRy0yEq5mIyqbVch8ogDeCx8c=; b=CT6B7lzyE+5jcao/0eh46ofxmWs/5LeV1yQzZj5b6qKNV5mnlX7jWC/8oAb0z1hvu6Sbs/ //18kontzYFTO4DOR/f8aTkXBfGKkYBGbk7WZzDDy1YJs6pJflW2ckNn/gmCdDIKIPbhHM 74HRDbqIxAyr6eb7/dAp7L803JyxGzMe9o1+IqnKH6lNEnPtSGD/FOBtTSCa4N2aacq9KH G8ycjmvYw66aBD1iWBBPbM/HKqY/aQkkY4jNMQxVdDv7LJ7XMzwtfHsQe7PACKkVr+rMxW fF7qHARhcXH3OEDf3+ua1qwB5BzWnTK2Auo0ZM07emyBUKzvB+y7VdHIIElDng== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1709725960; a=rsa-sha256; cv=none; b=oenr0zo3yaOexFeS+HAgqSmQgD1Z83+ld+NlbUIHBZxMnAxGmc6tkpVZvvxaTFYju8AlOo Z3E+lfabHL1OWrlTUbQ15isO/mEzsCWxahUz2ntewTh4oBlhXDbt8/zrWuDjJhNkY7bdaA Z3qGOxM3onf8w+1RGwMIIVmF8O3CHmcgssKN4fJEgWXD+fisiknZGS2qbdo/P4PPOcJIz9 F9tvi3tGtf7kFo+7NMUbfUAyxuVN5MyLNju2HkzqQka65I10LCAurVJp+COgPPD36Yy5Y0 YPBpWnisYpURYb0vt+dDtlP0nm6NFAlGe3WxUstVn0Pz3+JZ3m+GB1gNl+1CSw== 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 7403A512CB for ; Wed, 6 Mar 2024 12:52:40 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rhpp4-0006Ko-LT; Wed, 06 Mar 2024 06:52:34 -0500 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 1rhpp2-0006KQ-AP for bug-guix@gnu.org; Wed, 06 Mar 2024 06:52:32 -0500 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 1rhpp2-0001jG-2b for bug-guix@gnu.org; Wed, 06 Mar 2024 06:52:32 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rhppW-0006ke-8k; Wed, 06 Mar 2024 06:53:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#57005: [PATCH v4] gnu: petsc: scrub build machine specifics References: <87fsiag2vm.fsf@inria.fr> In-Reply-To: <87fsiag2vm.fsf@inria.fr> Resent-From: Lars Bilke Original-Sender: "Debbugs-submit" Resent-CC: andreas@enge.fr, bavier@posteo.net, sharlatanus@gmail.com, bug-guix@gnu.org Resent-Date: Wed, 06 Mar 2024 11:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57005 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 57005@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 57005-submit@debbugs.gnu.org id=B57005.170972594825901 (code B ref 57005); Wed, 06 Mar 2024 11:53:02 +0000 Received: (at 57005) by debbugs.gnu.org; 6 Mar 2024 11:52:28 +0000 Received: from localhost ([127.0.0.1]:49929 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rhpoy-0006jg-6q for submit@debbugs.gnu.org; Wed, 06 Mar 2024 06:52:28 -0500 Received: from mailgate5.ufz.de ([141.65.7.212]:52748 helo=mailgate.ufz.de) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rhpov-0006jS-L2 for 57005@debbugs.gnu.org; Wed, 06 Mar 2024 06:52:26 -0500 Received: from imap.intranet.ufz.de (dcs1.intranet.ufz.de [141.65.125.135]) by mailgate.ufz.de (Mailgate5-UFZ) with ESMTP id 6D6571602C4 for <57005@debbugs.gnu.org>; Wed, 6 Mar 2024 12:51:48 +0100 (CET) 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 <0S9X00L00CVLWZ00@imap.intranet.ufz.de> for 57005@debbugs.gnu.org; Wed, 06 Mar 2024 12:51:48 +0100 (CET) Received: from smtp2.ufz.de ([141.65.7.217]) by imap.intranet.ufz.de (Oracle Communications Messaging Server 8.0.2.6.20200227 64bit (built Feb 27 2020)) with ESMTPS id <0S9X00E7ECYCUJF0@imap.intranet.ufz.de> for 57005@debbugs.gnu.org; Wed, 06 Mar 2024 12:51:48 +0100 (CET) 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 ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp2.ufz.de (smtp2-UFZ) with ESMTPSA id 3B806E005C; Wed, 6 Mar 2024 12:51:48 +0100 (CET) Date: Wed, 06 Mar 2024 12:51:14 +0100 From: Lars Bilke Message-id: <8d1edc3769b3994fc2a7be34470509e7f45aee31.1709725874.git.lars.bilke@ufz.de> X-Mailer: git-send-email 2.43.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -4.77 X-Spam-Score: -4.77 X-Migadu-Queue-Id: 7403A512CB X-Migadu-Scanner: mx13.migadu.com X-TUID: 5kt2pklHVuNH '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 1f61ee0583..1ea5ccee74 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -3447,38 +3447,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))) @@ -3490,17 +3493,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: 75bad75367fcf2c289fae3b40dbcc850f92177be -- 2.43.0