aboutsummaryrefslogtreecommitdiff
path: root/reproduce/software/shell/pre-make-build.sh
diff options
context:
space:
mode:
authorMohammad Akhlaghi <mohammad@akhlaghi.org>2026-07-03 16:23:00 +0200
committerMohammad Akhlaghi <mohammad@akhlaghi.org>2026-07-03 19:22:40 +0200
commit4cfa34b1e101adcd050a476307b7680db8afcd8e (patch)
tree34e84bf02232f61b4ad2e38c1359d030d25630ca /reproduce/software/shell/pre-make-build.sh
parentd99b69fdb52f2fd522f53bba29a42d3ba8af5361 (diff)
Configuration: fixed portability issues, add jq and updated GCCHEADmaneage
Summary: this commit will not affect your analysis: only the version of GCC has been updated for portability and jq (a JSON parser) has been added. Until now, several portability issues existed in Maneage, causing problems mostl on macOS, but some also some on GNU/Linux. They are listed below along with the fix. With this commit, the problems mentioned above have been fixed: - 'pkg-config' on macOS needed some manual steps for a successful installation. The cause was its improper checks on the macOS "carbon" library. So we now manually fix this check within the code to fix the problem. This was found and fixed by Martin Wiesmann. - Apple chip variants like M1 Pro, M1 Max, M1 Ultra, M2 Pro, etc could not be properly recognized as a macOS system since we expected a single word. This was solved by using pattern matching instead. Found and fixed by Martin Wiesmann. - macOS's sha512sum wraps the 128-character hex hash across two output lines (80 + 48 chars) and the command that we used to read the output would only captured the first 80 characters, so checksums never matched. The solution was to merge the lines before the check. Found and fixed by Martin Wiesmann. - When a checksum failed, the script exited with an error but left the bad '.unchecked' file on disk. On the next run, the download script saw the file already existed and skipped downloading entirely. As a result, the corrupt file was passed to the checksum check again, failing forever. The fix was to remove the file when we confirmed a bad download. Found and fixed by Martin Wiesmann. - When the server of a file returns a HTML output instead of the file we want, the download script could not detect and would assume that the download was successful. Therefore, it would always crash with a checksum error. The fix was to check the first few bytes of the output and consider it failed if we detect '<html' in them. Found and fixed by Martin Wiesmann. - Unzip could not be built due to linking to old C library constructs. The fix was to edit that part of the code before starting the build. Found and fixed by Faezeh Bidjarchian. - top-prepare.mk: in a few cases, we had incorrectly written './project prepare' (which does not exist!); by Mohammad Akhlaghi. - Tar's 'acl' features were causing crashes with GCC 16.1.1 on an Arch GNU/Linux. Since this feature is not relevant in Maneage, the fix was to disable it; by Mohammad Akhlaghi. - To disable CFITSIO's fortran library (which could be problematic in macOS), we were using the wrong command! Found and fixed by Martin Wiesmann. - GCC 15.2.0 (the previous version on the 'maneage' branch) needed more patches to build with deprecated Linux headers (that are no longer present in Arch GNU/Linux, and will be removed from other distros in due time). The fix was to upgrade GCC to the latest version of 16.1.0 by Mohammad Akhlaghi. - Zenodo is no longer checked at the start of the Maneage configuration. This is because from early 2025, Zenodo does not allow having so many files in a single project, as described in this task: https://savannah.nongnu.org/task/?16621. Therefore many of the new software (since then) are no longer on Zenodo. Implemented by Mohammad Akhlaghi. - initialize.mk: when there was no 'maneage' branch in the project, a warning was printed when writing the LaTeX macros. However, this is only relevant when compiling the PDF. So when the user hasn't activated the PDF creation variable, this warning was not relevant and was just annoying. The fix was to put a condition and only print it when it can be useful by Mohammad Akhlaghi. - README-hacking.md: - There was no checklist for maintainers; by Mohammad Akhlaghi - Incorrect arXiv URL to Eskandarlou+2026; found by Boud Roukema. Furthermore, the jq program has been added to Maneage with this commit; it is useful when it is necessary to parse/edit JSON files.
Diffstat (limited to 'reproduce/software/shell/pre-make-build.sh')
-rwxr-xr-xreproduce/software/shell/pre-make-build.sh18
1 files changed, 13 insertions, 5 deletions
diff --git a/reproduce/software/shell/pre-make-build.sh b/reproduce/software/shell/pre-make-build.sh
index 8236247..3163f74 100755
--- a/reproduce/software/shell/pre-make-build.sh
+++ b/reproduce/software/shell/pre-make-build.sh
@@ -120,16 +120,24 @@ download_tarball() {
"$bservers"
fi
+
# Make sure this is the correct tarball.
if type sha512sum > /dev/null 2> /dev/null; then
- checksum=$(sha512sum "$ucname" | awk '{print $1}')
+
+ # On macOS, sha512sum wraps the hash in two lines. The 'tr -d '\n''
+ # part joins them into one before awk extracts the first field. On
+ # Linux (GNU coreutils) the output is already a single line, so the
+ # 'tr' command has no effect.
+ checksum=$(sha512sum "$ucname" | tr -d '\n' | awk '{print $1}')
expectedchecksum=$(awk '/^'$progname'-checksum/{print $3}' \
"$checksumsfile")
- if [ x$checksum = x$expectedchecksum ]; then mv "$ucname" "$maneagetar"
+ if [ x$checksum = x$expectedchecksum ]; then
+ mv "$ucname" "$maneagetar"
else
- echo "ERROR: Non-matching checksum: $tarball"
- echo "Checksum should be: $expectedchecksum"
- echo "Checksum is: $checksum"
+ echo "ERROR: Non-matching checksum in $tarball"
+ echo " Checksum should be: $expectedchecksum"
+ echo " Checksum is: $checksum"
+ rm -f "$ucname"
exit 1
fi;
else mv "$ucname" "$maneagetar"