magic icon indicating copy to clipboard operation
magic copied to clipboard

make should fails if a module fails to build

Open proppy opened this issue 3 years ago • 1 comments

current usage of for loops to build the list of modules in https://github.com/RTimothyEdwards/magic/blob/master/Makefile#L53 would not fail the build if some of the modules failed to build as long as the last make invocation is successful

see below:

+ for dir in windows doc scmos graphics tcltk magic net2ir tclvtk
+ cd graphics
...
+ $BUILD_PREFIX/bin/x86_64-conda-linux-gnu-cc -g -m64 -fPIC -Wimplicit-int -fPIC -I$PREFIX/include -I$BUILD_PREFIX/include -I. -I.. -DNDEBUG -D_FORTIFY_SOURCE=2 -O2 -isystem $PREFIX/include '-DCAD_DIR="$PREFIX/lib"' '-DBIN_DIR="$PREFIX/bin"' '-DTCL_DIR="$PREFIX/lib/magic/tcl"' -DUSE_TCL_STUBS -DUSE_TK_STUBS '-DPACKAGE_NAME=""' '-DPACKAGE_TARNAME=""' '-DPACKAGE_VERSION=""' '-DPACKAGE_STRING=""' '-DPACKAGE_BUGREPORT=""' '-DPACKAGE_URL=""' -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DSIZEOF_VOID_P=8 -DSIZEOF_UNSIGNED_INT=4 -DSIZEOF_UNSIGNED_LONG=8 -DSIZEOF_UNSIGNED_LONG_LONG=8 -DSTDC_HEADERS=1 -DHAVE_SETENV=1 -DHAVE_PUTENV=1 -DHAVE_SYS_MMAN_H=1 -DHAVE_DIRENT_H=1 -DHAVE_LIMITS_H=1 -DHAVE_PATHS_H=1 -DHAVE_VA_COPY=1 -DHAVE___VA_COPY=1 -DFILE_LOCKS=1 -DCALMA_MODULE=1 -DCIF_MODULE=1 -DPLOT_MODULE=1 -DLEF_MODULE=1 -DROUTE_MODULE=1 -DUSE_NEW_MACROS=1 -DVECTOR_FONTS=1 -DHAVE_LIBCAIRO=1 -DMAGIC_WRAPPER=1 -Dlinux=1 -DSYSV=1 -DISC=1 '-DMAGIC_VERSION="8.3"' '-DMAGIC_REVISION="282"' '-DMAGIC_COMMIT="3bc80a9869cb95653529626f45b0793c27ed8c46"' '-DGCORE="no"' '-DSHDLIB_EXT=".so"' -DNDEBUG -DX11 -DXLIB -DCAIRO -DNDEBUG -MM grMain.c grLock.c grDStyle.c grText.c grCMap.c grClip.c grGlyphs.c grNull.c W3Dmain.c grX11su1.c grX11su2.c grX11su3.c grX11su4.c grX11su5.c grTk1.c grTk2.c grTk3.c grTk4.c grTk5.c grTOGL1.c grTOGL2.c grTOGL3.c grTOGL4.c grTOGL5.c grTkCommon.c grOGL1.c grOGL2.c grOGL3.c grOGL4.c grOGL5.c X11Helper.c grX11thread.c grTCairo1.c grTCairo2.c grTCairo3.c grTCairo4.c grTCairo5.c
grDStyle.c:42:10: fatal error: database/database.h: No such file or directory
   42 | #include "database/database.h"
      |          ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
...
+ for dir in windows doc scmos graphics tcltk magic net2ir tcltk
+ cd tcltk
...

proppy avatar Mar 29 '22 13:03 proppy

instead the Makefile should probably do something like (cd $$dir && ${MAKE} module) || exit 1 to ensure that the build fails early and terminate with the appropriate error code.

proppy avatar Mar 29 '22 13:03 proppy