Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parallel bigloo builds fail #118

Open
NHOrus opened this issue Jun 5, 2024 · 4 comments
Open

parallel bigloo builds fail #118

NHOrus opened this issue Jun 5, 2024 · 4 comments

Comments

@NHOrus
Copy link

NHOrus commented Jun 5, 2024

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
Copy link
Author

NHOrus commented Jun 5, 2024

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

@manuel-serrano
Copy link
Owner

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

@NHOrus
Copy link
Author

NHOrus commented Jun 26, 2024

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.

@manuel-serrano
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants