Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006729OCamlconfigure and build/installpublic2014-12-21 19:292016-12-07 11:47
Reporterwhitequark 
Assigned Towhitequark 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version4.02.2+dev / +rc1 
Summary0006729: Remove race conditions in parallel builds
DescriptionThere are a few annoying race conditions that break builds with high -j values.
TagsNo tags attached.
Attached Filespatch file icon no-suffixes.patch [^] (3,339 bytes) 2014-12-22 18:12 [Show Content]

- Relationships

-  Notes
(0012922)
whitequark (developer)
2014-12-21 19:32

Reminder sent to: gasche

@gasche: One of the race conditions is present in interaction between make's built-in functionality that removes intermediate files referred to by .SUFFIXES: and explicit rm's. I rewrote the rules and now `make -C byterun -j1000` always finishes successfully. Ditto for asmrun.

There are still more races in world, though.
(0012925)
gasche (administrator)
2014-12-21 22:36

Maybe we could apply the same treatment to the Makefile.nt (which is run under Windows) to avoid divergence? byerun/Makefile.nt does not have pic rules, but asmrun/Makefile.nt has some suffix rules left.
(0012927)
whitequark (developer)
2014-12-21 23:18

I've updated the patch.
(0012942)
doligez (administrator)
2014-12-22 18:06

FTR, it's not only for race condition, but it will also make my life easier when debugging the runtime.

But: could you minimise the patch? This does three things:
1. change the build instructions to remove the race conditions
2. change the rule style from ".c.o:" to "%.o : %.c"
3. reorder some rules in asmrun/Makefile

I think (3) is really not needed, and I'd be more comfortable with the patch if it didn't do (2) at the same time, unless (1) somehow depends on it.
(0012943)
whitequark (developer)
2014-12-22 18:08

It does. The automatic removal performed by make is linked to the suffix being in the .SUFFIXES: list.
(0012944)
gasche (administrator)
2014-12-22 18:09

On the other hand, the gmake documentation describes suffix rules as obsolete ( https://www.gnu.org/software/make/manual/html_node/Suffix-Rules.html [^] ) and advises to replace them with pattern rules. As someone that doesn't know much about make, I find pattern rules much easier to read (I would never figure what ".s.p.o:" means).
(0012945)
whitequark (developer)
2014-12-22 18:12

Patch altered to not reorder rules in asmrun/Makefile.

@gasche: I've also removed the only other instance of .SUFFIXES: used to build C files. The build system also has widespread use of .SUFFIXES: to build ML files, but fixing that would be a part of much larger refactoring effort.
(0012946)
doligez (administrator)
2014-12-22 18:15

OK, then.
(0012992)
gasche (administrator)
2014-12-27 09:46

Merged in trunk and 4.02.

- Issue History
Date Modified Username Field Change
2014-12-21 19:29 whitequark New Issue
2014-12-21 19:29 whitequark File Added: no-suffixes.patch
2014-12-21 19:32 whitequark Note Added: 0012922
2014-12-21 22:36 gasche Note Added: 0012925
2014-12-21 23:17 whitequark File Deleted: no-suffixes.patch
2014-12-21 23:17 whitequark File Added: no-suffixes.patch
2014-12-21 23:18 whitequark Note Added: 0012927
2014-12-22 18:06 doligez Note Added: 0012942
2014-12-22 18:07 doligez Status new => feedback
2014-12-22 18:08 whitequark Note Added: 0012943
2014-12-22 18:08 whitequark Status feedback => new
2014-12-22 18:09 gasche Note Added: 0012944
2014-12-22 18:10 whitequark File Deleted: no-suffixes.patch
2014-12-22 18:10 whitequark File Added: no-suffixes.patch
2014-12-22 18:11 whitequark File Deleted: no-suffixes.patch
2014-12-22 18:12 whitequark File Added: no-suffixes.patch
2014-12-22 18:12 whitequark Note Added: 0012945
2014-12-22 18:15 doligez Note Added: 0012946
2014-12-22 19:42 doligez Status new => confirmed
2014-12-27 09:46 gasche Note Added: 0012992
2014-12-27 09:46 gasche Status confirmed => resolved
2014-12-27 09:46 gasche Fixed in Version => 4.02.2+dev / +rc1
2014-12-27 09:46 gasche Resolution open => fixed
2014-12-27 09:46 gasche Assigned To => whitequark
2016-12-07 11:47 xleroy Status resolved => closed
2017-02-23 16:38 doligez Category OCaml internal build/install (Makefiles, configure) => configure and build/install


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker