Page MenuHomeFreeBSD

release: Use the ABI of the target release to fetch packages
ClosedPublic

Authored by jhb on Apr 11 2024, 5:44 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, May 10, 4:34 PM
Unknown Object (File)
Fri, May 3, 10:29 PM
Unknown Object (File)
Sun, Apr 28, 12:45 PM
Unknown Object (File)
Fri, Apr 26, 5:03 AM
Unknown Object (File)
Thu, Apr 25, 10:33 PM
Unknown Object (File)
Wed, Apr 24, 4:21 AM
Unknown Object (File)
Tue, Apr 16, 4:09 AM
Unknown Object (File)
Mon, Apr 15, 7:29 AM
Subscribers

Details

Summary
  • Point --rootdir at the installed destdir in the dvd tree. This causes pkg to determine the ABI from the installed destdir instead of the host's binaries. Previously the result was that packages for the host's ABI were always downloaded breaking cross-releases (e.g. arm64 releases built on an amd64 host included amd64 packages on the DVD ISO image rather than arm64 packages). This also handles version mismatches, and I tested this by cross-building a 15.x arm64 release on a 14.x amd64 host.
  • As a result, pkg now does a chdir(3) to the rootdir before running, so the -o argument to fetch needs to be updated to be relative to rootdir instead of the CWD as make runs.
  • Add a new ROOTDIR variable to limit references to "dvd" to one place. Ideally ROOTDIR would be an argument to this script so that it didn't really know about the dvd layout at all.
  • While here, simplify creation of symlinks by just using a longer path to the link name instead of using 'cd' in the shell before invoking ln(1). Also use ln -sf to create the pkg.pkg symlink rather than rm + ln.

PR: 278273
Reported by: gatekeeper <tiago.gasiba@gmail.com>

Diff Detail

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

Event Timeline

jhb requested review of this revision.Apr 11 2024, 5:44 PM
release/scripts/pkg-stage.sh
12

The pkg config invocations need to leave out the -d. We could choose to pass -d explicitly to the later pkg invocations instead perhaps which would allow the pkg config invocations to use PKGCMD directly limiting the places that need the explicit --rootdir.

I'm also not sure how helpful the -d messages really are in practice. They seemed quite verbose in my testing.

58

If it is helpful I could split out the changes to remove cd into a single commit prior to this current commit.

These seem reasonable, but I don't know pkg pedantically enough to know if they are completely correct or not.

This revision is now accepted and ready to land.Apr 11 2024, 7:26 PM
delphij added a subscriber: delphij.
delphij added inline comments.
release/scripts/pkg-stage.sh
88

maybe just use the variable?

release/scripts/pkg-stage.sh
88

Oh, yes.