aboutsummaryrefslogtreecommitdiff
path: root/reproduce/software/shell
diff options
context:
space:
mode:
authorMohammad Akhlaghi <mohammad@akhlaghi.org>2021-04-17 04:55:58 +0100
committerMohammad Akhlaghi <mohammad@akhlaghi.org>2021-04-17 04:55:58 +0100
commitd11725a09133a422dbad19f46caa088bd0bca3a9 (patch)
tree94ec18b1ff1324837888e3b16025c835f7958f5b /reproduce/software/shell
parent30bf4624adf40e9611ad8f6a0214e725b2ea88af (diff)
parent6e4ec9a305f7021643fe22e08fe0ad17dd363a93 (diff)
Imported recent work in Maneage, minor conflicts fixed
Some minor conflicts (all expected from the commit messages in the Maneage branch) occurred but were easily fixed.
Diffstat (limited to 'reproduce/software/shell')
-rwxr-xr-xreproduce/software/shell/configure.sh69
1 files changed, 51 insertions, 18 deletions
diff --git a/reproduce/software/shell/configure.sh b/reproduce/software/shell/configure.sh
index 812f3d3..e15a8e9 100755
--- a/reproduce/software/shell/configure.sh
+++ b/reproduce/software/shell/configure.sh
@@ -3,6 +3,7 @@
# Necessary preparations/configurations for the reproducible project.
#
# Copyright (C) 2018-2021 Mohammad Akhlaghi <mohammad@akhlaghi.org>
+# Copyright (C) 2021 Raul Infante-Sainz <infantesainz@gmail.com>
#
# This script is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -423,8 +424,17 @@ if ! [ -d $compilertestdir ]; then mkdir $compilertestdir; fi
# Check C compiler
# ----------------
+#
+# Here we check if the C compiler works properly. About the "no warning"
+# variable ('nowarnings'):
+#
+# -Wno-nullability-completeness: on macOS Big Sur 11.2.3 and Xcode 12.4,
+# hundreds of 'nullability-completeness' warnings are printed which can
+# be very annoying and even hide important errors or warnings. It is
+# also harmless for our test here, so it is generally added.
testprog=$compilertestdir/test
testsource=$compilertestdir/test.c
+noccwarnings="-Wno-nullability-completeness"
echo; echo; echo "Checking host C compiler ('$CC')...";
cat > $testsource <<EOF
#include <stdio.h>
@@ -432,7 +442,7 @@ cat > $testsource <<EOF
int main(void){printf("...C compiler works.\n");
return EXIT_SUCCESS;}
EOF
-if $CC $testsource -o$testprog && $testprog; then
+if $CC $noccwarnings $testsource -o$testprog && $testprog; then
rm $testsource $testprog
else
rm $testsource
@@ -761,7 +771,7 @@ fi
# exists and we don't want to re-write it).
if [ $rewritepconfig = no ]; then
oldgroupname=$(awk '/GROUP-NAME/ {print $3; exit 0}' $pconf)
- if [ "x$oldgroupname" = "x$reproducible_paper_group_name" ]; then
+ if [ "x$oldgroupname" = "x$maneage_group_name" ]; then
just_a_place_holder_to_avoid_not_equal_test=1;
else
echo "-----------------------------"
@@ -1079,7 +1089,7 @@ if [ $rewritepconfig = yes ]; then
-e's|@ddir[@]|'"$ddir"'|' \
-e's|@sys_cpath[@]|'"$sys_cpath"'|' \
-e's|@downloader[@]|'"$downloader"'|' \
- -e's|@groupname[@]|'"$reproducible_paper_group_name"'|' \
+ -e's|@groupname[@]|'"$maneage_group_name"'|' \
$pconf.in >> $pconf
else
# Read the values from existing configuration file. Note that the build
@@ -1238,7 +1248,7 @@ if ! [ -d "$mtexdir" ]; then mkdir "$mtexdir"; fi
# TeX build directory. If built in a group scenario, the TeX build
# directory must be separate for each member (so they can work on their
# relevant parts of the paper without conflicting with each other).
-if [ "x$reproducible_paper_group_name" = x ]; then
+if [ "x$maneage_group_name" = x ]; then
texbdir="$texdir"/build
else
user=$(whoami)
@@ -1458,18 +1468,19 @@ fi
# which will download the DOI-resolved webpage, and extract the Zenodo-URL
# of the most recent version from there (using the 'coreutils' tarball as
# an example, the directory part of the URL for all the other software are
-# the same).
+# the same). This is not done if the option `--debug' is used.
+zenodourl=""
user_backup_urls=""
zenodocheck=.build/software/zenodo-check.html
-if $downloader $zenodocheck https://doi.org/10.5281/zenodo.3883409; then
- zenodourl=$(sed -n -e'/coreutils/p' $zenodocheck \
- | sed -n -e'/http/p' \
- | tr ' ' '\n' \
- | grep http \
- | sed -e 's/href="//' -e 's|/coreutils| |' \
- | awk 'NR==1{print $1}')
-else
- zenodourl=""
+if [ x$debug = x ]; then
+ if $downloader $zenodocheck https://doi.org/10.5281/zenodo.3883409; then
+ zenodourl=$(sed -n -e'/coreutils/p' $zenodocheck \
+ | sed -n -e'/http/p' \
+ | tr ' ' '\n' \
+ | grep http \
+ | sed -e 's/href="//' -e 's|/coreutils| |' \
+ | awk 'NR==1{print $1}')
+ fi
fi
rm -f $zenodocheck
@@ -1497,6 +1508,28 @@ user_backup_urls="$user_backup_urls $zenodourl"
+# Corrections for debugging mode
+# ------------------------------
+#
+# If the user wants to debug the software configuration, they are usually
+# focused on the building of the single problematic software. Therefore,
+# the default multi-threaded execution of Make with the '--keep-going'
+# option are very annoying and can even hide important warnings. Recall
+# that with '--keep-going', Make will continue building other targets, even
+# if one target fails. When the user runs './project configure --debug',
+# the 'debug' variable will not be empty and this mode will be activated.
+if [ x$debug = x ]; then
+ keepgoing="--keep-going"
+else
+ jobs=1
+ numthreads=1
+ keepgoing=""
+fi
+
+
+
+
+
# Build other basic tools our own GNU Make
# ----------------------------------------
#
@@ -1504,7 +1537,7 @@ user_backup_urls="$user_backup_urls $zenodourl"
# Bash, Make, or AWK. In this step, we'll install such low-level basic
# tools, but we have to be very portable (and use minimal features in all).
echo; echo "Building necessary software (if necessary)..."
-.local/bin/make -k -f reproduce/software/make/basic.mk \
+.local/bin/make $keepgoing -f reproduce/software/make/basic.mk \
user_backup_urls="$user_backup_urls" \
sys_library_path=$sys_library_path \
rpath_command=$rpath_command \
@@ -1532,7 +1565,7 @@ else
numthreads=$jobs
fi
.local/bin/env -i HOME=$bdir \
- .local/bin/make -k -f reproduce/software/make/high-level.mk \
+ .local/bin/make $keepgoing -f reproduce/software/make/high-level.mk \
user_backup_urls="$user_backup_urls" \
sys_library_path=$sys_library_path \
rpath_command=$rpath_command \
@@ -1725,10 +1758,10 @@ echo `.local/bin/date` > $finaltarget
#
# The configuration is now complete, we can inform the user on the next
# step(s) to take.
-if [ x$reproducible_paper_group_name = x ]; then
+if [ x$maneage_group_name = x ]; then
buildcommand="./project make -j8"
else
- buildcommand="./project make --group=$reproducible_paper_group_name -j8"
+ buildcommand="./project make --group=$maneage_group_name -j8"
fi
cat <<EOF