Page MenuHomeFreeBSD

bsd.test.mk: Attempt to work around installation race
Needs ReviewPublic

Authored by arichardson on Apr 19 2022, 9:19 PM.

Details

Summary

When building with -j128 I have seen multiple installation failures
when install binaries for tests. In cases where Makefiles set
BINDIR=${TESTSDIR}, it is not guaranteed that BINDIR exists when trying to
install the test binaries. This failure happens quite rarely (I guess the
mkdir usually completes before the test has been built and installed), but
I've seen it multiple times now.

Add a .ORDER directive to ensure that the bsd.dirs.mk installdirs target
runs before _proginstall from bsd.prog.mk.

Test Plan

I haven't seen the build failure since, but there might be a better solution.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 45241
Build 42129: arc lint + arc unit

Event Timeline

share/mk/bsd.test.mk
101

this does not look like the right place for this.

bsd.prog.mk already has .ORDER beforeinstall _proginstall
perhaps bsd.dirs.mk should have beforeinstall: installdirs ?

failing that I think .ORDER installdirs _proginstall probably belongs better in bsd.prog.mk