Bug 259785 - pkgbase installation order is underspecified
Summary: pkgbase installation order is underspecified
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: Mark Johnston
URL:
Keywords: pkgbase
Depends on:
Blocks:
 
Reported: 2021-11-11 20:54 UTC by Mark Johnston
Modified: 2022-12-16 03:52 UTC (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Johnston freebsd_committer freebsd_triage 2021-11-11 20:54:30 UTC
I did a pkg upgrade on a pkgbase-enabled laptop and got the following, though the upgrade completed successfully:

[1/364] Upgrading glib from 2.70.0_1,2 to 2.70.1,2...                                                                                                          
[1/364] Extracting glib-2.70.1,2: 100%                                                                                                                         
[2/364] Deinstalling FreeBSD-utilities-14.snap20211022204826...                                                                                                
[2/364] Deleting files for FreeBSD-utilities-14.snap20211022204826: 100%                                                                                       
[3/364] Upgrading harfbuzz from 3.0.0 to 3.1.0...                                                                                                              
[3/364] Extracting harfbuzz-3.1.0: 100%                                                                                                                        
/bin/sh: /usr/sbin/service: not found                                                                                                                          
pkg: POST-INSTALL script failed                                                                                                                                
[4/364] Upgrading sqlite3 from 3.35.5_3,1 to 3.35.5_4,1...                                                                                                     
[4/364] Extracting sqlite3-3.35.5_4,1: 100%                                                                                                                    
/bin/sh: /usr/sbin/service: not found                                                                                                                          
pkg: POST-INSTALL script failed                                                                                                                                
[5/364] Upgrading FreeBSD-runtime from 14.snap20211022204826 to 14.snap20211102230608...
[5/364] Extracting FreeBSD-runtime-14.snap20211102230608: 100%
[6/364] Upgrading libva from 2.13.0 to 2.13.0_1...
[6/364] Extracting libva-2.13.0_1: 100%
/bin/sh: /usr/sbin/service: not found
[7/364] Upgrading icu from 69.1,1 to 70.1_1,1...
[7/364] Extracting icu-70.1_1,1: 100%                                          
/bin/sh: /usr/sbin/service: not found                                          
pkg: POST-INSTALL script failed                                                
[7/364] Installing FreeBSD-utilities-14.snap20211102230608...
[7/364] Extracting FreeBSD-utilities-14.snap20211102230608: 100%

So there's a window where FreeBSD-utilities (which contains /usr/sbin/service) is uninstalled, and that causes random script failures.  pkg should be configured somehow to avoid creating such windows.

It looks like we split the upgrade job into two because of this conflict:

Checking integrity... done (1 conflicting)                                                                                                                                                                                                                                                                                    
  - FreeBSD-runtime-14.snap20211102230608 [FreeBSD-base] conflicts with FreeBSD-utilities-14.snap20211022204826 [installed] on /usr/share/man/man8/sconfig.8.gz

A little while ago I fixed pkg to ensure that upgrade-deletion jobs are processed before upgrade-installation jobs, but I guess we need to go further and try to minimize the window where such a package is uninstalled.
Comment 1 Graham Perrin freebsd_committer freebsd_triage 2022-10-08 19:03:36 UTC
In 263879 comment 8, markj@ wrote: 

> … I will work on PR 259785.