Page MenuHomeFreeBSD

packages: Mark all sets as vital
ClosedPublic

Authored by ivy on Mon, Sep 15, 10:02 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Sep 30, 7:56 AM
Unknown Object (File)
Sat, Sep 27, 1:01 AM
Unknown Object (File)
Sat, Sep 27, 12:12 AM
Unknown Object (File)
Fri, Sep 26, 4:31 PM
Unknown Object (File)
Fri, Sep 26, 10:17 AM
Unknown Object (File)
Tue, Sep 23, 5:23 AM
Unknown Object (File)
Sun, Sep 21, 6:27 PM
Unknown Object (File)
Sun, Sep 21, 4:12 PM
Subscribers

Details

Summary
At least "minimal" must be vital, because it's required for a functional
system.  For example, we might create new packages in the future which
are required for the multi-user system and are part of the minimal set,
so it's important that users don't remove set-minimal to ensure they get
those new packages.

For the other sets, it's debatable whether they should be vital or not,
but let's start out with the assumption that if the user installed a
set, they should have to have to explicit request it be removed.  This
means if, for example, they install set-devel, then remove lldb, pkg
won't remove set-devel and cause the next "pkg autoremove" to remove
everything else that was in set-devel.

We might want to adjust this later (or possibly adjust the behaviour
of pkg(8) itself) based on user feedback.

While here, fix a typo in the description of the devel set.

Suggested by:   bapt
MFC after:      3 seconds

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 67106
Build 63989: arc lint + arc unit

Event Timeline

ivy requested review of this revision.Mon, Sep 15, 10:02 PM

I think they should all be vital, in the sense that if you've installed that metapackage then you don't want your system to ever remove it without very explicit confirmation, no?

I think they should all be vital, in the sense that if you've installed that metapackage then you don't want your system to ever remove it without very explicit confirmation, no?

these sets are different because they're required for the operating system to work. that is, if you install FreeBSD-set-devel, then remove FreeBSD-lldb, which also removes FreeBSD-set-devel, this means you won't get any future set-devel packages, but you explicitly chose that, so it's fine, and your system will still work.

but if you do something that removes FreeBSD-set-minimal, and then we decide to move (say) /bin/sh to a new FreeBSD-sh package, this will absolutely break your system next time you reboot. this is almost certainly user error, so we should just disallow that, and the user can override it if they know what they're doing.

in other words, this is intended to prevent the user from inadvertently breaking the system, but we still assume the user actually reads the proposed plan from pkg before pressing y.

I think my complaint is that, iirc, all of the metapackage dependencies are marked as automatic. As soon as they break the set as you suggest, the remainder would be subject to autoremove

I think my complaint is that, iirc, all of the metapackage dependencies are marked as automatic. As soon as they break the set as you suggest, the remainder would be subject to autoremove

right, but if you run pkg remove FreeBSD-set-devel followed by pkg autoremove, don't you expect all of clang etc. to be removed?

if the user does this by accident then runs pkg autoremove, they will see it's trying to remove FreeBSD-clang or whatever and can abort and rectify the situation.

In D52562#1200178, @ivy wrote:

I think my complaint is that, iirc, all of the metapackage dependencies are marked as automatic. As soon as they break the set as you suggest, the remainder would be subject to autoremove

right, but if you run pkg remove FreeBSD-set-devel followed by pkg autoremove, don't you expect all of clang etc. to be removed?

if the user does this by accident then runs pkg autoremove, they will see it's trying to remove FreeBSD-clang or whatever and can abort and rectify the situation.

I would expect that, yes, but that isn't the scenario you proposed.

if you install FreeBSD-set-devel, then remove FreeBSD-lldb, which also removes FreeBSD-set-devel, this means you won't get any future set-devel packages, but you explicitly chose that, so it's fine, and your system will still work.

If I remove freebsd-lldb, which removes set-devel, the next auto remove will wipe out everything else in set-devel that I presumably wanted to keep.

ivy retitled this revision from packages: Mark 'minimal' and 'base' sets as vital to packages: Mark all sets as vital.Tue, Sep 16, 9:22 PM
ivy edited the summary of this revision. (Show Details)

based on feedback and discussion, mark all sets as vital

Yeah, I'm happy with that, thanks. I recognize this is maybe not ideal for more flexible system construction (piece together your own based on a set and removing some), but IMO we should err on the side of caution and consider whether we can do something to enable better behavior with the final form of pkg groups.

This revision is now accepted and ready to land.Wed, Sep 17, 6:52 PM

Yeah, I'm happy with that, thanks. I recognize this is maybe not ideal for more flexible system construction (piece together your own based on a set and removing some), but IMO we should err on the side of caution and consider whether we can do something to enable better behavior with the final form of pkg groups.

i think the real problem here is that pkg(8) just doesn't handle this very well, for which i've filed https://github.com/freebsd/pkg/issues/2517 upstream.

This revision was automatically updated to reflect the committed changes.