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 ms8.migadu.com with LMTPS id sEmGOZgz52X/GgAA62LTzQ:P1 (envelope-from ) for ; Tue, 05 Mar 2024 16:00:41 +0100 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 sEmGOZgz52X/GgAA62LTzQ (envelope-from ) for ; Tue, 05 Mar 2024 16:00:41 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=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"; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1709650840; 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=2FfYWsYWGuiMWpGQ8K0wQf7gXX6elBBHsn1/K25LRUY=; b=Ups3tW9bbBTmPIE4eLzuqX3nETIMa/gkzWDpbMUQOW6dbfxGpm0zJvSvGwZVglp7369RCm StsG2WaS1eGTz1ZE6nXX9+vV+oS/36KuAONTcOCUArwldKEoVW2pERvUcqgOiYC3czNT3Z dukSW1Du+C4eJr1xW8umrTppNLZLyUqqaEMxqeHBAo5NqD4BqOcTnQHm/ucFzydPqTy2kP 2N9YKhgTMNTCau3/FY8j2gEI7GYdvpJT5EwnOQI3cyjd2wKsJwGXGUe2mjb0Ee3V1kGti7 zp08cxKv01cgVNBs2NfbWIFgRscoX0YIrtuLdAGOgDbsmtCMVh9+EIs6C5sR8Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=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"; dmarc=none ARC-Seal: i=1; s=key1; d=yhetil.org; t=1709650840; a=rsa-sha256; cv=none; b=XBkHDPL29A2t6NbQfBaUdEnx2SH3DaCTTOLqUxW/OnZZzdzYWV2SIgK0U5xoyUBx99LkZ5 ESXEqIF9kly2hZscZT9XVmWpppWmtusDgByDhFzr1YVz3YA017QhZKehjPTajQceauoESt w8uh0SOOgScnNGUZ7QtX/5Isa+5+i6hoXP/ZqSlxGV8gYR/7F1n/ma7Kyg0rVSX29R7R1W 0ILyIzsE7PA2Pc5Djj59rIDFG1sjKhNWFuFl5TfPTElTgZbY5DTeidkIIY+DGkbTilaajZ AdRIfeqz+YgfQJ+PHrrqCcM70s9xKHP0NG+xXurzg5sA9RvX2TC1tYGDeQe4Uw== 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 7C6F3400F9 for ; Tue, 5 Mar 2024 16:00:40 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rhWGc-0003JM-N9; Tue, 05 Mar 2024 09:59:42 -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 1rhWGU-0003Ah-J1 for bug-guix@gnu.org; Tue, 05 Mar 2024 09:59:35 -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 1rhWGT-0004O6-PW for bug-guix@gnu.org; Tue, 05 Mar 2024 09:59:34 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rhWGw-0006V7-0D; Tue, 05 Mar 2024 10:00:02 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#57005: [PATCH v3] 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: Tue, 05 Mar 2024 15:00:01 +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.170965078424934 (code B ref 57005); Tue, 05 Mar 2024 15:00:01 +0000 Received: (at 57005) by debbugs.gnu.org; 5 Mar 2024 14:59:44 +0000 Received: from localhost ([127.0.0.1]:48590 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rhWGd-0006U5-Ia for submit@debbugs.gnu.org; Tue, 05 Mar 2024 09:59:44 -0500 Received: from mailgate5.ufz.de ([141.65.7.212]:43012 helo=mailgate.ufz.de) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rhWGZ-0006Tn-Mm for 57005@debbugs.gnu.org; Tue, 05 Mar 2024 09:59:42 -0500 Received: from imap.intranet.ufz.de (dcs1.intranet.ufz.de [141.65.125.135]) by mailgate.ufz.de (Mailgate5-UFZ) with ESMTP id 300311602D4 for <57005@debbugs.gnu.org>; Tue, 5 Mar 2024 15:59:03 +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 <0S9V00500QHGFR00@imap.intranet.ufz.de> for 57005@debbugs.gnu.org; Tue, 05 Mar 2024 15:59:03 +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 <0S9V00A2SQYD8T90@imap.intranet.ufz.de> for 57005@debbugs.gnu.org; Tue, 05 Mar 2024 15:59:01 +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 9AE95E0056; Tue, 5 Mar 2024 15:59:01 +0100 (CET) Date: Tue, 05 Mar 2024 15:58:13 +0100 From: Lars Bilke Message-id: <65e5bfc8e0e0580eb9c86e1cc0dc8bb89b286a7a.1709650693.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-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -4.77 X-Spam-Score: -4.77 X-Migadu-Queue-Id: 7C6F3400F9 X-Migadu-Scanner: mx11.migadu.com X-TUID: WO2FwclqyamD '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 | 46 +++++++++++++++++++----------------------- 1 file changed, 21 insertions(+), 25 deletions(-) diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm index 1f61ee0583..b828d5d5cb 100644 --- a/gnu/packages/maths.scm +++ b/gnu/packages/maths.scm @@ -3447,6 +3447,9 @@ (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) @@ -3455,30 +3458,34 @@ (define-public petsc (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) + (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* (find-files "." "^petsc(conf|machineinfo).h$") + (substitute* (find-files "." "petscmachineinfo.h") ;; Prevent build directory from leaking into compiled code (((getcwd)) out) - ;; Scrub timestamp for reproducibility - ((".*Libraries compiled on.*") "")) + ;; Scrub build machine characteristic + (("Machine characteristics: Linux-[0-9]+\\.[0-9]+\\.[0-9]+") + "Machine characteristics: Linux-x.x.x")) (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"))) + (("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")) (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)))) + ;; 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 +3497,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