Files
gentoo/sci-electronics/spice/files/spice-3.5.5-makefile-exit-on-fail.patch
Eli Schwartz 74be6618a2 sci-electronics/spice: correctly error when compiling fails
The makefiles for this project are from 1989, back when software
developers still knew how to write real build systems. For example, real
build systems are intelligent enough to:

- mark loads of rules as "-command", which tells make to not fail if the
  command fails
- run make by concatenating makefile fragments and piping it to `make -f -`
- recursively run more makes via concatenation
- pass -k to all make invocations, so that we try to build as much as
  possible even if we can't succeed in the end
- mandatorily require running make from a shell script that sets up
  everything, somehow

There is only one slight problem with this otherwise brilliant design.
Namely, none of it is a good idea.

ANYWAY, this software does not build due to Modern C violations. It is
also entirely uninteresting to invest serious time in the build system
for this thing, or even attempt to report it, since the software exists
as a wikipedia "historically significant events" page plus random
third-party download sites and web.archive.org and a progression of
modernized and extended forks. The actual project was declared finished
and done with in 1993.

I'm told keeping the package around is important because, as the father
of an entire industry, it's important to have as a point of reference
whenever doing various kinds of work. Still, the darned thing could do a
bit better about actually compiling. Step 1 is to error out on compile
failures, rather than succeeding and then failing to run the built
executables / have the input files for "dobin" and erroring out with
inscrutable messages.

Signed-off-by: Eli Schwartz <eschwartz@gentoo.org>
2025-04-03 23:44:28 -04:00

67 lines
2.4 KiB
Diff

From 57beed0c071b159695a8695de23325bdfd5f1ec6 Mon Sep 17 00:00:00 2001
From: Eli Schwartz <eschwartz93@gmail.com>
Date: Thu, 3 Apr 2025 20:51:10 -0400
Subject: [PATCH] src_compile: exit on failure
This "build script" wraps around `make` in some horrifying ways. And as
a result, if make exits with an error this is ignored.
To cap it off, the entire software is based around recursive make -k so
it takes forever to build and return errors. There is no point in doing
this just to get a failed build; be more responsive.
---
util/build | 2 +-
util/skeleton/make_std.bd | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/util/build b/util/build
index bf4bbcc..c740858 100755
--- a/util/build
+++ b/util/build
@@ -172,7 +172,7 @@ if test -z "${DEBUG}"; then
$EXEC cat ${FILES0} "${TOP0}/${DIR}/${SUBDIR}/makedefs" \
"${TMP_TRAILER}" "${SKEL_DIR}/make_std.bd" \
| make -f - bootstrap DIR="${DIR}" SUBDIR="${SUBDIR}" \
- VPATH="${TOP0}/${DIR}/${SUBDIR}" CWD="${CWD}"
+ VPATH="${TOP0}/${DIR}/${SUBDIR}" CWD="${CWD}" || exit
echo Done with build at `date`
else
$EXEC cat ${FILES0} "${TOP0}/${DIR}/${SUBDIR}/makedefs" \
diff --git a/util/skeleton/make_std.bd b/util/skeleton/make_std.bd
index d4ef591..50baf3a 100644
--- a/util/skeleton/make_std.bd
+++ b/util/skeleton/make_std.bd
@@ -16,17 +16,17 @@ BUILD_DIR = \
echo Making \"$(PURPOSE)\" in "$${NEW_NAME}"; \
cat $(FILES_L) $${NEW_DIR}/makedefs \
$(FILES_T) $${OFILE} $${DFILE} \
- | ${MAKE} -f - -k recursive \
+ | ${MAKE} -f - recursive \
PARENT="$${NEW_PARENT}" NAME="$${NEW_NAME}" \
$${SET_COMP} $${COMP_TO_CWD} $${CWD_TO_COMP} \
VPATH="$${NEW_VPATH}" SUBDIR="$${SUBDIR}" \
- DIR="$${DIR}"
+ DIR="$${DIR}" || exit
.c.o:
$(CC) $(CFLAGS) $(INCLUDE) -c $(SRC_DIR)/$*.c $(OUTPUT) $(ASM_HACK)
bootstrap: always
- -@if test "x$(DIR)" = "xsrc/"; then \
+ @if test "x$(DIR)" = "xsrc/"; then \
if test ! -d "$(OBJ_DIR)"; then \
$(MKDIR) -p "$(OBJ_DIR)"; \
fi; \
@@ -41,7 +41,7 @@ bootstrap: always
$(BUILD_DIR);
recurse: $(PRE_PURPOSE) $(UPDATE_TARGET)
- -@SUBDIRS="$(MAKE_SUBDIRS)"; \
+ @SUBDIRS="$(MAKE_SUBDIRS)"; \
for xx in $${SUBDIRS}; do \
if test -z "$(DIR)"; then \
DIR=$${xx}/; \
--
2.49.0