git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Bizarro race conditions in the Git Makefile

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Aug 6, 2010, 21:14 UTC
Message-ID
<20100806211407.GB6495@burratino>
In-Reply-To
<AANLkTim2NMi3Vf-EGbFwy370q-YseQoGj=QLGMAq6N=B@mail.gmail.com>
Ævar Arnfjörð Bjarmason wrote:
> Those interested in
> poking their eyes can try:
>
>     while nice -n 30 make -j 15 clean all CFLAGS=-O0 CC=gcc; do 1; done

You are asking make to simultaneously build and unbuild everything. It does not really surprise me that it gets confused.

Does
 while
	nice -n 30 make -j 15 clean CFLAGS=-O0 CC=gcc &&
	nice -n 30 make -j 15 all CFLAGS=-O0 CC=gcc
 do
	:
 done
behave better?
>     Writing perl.mak for Git
>     Writing perl.mak for Git
>     rename MakeMaker.tmp => perl.mak: No such file or directory at

Maybe something like the following is needed to protect against interrupted builds (not the problem you reported, but this reminds me).

diff --git a/perl/Makefile b/perl/Makefile
index 4ab21d6..eef7ee5 100644
--- a/perl/Makefile
+++ b/perl/Makefile
@@ -22,20 +22,21 @@ clean:
 ifdef NO_PERL_MAKEMAKER
 instdir_SQ = $(subst ','\'',$(prefix)/lib)
 $(makfile): ../GIT-CFLAGS Makefile
-	echo all: private-Error.pm Git.pm > $@
-	echo '	mkdir -p blib/lib' >> $@
-	echo '	$(RM) blib/lib/Git.pm; cp Git.pm blib/lib/' >> $@
-	echo '	$(RM) blib/lib/Error.pm' >> $@
+	echo all: private-Error.pm Git.pm > $@+
+	echo '	mkdir -p blib/lib' >> $@+
+	echo '	$(RM) blib/lib/Git.pm; cp Git.pm blib/lib/' >> $@+
+	echo '	$(RM) blib/lib/Error.pm' >> $@+
 	'$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \
-	echo '	cp private-Error.pm blib/lib/Error.pm' >> $@
-	echo install: >> $@
-	echo '	mkdir -p "$$(DESTDIR)$(instdir_SQ)"' >> $@
-	echo '	$(RM) "$$(DESTDIR)$(instdir_SQ)/Git.pm"; cp Git.pm "$$(DESTDIR)$(instdir_SQ)"' >> $@
-	echo '	$(RM) "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@
+	echo '	cp private-Error.pm blib/lib/Error.pm' >> $@+
+	echo install: >> $@+
+	echo '	mkdir -p "$$(DESTDIR)$(instdir_SQ)"' >> $@+
+	echo '	$(RM) "$$(DESTDIR)$(instdir_SQ)/Git.pm"; cp Git.pm "$$(DESTDIR)$(instdir_SQ)"' >> $@+
+	echo '	$(RM) "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@+
 	'$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \
-	echo '	cp private-Error.pm "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@
-	echo instlibdir: >> $@
-	echo '	echo $(instdir_SQ)' >> $@
+	echo '	cp private-Error.pm "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@+
+	echo instlibdir: >> $@+
+	echo '	echo $(instdir_SQ)' >> $@+
+	mv $@+ $@
 else
 $(makfile): Makefile.PL ../GIT-CFLAGS
 	$(PERL_PATH) $< PREFIX='$(prefix_SQ)'
Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 2 of 3 in “Bizarro race conditions in the Git Makefile”
  1. Ævar Arnfjörð BjarmasonAug 6, 2010
  2. Jonathan NiederAug 6, 2010
  3. Ævar Arnfjörð BjarmasonAug 6, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.