[PATCH] gnu: petsc: make it reproducible

  • Done
  • quality assurance status badge
Details
2 participants
  • Lars Bilke
  • Ludovic Courtès
Owner
unassigned
Submitted by
Lars Bilke
Severity
normal

Debbugs page

Lars Bilke wrote 8 months ago
(address . guix-patches@gnu.org)(name . Lars Bilke)(address . lars.bilke@ufz.de)
d580228f33d99676e3df5f5c48f437d63f00b53b.1719578824.git.lars.bilke@ufz.de

scrub build machine specifics.

'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(-)

Toggle diff (311 lines)
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index de8e886485..8ab18cedf2 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -3544,38 +3544,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)))
@@ -3587,17 +3590,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
prerequisite-patch-id: 91bc4ece6056a806ab1f22c91c5bfcdb3e3477e7
prerequisite-patch-id: cb6b1658d1265fc0e2a2f87896b3e5037ad06595
prerequisite-patch-id: 852bbc7fd0b58468c928750218c875af0c475972
prerequisite-patch-id: bc93cf0b0dc7a5f0351b0173217decfac936ce3a
prerequisite-patch-id: 9d600fa6670e287da065b669506f0e86f38f4cc7
prerequisite-patch-id: de58a4d3fa97531dbf321587cf82d30fff653475
prerequisite-patch-id: 576bbca95b22a3e14603f7e753431f101e904ffd
prerequisite-patch-id: 3111672f712097450a986fb15e3f21c5883a19f8
prerequisite-patch-id: 0bf3fd7744b62f1365d1f7f4f40945b25ec4a411
prerequisite-patch-id: 26c272a8b01f9bfb0eaaeca9794c41c78e06e238
prerequisite-patch-id: e40f8185d71ae39c18d60758c0f16e798345baa4
prerequisite-patch-id: 2dae78c48a3794748522e81ca2a7d1afea8b7c73
prerequisite-patch-id: 0893ebf03179178b0d737f7d0937415cd4503f61
prerequisite-patch-id: e40725d68b213e154eb70290beaf57a8a714ec22
prerequisite-patch-id: c1d2e8e58fd76b01a23742aeec499a27d935e6a4
prerequisite-patch-id: d410e5858cded60e10dafd869b42f4b627809715
prerequisite-patch-id: 2e1280a7ae0834cca05796862a9fbc2640b0c4f7
prerequisite-patch-id: f189ad4e6b0ee23584e7162302b761e79c6418e5
prerequisite-patch-id: 1fa905e283038be3ad0d70ece409724604537114
prerequisite-patch-id: 68e20d3c9b71ebb62674ce940e64af49dc078b46
prerequisite-patch-id: e5b8db684dd87151f509ee8b4d298ca44a7f7bb6
prerequisite-patch-id: bda95ae8454e58e5b05a30ad6b5e3867cc4b8730
prerequisite-patch-id: 48230fc52c087d4528329a55e308fc00291956db
prerequisite-patch-id: c3d7e3583e5adcb45234cb7cc8b3f81e4afd64c0
prerequisite-patch-id: fe5a816e516953e232363abb8179d9209d3197f9
prerequisite-patch-id: 0ac4a945751e4d0efb1bd7756f7d5e67d9d82b6a
prerequisite-patch-id: c821611ebe18296f2b165ffc1a76f0deff604611
prerequisite-patch-id: 0de814de7cfff3245e6724d439c1d6bd4a019d79
prerequisite-patch-id: cca4962e852608e954f0e2103e424029f92db1df
prerequisite-patch-id: e423ad9714cd859ad58d1697df638aad54243936
prerequisite-patch-id: b03cc62f6a65c31924c0afccb53763d12d887986
prerequisite-patch-id: eaf8aa5c25b397d42fcf7a83db5a397d17f3bec5
prerequisite-patch-id: a35f8c97bc20cdaa0d1088399da5ac824282b67c
prerequisite-patch-id: d521e6ab848941a34b2b2e71b0c7ac4d5ce36279
prerequisite-patch-id: 99d3d3273f3d32cc7af3d9553af181a5c830cdd8
prerequisite-patch-id: 22ce41582c853217648b713a8dd6564066708f8d
prerequisite-patch-id: ed88fa1310f4717b8458bba51d14f7916d4f5035
prerequisite-patch-id: 56686cb6e697ebb292a63f3ea5a6516a5c1e89a2
prerequisite-patch-id: 3b4b94bbe2407a3ce6ab00237d7629c566fd4dde
prerequisite-patch-id: b3458043df0b2a268359d1e9612e9f8566db5dac
prerequisite-patch-id: 2525046858f1a867a5719e9e0bb64c23584c6fa3
prerequisite-patch-id: b2d47f1134a1bacaa1f0b0ca77eb43a697383737
prerequisite-patch-id: b8e55464454e14bfbee52c4d396b84dc3f24a6ae
prerequisite-patch-id: 02d067b69e8bdfacb8f5f7967bd07cb730de7137
prerequisite-patch-id: ad737f4c012a72f0dc6d7e7a135c185cd5c9326c
prerequisite-patch-id: 74ded31678a4b28370ac0cead3af46bde6607ac9
prerequisite-patch-id: 6620c943d222b01d9d82876a213e7e461ca8bf58
prerequisite-patch-id: 7f704f25e3d42a05fc71735326a24da78e106f7e
prerequisite-patch-id: e2a088b695bd14b2e1921e34cfc27fc7207fd17c
prerequisite-patch-id: 312b9f179bb0cdaa30ca412f55492ab0a2490b04
prerequisite-patch-id: 1e9c563913a254b0353a38e512b09e3baff34676
prerequisite-patch-id: 1c8830a7899f57817d32215e96460b822eb567c7
prerequisite-patch-id: f3ac3c4b236856ea9c9748cc31568cabfc7a1f77
prerequisite-patch-id: 340a7d131d0864e4537d6efe53932cac1fa8b6d3
prerequisite-patch-id: e9a8b70052b0069cf48e266bbb3d9a759715cfca
prerequisite-patch-id: 58eb42c12e7fae2b870c4561d0e04a6b0c943d40
prerequisite-patch-id: a7105d0c1541629a081264e1bb3ec661ff9fe786
prerequisite-patch-id: 1f49d782ce2648b548b970f6ea06a83799a1f567
prerequisite-patch-id: f7f5260e16148fa6569e5ace4a9cd68d9c494626
prerequisite-patch-id: 492c6ff1c5178146bc75ffa4833ed3ed3fb3d5a9
prerequisite-patch-id: 4ae5040a05bcfdbc38a6b73ebe78d95d732cf399
prerequisite-patch-id: f3a51de6d647d4191c3d757c0cbe2569bc984f4b
prerequisite-patch-id: 1d7eb0ff4911e2083bfc8371ccedfd44f7e6d908
prerequisite-patch-id: 0ca0011155ad2a109464127bebf093a6d370b528
prerequisite-patch-id: ea3be5ace9380e325bcebaafc35366ea61951e67
prerequisite-patch-id: 137b468ffdb64d49aadc2424250ba8dce23f0ef6
prerequisite-patch-id: f7628c37d03654c426b7cfaddc7ceaf6fd6664c0
prerequisite-patch-id: 3328f64fc738b03fe2d3749f1dd8891907139372
prerequisite-patch-id: 6e82d663bdc1ccd30803719cc3aa273d8732dec8
prerequisite-patch-id: 989e0cbd5a7766ba48777aab78cc647455a68ab9
prerequisite-patch-id: f2ea7779419dffc231e95f27ae6b6881f07ed426
prerequisite-patch-id: c7daea444b036d74d01e23a2dd04baf1b46caf62
prerequisite-patch-id: ba5001b3f3f8f2da432ce3c327e996d8585732a1
prerequisite-patch-id: f39e233d501d49969c9bc1b3b40937400a834c8f
prerequisite-patch-id: 1b83a2c3e62fe08603222aa757ac4a438c8a1f64
prerequisite-patch-id: d05fee4742f1996cab52466d2cba18e8644c494f
prerequisite-patch-id: c6fd8254d6a116d7ca2557d645685c544b82a446
prerequisite-patch-id: d4f2db9376d8a935ef53e5d24b61191209320964
prerequisite-patch-id: afac77dceec9f0437072abdcb2d48b1174b9a6d0
prerequisite-patch-id: 72868b6d23dc2da4d489eaa551a81639eeb25da6
prerequisite-patch-id: 23fde45a0dee1dc74d8d9dd58af6e6f80d470f1e
prerequisite-patch-id: 99bb791003185b146e895bb06c51ad49f504f4c9
prerequisite-patch-id: 0af77648aa55f154b3b59187809bfd4376bdb166
prerequisite-patch-id: 3719776888d33c1b05ae93c3d3ef40b4a2d57c8a
prerequisite-patch-id: 2f51ecfe4da1abded98db2df292f4ee275a8aee8
prerequisite-patch-id: 9b48ce22e25ea46c1da48276739e2d1b1e6d0d5d
prerequisite-patch-id: 0b1477eba1de5d019ac6e4a4f468210d34048f8a
prerequisite-patch-id: 4bb7703a51fa36cb804b627b57ce07eee9b648b3
prerequisite-patch-id: e5edb97ba40a910c146bb8de0e826630fb5e3032
prerequisite-patch-id: 73ca65fffb097dcdfb358bfa91b3bc83e9d13000
prerequisite-patch-id: 185e33e57221f033c390097d77831448ac026530
prerequisite-patch-id: 81928ac7e4d43a7301fb7ee05f93f78269874c98
prerequisite-patch-id: 2feb7b4c5a04e5d88f57b7222cb8c28c4862437d
prerequisite-patch-id: 8f1c8814ba61355851fd2e835a170b31716e7f26
prerequisite-patch-id: c5798435879b8ac3a1ea6fa0a4bdc69e52a49cc8
prerequisite-patch-id: 8ae2529a6c2c517fdcfe87cf1a90536e8d5ae2aa
prerequisite-patch-id: 83b082e98f4016350e4a42ff4bd04f873b20ac82
prerequisite-patch-id: f73ed340f07ff43cef51e53be87cefc5584adecb
prerequisite-patch-id: 28d44378c03d45f5c1fc46c3bba9671b0a5554db
prerequisite-patch-id: 3066df645ed359006d61e1a181ff61349a737295
prerequisite-patch-id: e4619bac3486bdd58183217a1d3187059318aec2
prerequisite-patch-id: 11674773f58e33e3ce4f65175edea675a68cfbd5
prerequisite-patch-id: dc4d0cd20ec18423fbb98ef2075bcc9ba8596e8e
prerequisite-patch-id: 629a1827c71d25cafffe750e1c4fde93c898ff4f
prerequisite-patch-id: a19d2dafdda01d1084976b5111a5da0b25fad01a
prerequisite-patch-id: 7a8b7ca2377ef954a2fe762c1c0c8b767a5c04a4
prerequisite-patch-id: 48f734ae3bea51ba34ff07b30e3261e3626e0ca0
prerequisite-patch-id: dfd18ed6c4ad86dcd9ea9f91b56f8430380b99c2
prerequisite-patch-id: 6f07248647277302e6ce92c76c3487aa342ffa29
prerequisite-patch-id: 2d49dea0ba731623205b32e21b0193cc1ccee89c
prerequisite-patch-id: 1cb4497c57ebebc8cb134c3704ee922993850259
prerequisite-patch-id: bcfa2f2f50a8619317fdf194473fecbccbfe4b7b
prerequisite-patch-id: f5f0eab5c5a445a109aa832b728b6ef332dc2857
prerequisite-patch-id: 50dbd88eee2ca486ef6a275ba98739bab981c3ab
prerequisite-patch-id: e9914307751094d2e11e87d4155234e206a89f26
prerequisite-patch-id: c936f8a0b74b15303ef23886c2f8f9b2ea8f783e
prerequisite-patch-id: 0cd59764bfb6c9c85ff16001ce1ec821a7c0f10b
prerequisite-patch-id: 4a90c8861c5d388435a2450d5741013d1aa61dcf
prerequisite-patch-id: d68f9bb79784ccbcaa2d584411d01e8ac6ef56ae
prerequisite-patch-id: a45380d776abf722e832eb983faf4f1dc340eea4
prerequisite-patch-id: 9a00a4ef3df2fe335d082b7dd55837023b111eb6
prerequisite-patch-id: 65e367988825a11e7220fc884920624874f607aa
prerequisite-patch-id: acf6cdb60fb6f584c3d271998c7303c46f248a43
prerequisite-patch-id: d56407550a3ef319d182154e3082b84dc6150281
prerequisite-patch-id: a244d4a6bc3120ad0dd9c91ac65e19d07cb2f70d
prerequisite-patch-id: f33b4a52e8b7a50cd0774407300c663a07501735
prerequisite-patch-id: 2f7105075140c54af18ca2a426ed8b8a599f64bb
prerequisite-patch-id: b1d78570731b97050f6f8070340efa46b17c41a2
prerequisite-patch-id: 8d2328d60feb3cd172f0eea1d57d0747af3fc544
prerequisite-patch-id: 9c24f5bc9dcd891f85a4f8fc7629e011a96c93a3
prerequisite-patch-id: 3361aa4d6a0587b5de89402a11b5e4e6d4d72f06
prerequisite-patch-id: 3337eb51703840e2cf61d13f5ef0784007cabe14
prerequisite-patch-id: e7e0ba6c2a05f8ef4df5c86b0a790d76a6625b6f
prerequisite-patch-id: 7cefc0a28e6759ab3288b702f4c1f5ffb7c01c56
prerequisite-patch-id: ae630c97354eb02e52f9d950538816a139b795c8
prerequisite-patch-id: f4d1a37f833d838317d8872833b21fd4fa2ab6e2
prerequisite-patch-id: 03aad56c77e31eecfb77177b5ac50d49a276fb82
prerequisite-patch-id: ed2a7bc366dda4763f9d9456d464050a1ef7eec4
prerequisite-patch-id: 397576e45c1462b398d994f872379294329928f8
prerequisite-patch-id: b6f602d0d19c3f06d83c03ca843979217607d130
prerequisite-patch-id: 0500f82ce5b47198613509116c6e4fd2371eb2bb
prerequisite-patch-id: 188db611697de5b795d12c28296bc75f5a30d910
prerequisite-patch-id: 573deb5f18aeeafe9e226d4f9d2b1b6ad7dcda18
prerequisite-patch-id: 45849ec6d63075fbd7150427debf1568e2d1b0f5
prerequisite-patch-id: 3af1b58ca189500681afb36a5076b35f4d697027
prerequisite-patch-id: c4f424a81a7d73da5b2c6e4f59a82a8e0429c5c7
prerequisite-patch-id: 42426483d2439297c88fcbc05dd048efe1775b77
prerequisite-patch-id: 59c7b423c5450e94a356df4e1ea68a9602e6b911
prerequisite-patch-id: adea692674468ad1f5c3145296fbee42001d76ee
prerequisite-patch-id: c65cbc0c492d5ef5fe258c872f08068d103c4c40
prerequisite-patch-id: ea88c456520b2b6ebee21b5b680caa734df19b43
prerequisite-patch-id: 1e6baf14b3d2d56784d3bb5400bff7b4358a8f4a
prerequisite-patch-id: 581b069113a44626458a9801219bbac917f3171f
prerequisite-patch-id: ad7e7955b6d2bd276564d809d31c88c870748e78
prerequisite-patch-id: e7d84123e1071a634d22300eead272db83a2e05a
prerequisite-patch-id: fe0424da1fff56fa231d9e3e53f411ad62f4e447
prerequisite-patch-id: 419adb4d7eb343b8d6b65f3fa3c4d168af95ba5f
prerequisite-patch-id: df91efe8b2008652b2d7d73d4df9a5c86a10553d
prerequisite-patch-id: d86aa48ec9af6675fac203b9192232a1159f3795
prerequisite-patch-id: 181cd2fd23db15e94db285edc808c428548501f0
prerequisite-patch-id: ca17d640d867f2b557bbe5c7b3c8fbcd1bc00d96
prerequisite-patch-id: d20d425042f514efc67289f461c15ed85de1faf5
prerequisite-patch-id: 785e446625e953d1208a02ab9b66391db5ee7e73
prerequisite-patch-id: bbb74b34e8139ce427d6114609214b61d446868d
prerequisite-patch-id: 50c9308e847f1f64c8423ad0a6867e11dfc14837
prerequisite-patch-id: aaa3c61b49d78cf5abaa95f6f3290cc03fcb7fe6
prerequisite-patch-id: 3d5457ab507ee891bf6af898e793381439d598a9
prerequisite-patch-id: b1be4944fa43dd4ecd619b923f86f7ef621d17db
prerequisite-patch-id: 0a2bdd6c43d73a55a3b6dc68b44e2e1b9226ac6c
prerequisite-patch-id: 81a0ae95a8e36be0d9d7eb57ffdaac7671934191
prerequisite-patch-id: 08211ae407a7a0a41c982654a61ebfce7f4c5ce2
prerequisite-patch-id: 6e89e0728b121190d994e5640e6d5373b1c018df
prerequisite-patch-id: ec4cf7d714d390adc247e11b61b8f3b8de2d4f6e
prerequisite-patch-id: a9322bc5c6e97fe5203a431c34616b0cf083ab0b
prerequisite-patch-id: ce4c9326640656ddc8b9d0e8fe460c3407f7cac5
prerequisite-patch-id: fccdff7001dc9f23025e1e85d3b39d8156f23099
prerequisite-patch-id: f71027085c532a0e4c0f5a790512428d284b421c
prerequisite-patch-id: d9c20777ea82c7b2d3d8d032bb44fb045261c8a4
prerequisite-patch-id: c1c7d6018ba31e05c8750fbb72c090539ad199ca
prerequisite-patch-id: 6f5a460f706a9d0b7fcd92d77703161af9ead441
prerequisite-patch-id: 46a47f889a840b2aacbc78ae637a633db9e8b34f
prerequisite-patch-id: 31902c95f5212466e1b5efed8641f1f99bbc1f1b
prerequisite-patch-id: 73f7c266d6466f13fb5be9eaf74b1f158fe3c16b
prerequisite-patch-id: 94d3e19460acc397aaa2f0170bd59692047d6f48
prerequisite-patch-id: d3aa94922e4537aa082bac382b154c9f159ebd93
prerequisite-patch-id: 7be903c564eff7bee669a3eac9b04216a08d90a2
prerequisite-patch-id: b2602fe9eb0c42f7c04ab90fc75829507bde4027
prerequisite-patch-id: 1cbb211bc4afae89cba4859e694fbbecbde817b2
prerequisite-patch-id: bd705e890c503df40f24786d1e1807bf969c108c
prerequisite-patch-id: 8eb5c8d1291947d93d13c74261b48a60e1465108
prerequisite-patch-id: 18d3fa4b2425d131033406319723426bc99e79cf
prerequisite-patch-id: 245693b8728cd9e82202e5035dee67d71374e7f0
prerequisite-patch-id: d553eeaa207b41dce8476b074ce38c8eeaee32d6
prerequisite-patch-id: 2b57259c6c741a1f4c87486314f4b67b7f79e3a8
prerequisite-patch-id: 538a082c32cf602911b68939bbb70029dc912559
prerequisite-patch-id: 62e866798402f466e9bd8093b9fdda0e15168921
prerequisite-patch-id: dd5c047bbaf3c91d9aa7f38d34965b8df30b5594
prerequisite-patch-id: e770095d2ad89b8afe5f6677c5d02838344495ea
prerequisite-patch-id: bbcdf5490e6e453aaaead07aaf55ba499b38dd2e
prerequisite-patch-id: c145a477f9075f766cd5357ae916f8056d4a2e3f
prerequisite-patch-id: 117bcce27b0b0abc688c3a46c760e4969258d6e5
prerequisite-patch-id: af1702a2d85d4fd80d912efa1a310251009d93bd
prerequisite-patch-id: f32497f4d8008eb6acc45efc007d0a5f73c22e6a
prerequisite-patch-id: 7737a343021376ce20922019c6a2729bb34d9196
prerequisite-patch-id: 2717f75105df882cf81cad205e1c2c6041defbc3
prerequisite-patch-id: 705acf5c3409a97f9b24627482b5a8aac441dcf5
prerequisite-patch-id: 50341b998a26a67d900760aeed4d52bc448b6f54
prerequisite-patch-id: 76c978400096ab0fd0621af674e61b9ce2fb6233
prerequisite-patch-id: 03ec8ca8d024313a6b1d99e3ecadb3e38d77882e
prerequisite-patch-id: 76381ff88a3fe0be33719be9ccfa5c02e4d77e55
prerequisite-patch-id: 25a9db4c304d9c45672656d07bf0fe7ad010caa9
prerequisite-patch-id: e359ef31cef16111a48576d7d8d398fd8b228d99
prerequisite-patch-id: a7c6bd82bd7dd4c8ba895fecab9d80fd3321f6ed
prerequisite-patch-id: a4b030e7b1133c9204322a7764fafb5332a1ffa9
prerequisite-patch-id: 78973e541642591ec33e493ccf561f918ef00522
prerequisite-patch-id: 5265fa3d57f1b86d4242b5425099a85f294f65fb
prerequisite-patch-id: b063cc289de29f0a8107977fa780b90233ece9e6
prerequisite-patch-id: fe072098544604963eea80006b2c1401492b8581
prerequisite-patch-id: f7356c93abb53dca8a2f9594cecbf2f6b0d9be71
prerequisite-patch-id: 4efd90764e6621b843cfd28630d1fe2b90564c42
prerequisite-patch-id: 3c340d8dae5b8f40ed7e24d3f4c2e5327dcd06de
prerequisite-patch-id: 1a229ea9fbaef1f5ac24724ac1b199ddf57e9741
prerequisite-patch-id: 27b65b64a1151bb5f19efe5c882163d0b52dc9a9
prerequisite-patch-id: 933ffc6f722e33a493f2e6ca544ce
This message was truncated. Download the full message here.
Lars Bilke wrote 8 months ago
[PATCH v2] gnu: petsc: scrub build machine specifics
(address . 71821@debbugs.gnu.org)(name . Lars Bilke)(address . lars.bilke@ufz.de)
d580228f33d99676e3df5f5c48f437d63f00b53b.1719580092.git.lars.bilke@ufz.de
'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(-)

