Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.devel > #119676 > unrolled thread
| Started by | Matthias Klose <doko@debian.org> |
|---|---|
| First post | 2025-11-23 08:10 +0100 |
| Last post | 2025-12-03 02:30 +0100 |
| Articles | 7 — 6 participants |
Back to article view | Back to linux.debian.devel
ORed build profiles Matthias Klose <doko@debian.org> - 2025-11-23 08:10 +0100
Re: ORed build profiles Bastian Blank <waldi@debian.org> - 2025-11-23 08:40 +0100
Re: ORed build profiles Ben Hutchings <ben@decadent.org.uk> - 2025-11-24 00:10 +0100
Re: ORed build profiles Johannes Schauer Marin Rodrigues <josch@debian.org> - 2025-11-24 00:20 +0100
Re: ORed build profiles Matthias Klose <doko@debian.org> - 2025-11-24 06:50 +0100
Re: ORed build profiles Simon McVittie <smcv@debian.org> - 2025-11-24 18:30 +0100
Re: ORed build profiles Guillem Jover <guillem@debian.org> - 2025-12-03 02:30 +0100
| From | Matthias Klose <doko@debian.org> |
|---|---|
| Date | 2025-11-23 08:10 +0100 |
| Subject | ORed build profiles |
| Message-ID | <LUcop-f5T8-3@gated-at.bofh.it> |
[Multipart message — attachments visible in raw view] — view raw
Trying to work with ORed build profiles, either I fail to understand how to work with these, or something is wrong with the implementation. llvm-toolchain-21 in unstable introduces a pkg.llvm.noclang build profile, to be able to only build the llvm related packages, not building anything else clang, flang, bolt, lld, lldb related. That works. However when adding additional pkg.llvm.noflang, pkg.llvm.nolld, ... build profiles for some more fine grained control (attached diff), as in Package: lld-21 Build-Profiles: <!pkg.llvm.noclang> + <!pkg.llvm.nolld> then all the packages with an ORed build profile are NOT built by default. I'm not expecting this. dpkg doesn't complain about the syntax of this field. Looking at https://wiki.debian.org/BuildProfileSpec#The_Package-List_field the spec seems to be a little bit ambiguous about that field, not giving a spec, but just some examples, and no example for ORed build profiles, and not explaining what the examples are supposed to do. There's also nothing told about the precedence of the operators, (NOT (!), OR (+), AND (,)). If there's a better place to talk about this spec (better in a bug report), please let me know. Matthias
[toc] | [next] | [standalone]
| From | Bastian Blank <waldi@debian.org> |
|---|---|
| Date | 2025-11-23 08:40 +0100 |
| Message-ID | <LUcRs-f63F-9@gated-at.bofh.it> |
| In reply to | #119676 |
On Sun, Nov 23, 2025 at 08:07:15AM +0100, Matthias Klose wrote: > Package: lld-21 > Build-Profiles: <!pkg.llvm.noclang> + <!pkg.llvm.nolld> > There's also nothing told about the precedence of the operators, (NOT (!), > OR (+), AND (,)). There are no AND and OR operators. So "+" is not a valid syntax element. You are looking for: | Build-Profiles: <!pkg.llvm.noclang> <!pkg.llvm.nolld> On this page, "+" only shows up in a different context, which is not relevant for the contents of the Build-Profiles field. Bastian -- Intuition, however illogical, is recognized as a command prerogative. -- Kirk, "Obsession", stardate 3620.7
[toc] | [prev] | [next] | [standalone]
| From | Ben Hutchings <ben@decadent.org.uk> |
|---|---|
| Date | 2025-11-24 00:10 +0100 |
| Message-ID | <LUrnr-ffZg-5@gated-at.bofh.it> |
| In reply to | #119676 |
[Multipart message — attachments visible in raw view] — view raw
On Sun, 2025-11-23 at 08:07 +0100, Matthias Klose wrote: [...] > However when adding additional pkg.llvm.noflang, pkg.llvm.nolld, ... > build profiles for some more fine grained control (attached diff), as in > > Package: lld-21 > Build-Profiles: <!pkg.llvm.noclang> + <!pkg.llvm.nolld> > > then all the packages with an ORed build profile are NOT built by > default. I'm not expecting this. dpkg doesn't complain about the > syntax of this field. > > Looking at > https://wiki.debian.org/BuildProfileSpec#The_Package-List_field > > the spec seems to be a little bit ambiguous about that field, not giving > a spec, but just some examples, and no example for ORed build profiles, > and not explaining what the examples are supposed to do. > > There's also nothing told about the precedence of the operators, (NOT > (!), OR (+), AND (,)). [...] For the Build-Profiles field, "the same restriction formula syntax from the Build-Depends field is used", and I think that is adequately documented. For the Package-List field I think the syntax is changed just to avoid whitespace in the expression. Ben. -- Ben Hutchings If God had intended Man to program, we'd have been born with serial I/O ports.
[toc] | [prev] | [next] | [standalone]
| From | Johannes Schauer Marin Rodrigues <josch@debian.org> |
|---|---|
| Date | 2025-11-24 00:20 +0100 |
| Message-ID | <LUrx7-fg5A-3@gated-at.bofh.it> |
| In reply to | #119692 |
[Multipart message — attachments visible in raw view] — view raw
Quoting Ben Hutchings (2025-11-24 00:00:56) > On Sun, 2025-11-23 at 08:07 +0100, Matthias Klose wrote: > [...] > > However when adding additional pkg.llvm.noflang, pkg.llvm.nolld, ... > > build profiles for some more fine grained control (attached diff), as in > > > > Package: lld-21 > > Build-Profiles: <!pkg.llvm.noclang> + <!pkg.llvm.nolld> > > > > then all the packages with an ORed build profile are NOT built by > > default. I'm not expecting this. dpkg doesn't complain about the > > syntax of this field. > > > > Looking at > > https://wiki.debian.org/BuildProfileSpec#The_Package-List_field > > > > the spec seems to be a little bit ambiguous about that field, not giving > > a spec, but just some examples, and no example for ORed build profiles, > > and not explaining what the examples are supposed to do. > > > > There's also nothing told about the precedence of the operators, (NOT > > (!), OR (+), AND (,)). > [...] > > For the Build-Profiles field, "the same restriction formula syntax from > the Build-Depends field is used", and I think that is adequately > documented. > > For the Package-List field I think the syntax is changed just to avoid > whitespace in the expression. Yes, that was the reasoning we used back then. There is also a good chance that build profiles will be part of Debian Policy soon. The latest version of the text (last message in the bug) is much better written than the BuildProfileSpec page in the Debian wiki and might thus be a better document to read to understand how it is supposed to work: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=757760 Thanks! cheers, josch
[toc] | [prev] | [next] | [standalone]
| From | Matthias Klose <doko@debian.org> |
|---|---|
| Date | 2025-11-24 06:50 +0100 |
| Message-ID | <LUxCx-fk7T-1@gated-at.bofh.it> |
| In reply to | #119693 |
On 11/24/25 00:12, Johannes Schauer Marin Rodrigues wrote:
> Quoting Ben Hutchings (2025-11-24 00:00:56)
>> On Sun, 2025-11-23 at 08:07 +0100, Matthias Klose wrote:
>> [...]
>>> However when adding additional pkg.llvm.noflang, pkg.llvm.nolld, ...
>>> build profiles for some more fine grained control (attached diff), as in
>>>
>>> Package: lld-21
>>> Build-Profiles: <!pkg.llvm.noclang> + <!pkg.llvm.nolld>
>>>
>>> then all the packages with an ORed build profile are NOT built by
>>> default. I'm not expecting this. dpkg doesn't complain about the
>>> syntax of this field.
>>>
>>> Looking at
>>> https://wiki.debian.org/BuildProfileSpec#The_Package-List_field
>>>
>>> the spec seems to be a little bit ambiguous about that field, not giving
>>> a spec, but just some examples, and no example for ORed build profiles,
>>> and not explaining what the examples are supposed to do.
>>>
>>> There's also nothing told about the precedence of the operators, (NOT
>>> (!), OR (+), AND (,)).
>> [...]
>>
>> For the Build-Profiles field, "the same restriction formula syntax from
>> the Build-Depends field is used", and I think that is adequately
>> documented.
>>
>> For the Package-List field I think the syntax is changed just to avoid
>> whitespace in the expression.
>
> Yes, that was the reasoning we used back then.
>
> There is also a good chance that build profiles will be part of Debian Policy
> soon. The latest version of the text (last message in the bug) is much better
> written than the BuildProfileSpec page in the Debian wiki and might thus be a
> better document to read to understand how it is supposed to work:
>
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=757760
thanks for the pointer to the report.
sorry, the last proposed text again doesn't explicitly talk about the
Build-Profiles attribute. There are too many "I think"'s here, and e.g.
claims that these don't support ORs, while the spec *is* talking about
ANDing and ORing.
"Thinking" in a spec should be avoided. Plus dpkg apparently doesn't
properly check the supposed/intended syntax.
Please be explicit about the Build-Profiled attribute, and give some
examples like you did for the Build-Depends field.
The spec should be explicit about
- Are <> part of the list?
- Where is whitespace allowed/prohibited?
- Having examples for the Build-Profiles attribute, without referencing
the Build-Depends attribute.
Please update the spec.
Matthias
[toc] | [prev] | [next] | [standalone]
| From | Simon McVittie <smcv@debian.org> |
|---|---|
| Date | 2025-11-24 18:30 +0100 |
| Message-ID | <LUIxX-frqz-1@gated-at.bofh.it> |
| In reply to | #119676 |
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
[toc] | [prev] | [next] | [standalone]
| From | Guillem Jover <guillem@debian.org> |
|---|---|
| Date | 2025-12-03 02:30 +0100 |
| Message-ID | <LXJQR-hxWc-9@gated-at.bofh.it> |
| In reply to | #119706 |
Hi! On Mon, 2025-11-24 at 17:23:31 +0000, Simon McVittie wrote: > 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? While trying to improve both the dpkg documentation and parsing of the build profiles (prompted by the misunderstanding from this thread), I stumbled again into an old problem, where we never defined the set of valid characters to use as profile names, and where we have colliding character set overloading from different contexts. This had already bothered me with the current namespace separator «.» (as listed in https://wiki.debian.org/Teams/Dpkg/TimeTravelFixes). But with the profile property in the Package-List field, this is worse, because «+» is a valid package name as well and nothing has prevented its use. I also agree that «,» and «+» are confusing and the more obvious «&» and «|» would be way better. Unfortunately I don't think it's safe to change the format of the current profile property, _but_ we can version it and deprecate the older one! So I've just implemented a new profile:v1 property deprecating the profile (v0) one that maps using the characters you suggested, thank you! Queued to be part of my next push targeting dpkg 1.23.0. I still think the valid characters for profile names need to be defined, and I'd really like to progressively change the namespace separator from «.» to «/» as well. Will bring that up in the policy report though. Regards, Guillem
[toc] | [prev] | [standalone]
Back to top | Article view | linux.debian.devel
csiph-web