Opened 12 years ago

Closed 11 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: Analyzed by developer:

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@… 12 years ago.
patch to fix parallel build failure

Download all attachments as: .zip

Change History (8)

comment:1 Changed 12 years ago by diego@…

  • op_sys changed from NetBSD to All
  • rep_platform changed from PC (x86 with SSE) to All
  • Status changed from new to assigned

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

comment:2 Changed 12 years ago by gdt@…

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.

Changed 12 years ago by gdt@…

patch to fix parallel build failure

comment:3 Changed 12 years ago by gdt@…

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 Changed 12 years ago by diego@…

  • Version changed from 1.0rc2 to HEAD

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 Changed 12 years ago by gdt@…

  • Version changed from HEAD to 1.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 Changed 12 years ago by diego@…

  • Version changed from 1.0rc2 to HEAD

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 Changed 11 years ago by diego@…

  • Resolution set to fixed
  • Status changed from assigned to closed

I just committed a fix for this issue.

Note: See TracTickets for help on using tickets.