Toggle diff (89 lines)
diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index de8e886485..8ab18cedf2 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -3544,38 +3544,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)))
@@ -3587,17 +3590,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: 6a7d5cda17fd9d4bd99c58f7a5dbdd2d021354f9
--
2.44.0
Lars Bilke wrote 8 months ago
[PATCH v3] gnu: petsc: scrub build machine specifics
(address . 71821@debbugs.gnu.org)(name . Lars Bilke)(address . lars.bilke@ufz.de)
891ca7832b5e73ee35d277ad1f7fe0f070dace8b.1721636747.git.lars.bilke@ufz.de
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(-)

Toggle diff (89 lines)
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
Ludovic Courtès wrote 8 months ago
(name . Lars Bilke)(address . lars.bilke@ufz.de)
87msm4awx8.fsf@gnu.org
Hi Lars,

Lars Bilke <lars.bilke@ufz.de> skribis:

Toggle quote (14 lines)
> 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

I applied this patch; however, I took the liberty to leave out phase
merges, which are unrelated to the reproducibility issue and should be
discussed separately, for the sake of clarity (though in general I would
recommend short, focused phases rather than large hard-to-override
phases).

Pushed as 31fe177a97bacec643180cc5bcf8805a6cb07481.

Thanks!

Ludo’.
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 71821@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 71821
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help