Page MenuHomeFreeBSD

Makefile: Don't allow install{world,kernel} with pkgbase
ClosedPublic

Authored by ivy on Fri, Oct 3, 2:00 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Oct 20, 11:17 PM
Unknown Object (File)
Mon, Oct 20, 2:05 PM
Unknown Object (File)
Mon, Oct 20, 11:16 AM
Unknown Object (File)
Mon, Oct 20, 11:07 AM
Unknown Object (File)
Mon, Oct 20, 11:05 AM
Unknown Object (File)
Sat, Oct 18, 1:57 AM
Unknown Object (File)
Thu, Oct 16, 7:51 PM
Unknown Object (File)
Thu, Oct 9, 6:05 PM

Details

Summary

Using these targets on a pkgbase system will cause the installed system
to become out of sync with the package database, which is almost certain
to cause issues the next time pkg(8) is used.

To prevent users doing this accidentally, disallow install* if we detect
that FreeBSD-runtime is installed in the target. The check can be
overridden with DESTDIR=/ for users who are sure they want to do this.

MFC after: 3 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ivy requested review of this revision.Fri, Oct 3, 2:00 AM

I see the rationale for this as an anti-foot-shooting device, but I'm not sure if the FreeBSD user community is ready for this yet.

I'm inclined to either make this switch in 16 or email freebsd-current to solicit feedback first.

Looks like a reasonable safeguard.

not sure if the FreeBSD user community is ready for this yet

I could see this tripping up folks, but just as easily I can imagine someone using pkgbase, then installworld over top and complaining about a mixed-up installation.

While I was initially an objector to this and am not a big fan of BASIFY. This seems like
a reasonable compromise that is easy enough to tool around. So as to keep current work
flows working w/o too much disruption. Thank you for taking the time to make this work
for everyone. :-)

i posted about this on stable@ and current@ a week ago and no has objected, so i'd really like to land this if possible.

I could see this tripping up folks, but just as easily I can imagine someone using pkgbase, then installworld over top and complaining about a mixed-up installation.

right. the difference is in the first case, the user just needs to learn the right way to do this dangerous action, in the second case the user ends up with a broken system with no warning. i think the first case is much preferable, because while this might mildly annoy users, the second case will be much more annoying :-)

and let's be clear, someone is going to do this by accident, and then complain that pkgbase broke their system... and they won't be entirely wrong about that if we let them do this.

arrowd added inline comments.
Makefile.inc1
1370

Can we add some I_KNOW_WHAT_IM_DOING override here, to make it still possible to run make install{world,kernel} on a pkgbase'd system?

Makefile.inc1
1370

I should've probably try reading the error message first. Sorry for the noise.

emaste added inline comments.
Makefile.inc1
590

A little unfortunate that this is decoupled from the other pkg variables. Maybe move the rest of them up so they're still grouped with the .if make(*package*) in the middle of them?

1372

Maybe ${.TARGET} should not be used?

This revision is now accepted and ready to land.Fri, Oct 17, 1:32 PM
ivy marked 3 inline comments as done.Fri, Oct 17, 6:43 PM
ivy added inline comments.
Makefile.inc1
1372

i tried this originally, but it doesn't work:

ERROR: __installcheck_PKG should not be used on a system installed from packages.
ivy marked an inline comment as done.

keep the PKG_* variables together

there's no real need to conditionally define these, so define them all
together. however keep the .export behind .if, just in case.

This revision now requires review to proceed.Fri, Oct 17, 6:55 PM
emaste added inline comments.
Makefile.inc1
1372

Oh, yeah. I imagine there's some awkward way it could be done, but not worth the complexity/confusion.

This revision is now accepted and ready to land.Fri, Oct 17, 7:03 PM