From 85e940d4d5e72654f0f51d5b86aab6273490a317 Mon Sep 17 00:00:00 2001 From: Jason Gross Date: Tue, 22 Aug 2023 15:16:54 -0700 Subject: [PATCH 1/2] Pass stderr through calc_install_files when commands fail --- util/calc_install_files | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/util/calc_install_files b/util/calc_install_files index cbaff4070d..180d0bdcf2 100755 --- a/util/calc_install_files +++ b/util/calc_install_files @@ -1,7 +1,10 @@ #!/usr/bin/env bash # The $1 argument of this script should be the desired make target +set -o pipefail + MAKE=${MAKE:-make} -${MAKE} depend >& /dev/null -${MAKE} CLIGHTGEN="CLIGHTGEN" -Bn veric floyd $1 2>/dev/null | \ - awk '/^echo COQC /{print $NF}/^CLIGHTGEN/{print $NF}' +${MAKE} depend >& /dev/null || ${MAKE} depend >&2 +{ ${MAKE} CLIGHTGEN="CLIGHTGEN" -Bn veric floyd $1 2>/dev/null | \ + awk '/^echo COQC /{print $NF}/^CLIGHTGEN/{print $NF}'; } || \ + ${MAKE} CLIGHTGEN="CLIGHTGEN" -Bn veric floyd $1 >&2 From 5db3b092d16d93981a0af937f6f5ec7c30a014da Mon Sep 17 00:00:00 2001 From: Jason Gross Date: Tue, 29 Aug 2023 14:29:39 -0700 Subject: [PATCH 2/2] Use log files instead of re-running commands in calc_install_files --- .gitignore | 1 + util/calc_install_files | 13 +++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 8b53144a7a..3b40578fb3 100644 --- a/.gitignore +++ b/.gitignore @@ -76,6 +76,7 @@ coqide *~ *# .#* +.*.log *.aux doc/html/ /_CoqProject diff --git a/util/calc_install_files b/util/calc_install_files index 180d0bdcf2..20747e7baf 100755 --- a/util/calc_install_files +++ b/util/calc_install_files @@ -1,10 +1,11 @@ #!/usr/bin/env bash # The $1 argument of this script should be the desired make target -set -o pipefail - MAKE=${MAKE:-make} -${MAKE} depend >& /dev/null || ${MAKE} depend >&2 -{ ${MAKE} CLIGHTGEN="CLIGHTGEN" -Bn veric floyd $1 2>/dev/null | \ - awk '/^echo COQC /{print $NF}/^CLIGHTGEN/{print $NF}'; } || \ - ${MAKE} CLIGHTGEN="CLIGHTGEN" -Bn veric floyd $1 >&2 +LOG_DEPEND_FILE=${LOG_DEPEND_FILE:-.calc_install_files.depend.log} +LOG_MAKE_FILE=${LOG_MAKE_FILE:-.calc_install_files.make.log} +${MAKE} depend >& "${LOG_DEPEND_FILE}" || \ + { printf "Error in %s: %s\n" "$0" "${MAKE} depend"; cat "${LOG_DEPEND_FILE}"; } >&2 +{ ${MAKE} CLIGHTGEN="CLIGHTGEN" -Bn veric floyd $1 2>"${LOG_MAKE_FILE}" || \ + { printf "Error in %s: %s\n" "$0" "${MAKE} CLIGHTGEN=\"CLIGHTGEN\" -Bn veric floyd $1"; cat "${LOG_MAKE_FILE}"; } >&2; } | \ + awk '/^echo COQC /{print $NF}/^CLIGHTGEN/{print $NF}'