bigloo icon indicating copy to clipboard operation
bigloo copied to clipboard

parallel bigloo builds fail

Open NHOrus opened this issue 1 year ago • 4 comments

Successfully simulated failing builds with, say, MAKEOPTS="-j1 --shuffle=1852839864"

clang -I -I. -I/var/tmp/portage/dev-scheme/bigloo-4.5b/work/bigloo-4.5b/lib/bigloo/4.5b -fPIC -I/usr/include/gc -fPIC -I. -I /var/tmp/portage/dev-scheme/bigloo-4.5b/work/bigloo-4.5b/lib/bigloo/4.5b table.c -o objs/table.o -c
error: unable to open output file 'objs/table.o': 'No such file or directory'

Will provide patch when I'm sure I squished most of them.

NHOrus avatar Jun 05 '24 15:06 NHOrus

diff -ru a/bdb/Makefile b/bdb/Makefile
--- a/bdb/Makefile      2024-06-05 17:06:40.098823516 -0000
+++ b/bdb/Makefile      2024-06-05 17:06:45.520796235 -0000
@@ -23,9 +23,14 @@
 #*---------------------------------------------------------------------*/
 #*    Booting bdb on a bare system                                     */
 #*---------------------------------------------------------------------*/
-boot:
-       @ (cd blib; $(MAKE) all)
-       @ (cd bdb; $(MAKE) MODE=final mode)
+boot: blip-boot bdb-boot
+
+blip-boot:
+       @ $(MAKE) -C bdb MODE=final mode
+
+bdb-boot: blip-boot
+       @ $(MAKE) -C blib all
+
 
 #*---------------------------------------------------------------------*/
 #*    Populating bdb                                                   */
diff -ru a/bdb/blib/Makefile b/bdb/blib/Makefile
--- a/bdb/blib/Makefile 2024-06-05 17:06:40.100823506 -0000
+++ b/bdb/blib/Makefile 2024-06-05 17:07:40.738518401 -0000
@@ -80,9 +80,11 @@
 #*    The implicit rules                                               */
 #*---------------------------------------------------------------------*/
 objs/%.o: %.scm
+       mkdir -p $(CLASS_DIR)
        $(BIGLOO) -no-hello $(BDBFLAGS) -copt $(CPICFLAGS) $< -o $@ -c
 
 objs/%.o: %.c
+       mkdir -p $(CLASS_DIR)
        $(CC) $(CFLAGS) $(CPICFLAGS) -I. -I $(LIB) $< -o $@ -c
 
 $(CLASS_DIR)/%.class: %.scm
@@ -145,7 +147,7 @@
 #*--- lib-jvm ---------------------------------------------------------*/
 lib-jvm: $(TAGS) $(CLASS_DIR) lib.zip
 
-$(CLASS_DIR): 
+$(CLASS_DIR):
        mkdir -p $(CLASS_DIR)
 
 lib.zip: .afile .jfile $(BGL_CLASSES) $(JAVA_CLASSES_SRC) dojavac

NHOrus avatar Jun 05 '24 17:06 NHOrus

Hi,

Thank you for the report (and thank you for mentioning Make's --shuffle option that I did not know). I don't fully understand your fix but I see that bdb's Makefile is wrong. I'm working on it.

Thanks again,

-- Manuel

manuel-serrano avatar Jun 26 '24 06:06 manuel-serrano

Basically, I throw explicit dependencies until it stops trying to compile in wrong order. And I also removing cd dir; make antipattern - there's make -C for that. Only thing worse is for list of dirs; cd dir; make - it can swallow errors silently and continue to compile. Instead of stopping nicely and early.

NHOrus avatar Jun 26 '24 08:06 NHOrus

Ah sure. You are absolutely right. Thanks for your help and your contribution. I will upload a new version soon.

manuel-serrano avatar Jun 26 '24 13:06 manuel-serrano