freebsd / poudriere

Port/Package build and test system
https://github.com/freebsd/poudriere/wiki
BSD 2-Clause "Simplified" License
393 stars 162 forks source link

Store hash of port metadata into the package for incremental rebuild #993

Open bdrewery opened 2 years ago

bdrewery commented 2 years ago

In https://cgit.freebsd.org/ports/commit/?id=eca58e3768122a0ef093f62ad91760e4341f5df1 the default ruby was changed to 3.0 but because lang/ruby30 conditionalizes installing /usr/local/bin/ruby, and it was not PORTREVISION bumped, it did not rebuild to get the new file. This causes downstream port failures that do rebuild and install lang/ruby30 only to find no ruby.

This got me thinking about storing PLIST_SUB but it would probably be better to pick a list of variables, hash them, and then store that in a pkg annotation. If the annotation does not match when doing incremental rebuild/fetch then the package will be rebuilt.

A remaining issue is that pkg upgrade wouldn't know to reinstall ruby30 in this case to get the new file. It would need to track this metadata hash as well.

bdrewery commented 2 years ago

It's almost like we need something more generic to tell pkg upgrade that it must reinstall a particular package because it was rebuilt or modified.