Skip to content

Conversation

@patmaddox
Copy link
Contributor

e37cf98 changed pkg update to only update FreeBSD repo. 14.3 now ships with two repos configured - FreeBSD and FreeBSD-kmods. Later calls to pkg rquery and pkg fetch failed with this multi-repo configuration.

@dch
Copy link
Contributor

dch commented Jun 28, 2025

LGTM @patmaddox how would this interact with #1025 where the url used introduces a different pkg repo?

(IMO this bug you've reported here should be fixed first)

@michael-o
Copy link
Contributor

LGTM @patmaddox how would this interact with #1025 where the url used introduces a different pkg repo?

(IMO this bug you've reported here should be fixed first)

Exactly my question!

@patmaddox
Copy link
Contributor Author

LGTM @patmaddox how would this interact with #1025 where the url used introduces a different pkg repo?

(IMO this bug you've reported here should be fixed first)

Good question. I don't know, because I haven't tested it.

Based on my understanding of things, it would at least be able to pass the rquery stage. However, the config written is pretty simple: it just writes the URL. So if the URL needs SRV records, or the repo uses a signing key that isn't acceptable to this jail, then I would expect install to fail.

Basically, this PR just addresses the fact that -b is completely broken on a brand new 14.3 jail, because 14.3 introduces a second repo into the default config.

poudriere makes a lot of assumptions regarding configuration, particularly around pre-fetching packages. More work would need to be done to support more varied configurations.

For example, I had previously patched common.sh so that I can fetch from one of my repos and reuse packages across ABI-compatible jails:

        cat >> "${MASTERMNT:?}/etc/pkg/poudriere.conf" <<-EOF
        FreeBSD: {
                url: "${packagesite}",
                mirror_type: "none",
                signature_type: "none"
        }
        EOF

@karolyi
Copy link

karolyi commented Jul 3, 2025

Hey,

just applied this patch individually on my poudriere-devel, and can confirm it started to fetch existing packages again.

@karolyi
Copy link

karolyi commented Jul 3, 2025

Also, not sure if it counts but I use a PACKAGE_FETCH_URL=http://my-packagemirror-url/\${ABI} setting in poudriere.conf.

@ELDiablO59152
Copy link

I patched mine has well and please can you fix the typo at : https://github.com/freebsd/poudriere/pull/1228/files#diff-afbea33008c9478b94f3379278925c57204b3283411000094ee48d2388293a5fL4491

msg "Packge fetch: bootstrapping pkg"

dsh2dsh added a commit to dsh2dsh/poudriere that referenced this pull request Aug 2, 2025
dsh2dsh added a commit to dsh2dsh/freebsd-ports that referenced this pull request Aug 2, 2025
@bdrewery bdrewery self-assigned this Aug 4, 2025
@bdrewery bdrewery added this to the 3.4.4 milestone Aug 4, 2025
@patmaddox
Copy link
Contributor Author

LGTM @patmaddox how would this interact with #1025 where the url used introduces a different pkg repo?

(IMO this bug you've reported here should be fixed first)

#1239 answers it: either overwrite the FreeBSD config entirely with no checking, or disable it and parameterize the repo name throughout

freebsd-git pushed a commit to freebsd/freebsd-ports that referenced this pull request Aug 18, 2025
This update includes a fix from freebsd/poudriere#1228
freebsd/poudriere#1228

download_from_repo: Only query and fetch from FreeBSD repo

Changelog:
dsh2dsh/poudriere@3.4.99.20250725...3.4.99.20250802

PR:		288610
Approved by:	yuri@ (Mentor)
fi
# Don't trust pkg-update to return its error
if ! injail ${pkg_bin} rquery -U %n pkg >/dev/null; then
if ! injail ${pkg_bin} rquery -U -r FreeBSD %n pkg >/dev/null; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In FreeBSD 15.0, the "FreeBSD" repo was renamed "FreeBSD-ports":

freebsd/freebsd-src@c83705a

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah going to need a matrix of repo names. A lot of complexity here now.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can steamline the names in the repo configuration: on line 4495 above when we setup /etc/pkg/poudriere.conf, we can disable the FreeBSD default repositories (FreeBSD, FreeBSD-ports, FreeBSD-ports-kmods: enabled: no) and use custom poudriere ones only?

That way the only condition is "do we also need to setup a kmods repo or not?".

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. We might need to define some of this other stuff too, which we need to consider the user can override the URL with PACKAGE_FETCH_URL which defaults to the srv type pkg+http://pkg.FreeBSD.org/\${ABI}. So will need a few more vars defaulting to the FreeBSD values.

FreeBSD-ports: {
  url: "pkg+https://pkg.FreeBSD.org/${ABI}/latest",
  mirror_type: "srv",
  signature_type: "fingerprints",
  fingerprints: "/usr/share/keys/pkg",
  enabled: yes
}

Ugh.

I'm now thinking back to #1218 and why we even need the -r. Even a pkg -r FreeBSD* with glob support might simplify things a lot here and I think @bapt would be open to it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm now thinking back to #1218 and why we even need the -r.

From what I understand, it was added to because of other repos that were enabled, and if we disable them it can be reverted (and this PR would be unneeded). I am currently in desperate need for poudriere working on FreeBSD 15.0-BETA1 when fetching latest packages, so am digging into this and will hopefully come back with a PR 😁

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I am up and running with poudriere on FreeBSD 15.0-BETA1 and building in 14.3-RELEASE-p4 and 15.0-BETA1 jails \o/. I opened #1271 with my changes.

@patmaddox can you give it a try too?

smortex added a commit to smortex/poudriere that referenced this pull request Oct 17, 2025
Older versions of FreeBSD had a single package repository, named
"FreeBSD".  FreeBSD 14.3 introduced a second repository for kernel
modules, named "FreeBSD-kmods".  FreeBSD 15.0 add support for managing
the base system with packages (aka pkgbase), and to avoid confusion for
users and emphasis they are related to ports and not the base system,
the mentioned repositories were respectively renamed "FreeBSD-ports" and
"FreeBSD-ports-kmods".

In order to fetch latest packages, poudriere tune the "FreeBSD" repo,
and attempts were made to ignore the "FreeBSD-kmods" repository
(freebsd#1218freebsd#1228), unfortunately with the changes described above in
FreeBSD 15, it is broken again.

In order to avoid this issues, disable all known variations of the
default FreeBSD repositories, and setup a single "Poudriere" repository
configured to our wills.

This will allow us to have full control of that repository without being
impacted by changes on the FreeBSD side.
e37cf98 changed `pkg update` to only update FreeBSD repo. 14.3 now
ships with two repos configured - FreeBSD and FreeBSD-kmods. Later
calls to `pkg rquery` and `pkg fetch` failed with this multi-repo
configuration.

Change-Id: Ic9870a0efc9ab9545eecd2e10281ea746a6a6964
@bdrewery bdrewery modified the milestones: 3.4.4, 3.4.5 Oct 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants