Bug 240177 - sysutils/iocage: Fix `iocage upgrade` (to 11.3-RELEASE and future 12.x releases)
Summary: sysutils/iocage: Fix `iocage upgrade` (to 11.3-RELEASE and future 12.x releases)
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Michael Gmelin
URL: https://github.com/iocage/iocage/pull...
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-28 17:42 UTC by Michael Gmelin
Modified: 2019-09-19 00:54 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (araujo)
grembo: merge-quarterly?


Attachments
Fix iocage upgrade - patch (5.52 KB, patch)
2019-08-28 17:42 UTC, Michael Gmelin
no flags Details | Diff
Patch to fix iocage upgrade - updated to version (6.62 KB, patch)
2019-08-30 01:53 UTC, Michael Gmelin
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Gmelin freebsd_committer 2019-08-28 17:42:51 UTC
Created attachment 206984 [details]
Fix iocage upgrade - patch

This addresses a couple problems that prevented `iocage upgrade' from working properly.

1. Bug #229346 changed freebsd-update to exit with status code 1 in case of no more updates are available. This fixed ezjail and iocell, but broke iocage. As a result, iocage upgrade -r 11.3-RELEASE would not finish updating iocage jail config and exit with an error message. This happened first on 11.3-RELEASE and will also happen on 12.1-RELEASE

2. When updating a jail to 11.x-RELEASE on a 12.x machine, merging config files will create empty files (which then all end up as merge errors). As a result, all configuration is lost (or the attentive sysadmin exits the process in time and fixes things manually). This is caused by the fact that rcs was removed from base in 12.x. Its freebsd-update uses diff3 instead. As iocage always fetches the freebsd-update script of the target release, it gets one from 11.x which will break. This was fixed by adding rcs57 as a dependency of the package (based on the existence of "merge").

3. Upgrading multiple jails (iocage upgrade ALL -r <release>) would break, because of a workaround (setting UNAME_r in the environment) that shouldn't be required any more (iocage 1.2RC already has it removed).

I also:
- bumped revision
- moved NO_ARCH to pacify portlint

See also:
https://github.com/iocage/iocage/pull/1027
Comment 1 Michael Gmelin freebsd_committer 2019-08-30 01:53:29 UTC
Created attachment 207014 [details]
Patch to fix iocage upgrade - updated to version

The new version includes a runaway check in case future versions of freebsd-update cause breakage. I'll add a comment to this bug with a link to the commit, once it's merged into upstream.
Comment 2 Michael Gmelin freebsd_committer 2019-08-30 10:29:50 UTC
The pull request[0] has been merged[1] upstream now

[0]https://github.com/iocage/iocage/pull/1027
[1]https://github.com/iocage/iocage/commit/f66d9f0724daa03dc08cebc3f30b04abc7e97f82
Comment 3 Michael Gmelin freebsd_committer 2019-09-10 20:37:59 UTC
@araujo Do you object to any of the changes in the patch? (maintainer feedback).
Comment 4 Michael Gmelin freebsd_committer 2019-09-19 00:03:55 UTC
Taking and committing (maintainer timeout). I think it's a good point in time to commit this, as:

- It's affecting more and more people (the 11.3 update issue as well as the diff3 issue on >= 12-RELEASE).
- 11.2 is close to EoL (freebsd-update is already emitting warnings), this means more people will try to upgrade to 11.3 (and get into trouble).
- It's still >10 days from cutting 2019Q4, so if there is anything really stupid in this commit, it can be fixed before it hits quarterly.
- People on quarterly will have a fixed, but otherwise proven version in 2019Q4 (which is not 1.2, which might have new issues for all I know).
- 12.1-RELEASE is supposed to happen in Q4, which will be affected in the same way as 11.3-RELEASE is. So one more reason why we need a fixed version in 2019Q4.

Note that in addition to the patch from 2019-08-30, the commit will include a patch to allow `make check-plist'/`poudriere testport' finish successfully, something I noticed while QA'ing the patches (see https://github.com/iocage/iocage/issues/1043 for details).

Besides having the changes reviewed and merged upstream, I did local testing (including poudriere runs).
Comment 5 commit-hook freebsd_committer 2019-09-19 00:21:17 UTC
A commit references this bug:

Author: grembo
Date: Thu Sep 19 00:21:11 UTC 2019
New revision: 512299
URL: https://svnweb.freebsd.org/changeset/ports/512299

Log:
  Fix `iocage upgrade' for 11.3-RELEASE and upcoming 12.1-RELEASE[0]

  Also:
  - Fix dependencies when upgrading <12 jails running on a 12-RELEASE jailhost
    (depend on `merge' from devel/rcs57).
  - Fix to unbreak updating multiple jails at once[1].
  - Patch to `setup.py' to make `make check-plist' pass[2].
  - Move `NO_ARCH' to make portlint happy

  See:
  [0]https://github.com/iocage/iocage/pull/1027 and
  https://github.com/iocage/iocage/commit/f66d9f0724daa03dc08cebc3f30b04abc7e97f82
  [1]https://github.com/iocage/iocage/commit/47d7c28ad2db76eaba797921555bbf68a476eb9b#diff-134cbca4d064a61a693d1199494d24df
  [2]https://github.com/iocage/iocage/issues/1043

  PR:		240177
  Approved by:	araujo (maintainer timeout)

Changes:
  head/sysutils/iocage/Makefile
  head/sysutils/iocage/files/patch-iocage_lib-ioc_upgrade.py
  head/sysutils/iocage/files/patch-setup.py