[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ORed build profiles



On Sun, 23 Nov 2025 at 08:07:15 +0100, Matthias Klose wrote:
Trying to work with ORed build profiles, either I fail to understand how to work with these, or something is wrong with the implementation.

Some working examples, from src:glib2.0, which illustrate both ORed and ANDed build-deps:

# B-D on dbus-daemon, etc. if (!nocheck) || (!noinsttest)
Build-Depends:
 dbus-daemon <!nocheck> <!noinsttest>,

# B-D-A on cross-exe-wrapper if (cross && !nogir)
Build-Depends-Arch:
 cross-exe-wrapper <cross !nogir>,

To vary whether a package is built, you use the same syntax, but in the Build-Profiles field. So for example libglib2.0-tests is only built if installed tests and GIR are both enabled, which is written like this:

# Build if (!noinsttest) && (!nogir)
Package: libglib2.0-tests
Build-Profiles: <!noinsttest !nogir>

I can never remember that <a b> means "a AND b" and <a> <b> means "a OR b" (half the time I try to use them the other way round, which is wrong), so I've got into the habit of always adding a comment to indicate intent whenever something depends on a combination of two or more build profiles.

The different syntax involving commas and plus signs as described in https://wiki.debian.org/BuildProfileSpec#The_Package-List_field is specific to the Package-List field, and is not used in Build-Depends or Build-Profiles. In fact, that section of the wiki page does have a concrete example of a valid Build-Profiles field (followed by its translation into Package-List syntax).

The comma and plus sign are also quite confusing - if the Package-List is a context where whitespace and angle brackets can't be used, I would have expected something more like cross&!nocheck|nopython, but presumably there are syntax restrictions that rule out & and | in that context as well?

    smcv


Reply to: