Opened 16 years ago
Closed 16 years ago
#967 closed defect (fixed)
parallel builds (make -j4) fail because of unexpressed dependencies
Reported by: | Owned by: | ||
---|---|---|---|
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)
Change History (8)
comment:1 by , 16 years ago
op_sys: | NetBSD → All |
---|---|
rep_platform: | PC (x86 with SSE) → All |
Status: | new → assigned |
comment:2 by , 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.
comment:3 by , 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 , 16 years ago
Version: | 1.0rc2 → 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 by , 16 years ago
Version: | HEAD → 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 by , 16 years ago
Version: | 1.0rc2 → 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 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
I just committed a fix for this issue.
Does this problem go away if you run 'make depend'? I expect that it should.