aboutsummaryrefslogtreecommitdiff
path: root/project
diff options
context:
space:
mode:
authorMohammad Akhlaghi <mohammad@akhlaghi.org>2024-05-03 13:07:41 +0200
committerMohammad Akhlaghi <mohammad@akhlaghi.org>2025-02-10 19:34:26 +0100
commit3c9bf3aff30f02c7d31bd86f36c4db2520f8ffa4 (patch)
treec4b6ee74518ae5256626f6888c2ceccfa66ce2a2 /project
parent8161194d68665648b93389adb333e741ba230497 (diff)
Configuration: no dependency on /bin/sh and useful run-time options
SUMMARY: no change necessary in your project, this commit only involves changes in how already-existing software are built. Some handy options have also been added to the top-level project script and the copyright years have been updated. Until now, if the host's '/bin/sh' had conflicts with the Maneage environment, the configuration of Maneage would crash as soon as we entered the building of high-level software. The full scenario is described in the comments of the newly added 'reproduce/software/shell/prep-source.sh'. This is most relevant when building older Maneage'd project in newer environments. With this commit, the following changes were made to avoid the problem above: - Maneage edits the source code of all installed software to replace '/bin/sh' with Maneage's own shell before the programs are built. Through this, we were able to solve the problem described above. - The portable '#!/usr/bin/env sh' shebangs are now used at the start of the scripts that run during configure time so it uses the first available shell that it finds in its PATH (the system's before Dash is built), then Dash, and after Dash is built, Bash. - For TeXLive, since we don't install it from source, it was necessary to add the libraries necessary for the local '/bin/sh' in LD_LIBRARY_PATH. Some high-level options have been added to the './project' script to simplify certain operations: --keep-going: do not stop upon the first crash, but keep going on to build targets until all build-able targets have been built. This is very useful for debugging large pipelines and allows you to isolate the problematic part of your project. --highlight-all: equivalent to calling both '--highlight-new' & '--highlight-notes'.
Diffstat (limited to 'project')
-rwxr-xr-xproject28
1 files changed, 18 insertions, 10 deletions
diff --git a/project b/project
index 0c65211..9d4d6df 100755
--- a/project
+++ b/project
@@ -3,8 +3,8 @@
# High-level script to manage the project.
# Run './project --help' for a description of how to use it.
#
-# Copyright (C) 2019-2023 Mohammad Akhlaghi <mohammad@akhlaghi.org>
-# Copyright (C) 2021-2023 Raul Infante-Sainz <infantesainz@gmail.com>
+# Copyright (C) 2019-2025 Mohammad Akhlaghi <mohammad@akhlaghi.org>
+# Copyright (C) 2021-2025 Raul Infante-Sainz <infantesainz@gmail.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -37,6 +37,7 @@ host_cc=0
operation=
build_dir=
input_dir=
+keep_going=
check_config=
make_targets=
software_dir=
@@ -118,6 +119,7 @@ Configure options:
Configure and Make options:
-d, --debug[=FLAGS] In configure: use -j1, no -k, and no Zenodo check.
In make: 'FLAGS' will be directly passed to 'make'.
+ -k, --keep-going Keep going when some targets can't be made.
-g, --group=STR Build and run with write permissions for a group.
-j, --jobs=INT Number of threads to build/run the software.
-?, --help Print this help list.
@@ -127,6 +129,7 @@ Make (analysis) options:
Make (final PDF) options:
--refresh-bib Force refresh the bibliography.
+ --highlight-all Activate '--highlight-new' & '--highlight-notes'.
--highlight-new Highlight '\new' parts of text as green.
--highlight-notes Show '\tonote' regions as red text in PDF.
@@ -201,15 +204,20 @@ do
-j|--jobs) jobs="$2"; check_v jobs "$jobs"; shift;shift;;
-j=*|--jobs=*) jobs="${1#*=}"; check_v jobs "$jobs"; shift;;
-j*) jobs=$(echo "$1" | sed -e's/-j//'); check_v jobs "$jobs"; shift;;
+ -k|--keep-going) keep_going="--keep-going"; shift;;
+ -k=*|--keep-going=*) on_off_option_error --keep-going -k;;
+ -k*) on_off_option_error --keep-going -k;;
-'?'|--help) print_help; exit 0;;
-'?'*|--help=*) on_off_option_error --help -?;;
- # Make options
- # ------------
- #
- # Note that Make's 'debug' can take values, but when called without any
- # value, it is like giving it a value of 'a'):
+ # Make options (analysis):
+ -p|--prepare-redo) prepare_redo=1; shift;;
+ -p=*|--prepare-redo=*) on_off_option_error --prepare-redo; shift;;
+
+ # Make options (final PDF):
--refresh-bib) [ -f tex/src/references.tex ] && touch tex/src/references.tex; shift;;
+ --highlight-all) highlightnew=1; highlightnotes=1; shift;;
+ --highlight-all=*) on_off_option_error --highlight-new;;
--highlight-new) highlightnew=1; shift;;
--highlight-new=*) on_off_option_error --highlight-new;;
--highlight-notes) highlightnotes=1; shift;;
@@ -218,15 +226,14 @@ do
echo "Please set the operation before calling '--debug'"; exit 1
elif [ x$operation = xconfigure ]; then debug=a; shift;
elif [ x$operation = xmake ]; then
- if [ x"$2" = x ]; then echo "In make-mode, '--debug' needs a value"; exit 1
+ if [ x"$2" = x ]; then
+ echo "In make-mode, '--debug' needs a value; see GNU Make manual"; exit 1
else debug="$2"; check_v debug "$debug"; shift;shift; fi
else
echo "Operation '$operation' not recognized, please use 'configure' or 'make'"
fi;;
-d=*|--debug=*) debug="${1#*=}"; check_v debug "$debug"; shift;;
-d*) debug=$(echo "$1" | sed -e's/-d//'); check_v debug "$debug"; shift;;
- -p|--prepare-redo) prepare_redo=1; shift;;
- -p=*|--prepare-redo=*) on_off_option_error --prepare-redo; shift;;
# Unrecognized option:
-*) echo "$scriptname: unknown option '$1'"; exit 1;;
@@ -390,6 +397,7 @@ controlled_env() {
envmake="$envmake highlightnew=$highlightnew"
envmake="$envmake highlightnotes=$highlightnotes .local/bin/make"
envmake="$envmake --no-builtin-rules --no-builtin-variables -f $1"
+ envmake="$envmake $keep_going"
if ! [ x"$debug" = x ]; then envmake="$envmake --debug=$debug"; fi
# Set the number of jobs. Note that for the 'configure.sh' script the