Opened 16 years ago

Closed 16 years ago

#967 closed defect (fixed)

parallel builds (make -j4) fail because of unexpressed dependencies

Reported by: gdt@… Owned by: diego@…
Priority: normal Component: build system
Version: HEAD Severity: minor
Keywords: Cc:
Blocked By: Blocking:
Reproduced by developer: no Analyzed by developer: no

Description

In vidix/Makefile, note that the following also generates several .h files, but that dependency isn't expressed. If I build (via pkgsrc) with make -j4 or -j3, then often (but not always), the build fails because make is building something that includes one of the .h files before this step has finished.

pci_names.c pci_dev_ids.c: pci.db

LC_ALL=C awk -f pci_db2c.awk $<

To repeat, compile with make -j8 several times.

To fix, probably add the .h files to the left hand side.

Attachments (1)

patch-ai (653 bytes ) - added by gdt@… 16 years ago.
patch to fix parallel build failure

Download all attachments as: .zip

Change History (8)

comment:1 by diego@…, 16 years ago

op_sys: NetBSDAll
rep_platform: PC (x86 with SSE)All
Status: newassigned

Does this problem go away if you run 'make depend'? I expect that it should.

comment:2 by gdt@…, 16 years ago

With 'gmake depend all', the build succeeds more often but not always. Even with depend, there's no rule that says that the .h files are produced.

I see the point of running depend, but I think that a program should compile reliably from tarball state without having to do make depend. (I realize that this means that modifying files may not cause recompilation.) I will test a patch to record the dependencies properly.

by gdt@…, 16 years ago

Attachment: patch-ai added

patch to fix parallel build failure

comment:3 by gdt@…, 16 years ago

This patch expresses the dependency of 3 more files created by the awk script, and that two .c files include the generated files. Not all dependencies are expressed; we cheat by assuming that depending on one file will ensure that the script has been run, which really creates all 5. With this, parallel builds seem to work.

comment:4 by diego@…, 16 years ago

Version: 1.0rc2HEAD

The real issue is something else: 'make depend' does not generate dependency information for objects with a name that is not directly derived from the source file by replacing .c with .o. This could be tricky to fix properly.

comment:5 by gdt@…, 16 years ago

Version: HEAD1.0rc2

I think that 'make depend' only needs to generate dependencies that are not already expressed in the makefile. Do you object to my patch? I think it fixes the problem, and then make depend will still do what it's supposed to do.

comment:6 by diego@…, 16 years ago

Version: 1.0rc2HEAD

Note: Please don't mess with the Version field, I changed it on purpose.

(In reply to comment #5)

I think that 'make depend' only needs to generate dependencies that are not
already expressed in the makefile. Do you object to my patch? I think it
fixes the problem, and then make depend will still do what it's supposed to do.

Your patch fixes the problem but it is not complete since it only adds partial dependency information. Also, this problem could be lurking in other directories as well.

comment:7 by diego@…, 16 years ago

Resolution: fixed
Status: assignedclosed

I just committed a fix for this issue.

Note: See TracTickets for help on using tickets.