Page MenuHomeFreeBSD

etcupdate: Support building with BUILD_WITH_STRICT_TMPPATH enabled
AbandonedPublic

Authored by jrtc27 on Jul 26 2023, 12:56 AM.
Tags
None
Referenced Files
F102670642: D41191.diff
Fri, Nov 15, 3:41 PM
Unknown Object (File)
Mon, Oct 21, 11:41 AM
Unknown Object (File)
Mon, Oct 21, 11:41 AM
Unknown Object (File)
Mon, Oct 21, 11:41 AM
Unknown Object (File)
Sep 29 2024, 3:14 AM
Unknown Object (File)
Sep 17 2024, 2:33 PM
Unknown Object (File)
Sep 17 2024, 6:08 AM
Unknown Object (File)
Sep 16 2024, 9:10 PM
Subscribers

Details

Reviewers
jhb
brooks
Summary

In order to be able to build these various targets, we need host tools
to be available to the build, and so must first build _worldtmp to
ensure that host-symlinks is run on a skeleton worldtmp. A few tools we
need are also expected to have (maybe) been built from source, not use
the host version unconditionally (e.g. awk, sed and cat), so we also
need to run _legacy and _bootstrap-tools.

Also, whilst we could previously get away with MAKEOBJDIRPREFIX not
being set for distrib-dirs, we need it with BUILD_WITH_STRICT_TMPPATH as
it determines where worldtmp is, and thus what PATH is set to. Since
every make invocation now needs it, we can just export it up-front
rather than setting it every time (and even if it wasn't needed, it does
no harm and is simplifying).

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 52846
Build 49737: arc lint + arc unit

Event Timeline

usr.sbin/etcupdate/etcupdate.sh
221

Should these be MK_...=no instead in order to be extra sure about overriding?

Use MK_...=no over -DWITHOUT_... as we're more like the build system poking at internals

I wonder if mergemaster needs similar changes?

In D41191#938223, @jhb wrote:

I wonder if mergemaster needs similar changes?

Isn't it unusable post-SVN?

Thanks for fixing this - I wonder if it's time to try turning on strict tmppath by default again upstream. I initially tried that but gave up after noticing that it broke various cases like etcupdate that I didn't have time to debug.

This revision is now accepted and ready to land.Jul 26 2023, 5:10 PM

Thanks for fixing this - I wonder if it's time to try turning on strict tmppath by default again upstream. I initially tried that but gave up after noticing that it broke various cases like etcupdate that I didn't have time to debug.

We discussed that on our CheriBSD releng call today. I think the start of the 15 cycle is a good time to try that out again and see who/what else screams.

usr.sbin/etcupdate/etcupdate.sh
225

I really kind of wish there was a top-level target that could be used here in Makefile.inc1 that was all the bits that aren't distrib-dirs and distribution

usr.sbin/etcupdate/etcupdate.sh
225

Something like make buildetc or some such, then this clause can become something like:

(cd $SRCDIR; export MAKEOBJDIRPREFIX=$destdir/usr/obj; $make buildetc &&
     $make DESTDIR=$destdir distrib-dirs &&
     $make DESTDIR=$destdir distribution) || return 1
usr.sbin/etcupdate/etcupdate.sh
225

That would run distrib-dirs after _obj and everything, which differs. Though I do wonder why distrib-dirs is there at all; doesn't distribution do a superset of that?

I guess it's also worth thinking about whether we need to support building older source trees that don't have fancy new targets. Technically that's already differing with this patch because _cleanworldtmp isn't split out in older source trees, but all that means is you spend a bit of extra time cleaning an already-clean directory (since MAKEOBJDIRPREFIX set above is definitely ours and clean). IMO if you're doing that though you should be using the etcupdate from that source tree...

usr.sbin/etcupdate/etcupdate.sh
225

Oh, never mind, they share a target but they use ${.TARGET} so are not in fact the same thing