Bug 242835 - concurrency issue when building kernel with 'make -j8': make[5]: make[5]: don't know how to make opt_global.h. Stop
Summary: concurrency issue when building kernel with 'make -j8': make[5]: make[5]: don...
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
: 249957 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-12-23 15:56 UTC by Martin Birgmeier
Modified: 2024-03-23 10:19 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Birgmeier 2019-12-23 15:56:16 UTC
Scenario:
- System running FreeBSD 13.0-CURRENT #0 r355526M: Sun Dec  8 16:30:56 CET 2019
- /usr/src updated to r356034 (head)
- Executing 'make -j8 buildworld buildkernel KERNCONF=...'

Result:
- In most cases, the make fails with
    >>> stage 3.1: building everything
    ...
    make[4]: make[4]: don't know how to make opt_global.h. Stop

Notes:
- Omitting -j8 gets the build to succeed

It seems that the parallel makes repeatedly recreate opt_global.h, thereby thrashing each other's copies.
Comment 1 Martin Birgmeier 2023-10-27 08:51:26 UTC
*** Bug 249957 has been marked as a duplicate of this bug. ***
Comment 2 Martin Birgmeier 2023-10-27 09:12:21 UTC
The saga goes on... first, I realized that I reported this twice, so I closed the second bug #249957 as a duplicate.

One crucial point seems to be that both the source and object directories are on NFS. When switching the object directory to a local one, the issue does not occur.

Still with an NFS-mounted object dir the issue also does not seem to occur when rebuilding an already built kernel (even if the cleaning step is run, as it normally is).
Comment 3 Martin Birgmeier 2023-11-19 09:20:28 UTC
I also tried adding a sleep of a few seconds after the config which generates opt_global.h, to no avail.

It should be noted that all the machines are running ntp, with a few milliseconds of time difference between them.

Also, if I rerun the make buildkernel with -DNO_CLEAN, it always succeeds.

-- Martin
Comment 4 Martin Birgmeier 2024-03-23 10:19:10 UTC
I still have this on stable/14.

-- Martin