Page MenuHomeFreeBSD

build.7: Improve building pkgbase
ClosedPublic

Authored by ziaee on May 10 2025, 9:33 PM.
Referenced Files
F132111104: D50289.id155486.diff
Mon, Oct 13, 7:43 PM
Unknown Object (File)
Mon, Oct 13, 6:22 AM
Unknown Object (File)
Sun, Oct 12, 6:29 PM
Unknown Object (File)
Sun, Oct 12, 5:05 PM
Unknown Object (File)
Sat, Oct 11, 2:39 AM
Unknown Object (File)
Thu, Oct 9, 8:31 PM
Unknown Object (File)
Thu, Oct 9, 8:31 PM
Unknown Object (File)
Thu, Oct 9, 8:31 PM

Details

Summary
The packages target was previously listed under kernel, move it to the
general source make targets listing. Add the update-packages target as
well. Adjust the release building targets with package in their names
to clarify they are unrelated to pkgbase. Add the OBJROOT and REPODIR
variables to ENVIRONMENT.

MFC after:              3 days
Suggestions by:         des, emaste, ivy, kevans, markj
Fixes:                  1d26746cfd4a (Document the packages target)
Fixes:                  0ac8aa55da1c (Add incremental packages)
Fixes:                  26490d9b74f0 (allow update-packages for first)
Differential Revision:  https://reviews.freebsd.org/D50289

Diff Detail

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

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
share/man/man7/build.7
296

the ABI dir is appended to REPODIR, so this should probably just be /usr/obj/${SRCDIR}/repo

Add REPODIR to ENVIRONMENT

Switch repodir and pkgabi

This revision is now accepted and ready to land.May 14 2025, 9:03 PM

Does this fix it?
Also included, try to improve the release targets unrelated to pkgbase.

This revision now requires review to proceed.May 15 2025, 12:24 AM

Thank you, this version is more useful.

share/man/man7/build.7
295

REPODIR's default value is /${OBJDIR}/${SRCDIR}/repo. It'd be useful to mention that.

ziaee marked an inline comment as done.

Thanks Mark, that's really great info!
I added that to the REPODIR description in ENVIRONMENT.

This revision is now accepted and ready to land.Aug 8 2025, 1:24 PM
des added inline comments.
share/man/man7/build.7
306

“...unrelated to packaged base” or something like that; either way, “packages” should not be marked up since you are not directly referencing the target.

450

“...unrelated to packaged base” or something like that; either way, “packages” should not be marked up since you are not directly referencing the target.

737

“packages” should not be marked up since you are not directly referencing the target.

739

I suggest you explain OBJROOT in a separate entry.

ziaee marked 8 inline comments as done.

+ Add an entry for OBJROOT

This revision now requires review to proceed.Aug 28 2025, 7:06 PM

oops, forgot to switch it on line 729

share/man/man7/build.7
306

again, “packages” is not a command here.

450

again, “packages” is not a command here.

680

No, OBJROOT is not user-settable, so it does not default to anything.

737

again, “packages” is not a command here.

attmpt to fix objroot but honestly I don't really understand what I'm reading here.

ivy requested changes to this revision.Thu, Sep 25, 1:35 AM
ivy added inline comments.
share/man/man7/build.7
285

this could be rephased as "packages that can be used to install or upgrade the base system".

286

there is no input repository

389

i think this is trying to say that the repository can already exist if you ran (update-)packages before, but it's not very clear.

"make packages" and "make update-packages" do the same thing up until the very end of the build: they create a new package repository in ${REPODIR}. the difference is that update-packages then copies some old packages from the previous repository version.

704

instead of saying "pkg(7) targets", perhaps just say "packages". i don't think it's clear what a "pkg(7) target" is. there's one or two other instances of this.

734

this is missing a word somewhere: right now it says setting REPODIR will create the repository, which is wrong, the repository is always created if you run make packages.

perhaps change to "The root directory used to create the package repository for make packages", or something along those lines.

This revision now requires changes to proceed.Thu, Sep 25, 1:35 AM
ziaee marked 3 inline comments as done.

pkg(7) targets -> packages(7), apply ivy's suggestions elsewhere

ziaee marked 2 inline comments as done and an inline comment as not done.

fix a straggler

ziaee added inline comments.
share/man/man7/build.7
389

I do not know how to fix this. This is excessively complicated. That logic should be added to the packages target, while we can, and update-packages should really cease existing.

kevans added inline comments.
share/man/man7/build.7
389

Then stop trying to make it complicated. :-)

Create or update the
.Xr packages 7
repository for the base system.
If an old repository is being updated, then packages whose contents have not changed
since the previous version will be copied into the new repository to avoid needless
updating of the version number.
.It Cm xdev-build ...

Axe ", optionally created" altogether- that information is not at all necessary.

use kevan's suggestion for update-packages

aside from one or two stray instances of .Cm packages this looks good.

on (update-)packages: i've changed my mind a bit on this, we should keep both targets because there needs to be a way to just build packages from the current version of src without messing around with the previous build. however we definitely want to steer users towards using update-packages in any other docs about this. even committers aren't aware of this right now.

This revision is now accepted and ready to land.Thu, Sep 25, 4:35 AM
ziaee edited the summary of this revision. (Show Details)

"building src into packages" > "building packages(7)"

This revision now requires review to proceed.Thu, Sep 25, 12:22 PM
This revision was not accepted when it landed; it landed in state Needs Review.Thu, Sep 25, 7:16 PM
This revision was automatically updated to reflect the committed changes.