#1135775 support build profiles in the gcc build

Package:
src:gcc-16
Source:
src:gcc-16
Submitter:
Helmut Grohne
Date:
2026-07-08 21:09:02 UTC
Severity:
normal
Tags:
#1135775#5
Date:
2026-05-05 18:33:36 UTC
From:
To:
Hi Matthias,

a while ago, we talked about supporting the build profile notation in
the gcc packaging. For example, you could set
DEB_BUILD_PROFILES=pkg.gcc.norust instead of setting
DEB_BUILD_OPTIONS=nolang=rust. Beyond being the mechanism documented by
Debian policy, this mechanism enables building the package with fewer
Build-Depends and debian/control tells in advance what packages will
result from the build given a set of build profiles.

I am attaching a patch implementing this for two example profiles. I
chose rust as a language profile with practical benefits (as the cargo
dependency is not cross-satisfiable and this prevents gcc from being
cross built) and nobiarch as an invasive profile showing how the
approach scales. In particular, the patch adds a function "plfilt" that
implements the condition checking for build profiles. It thus leaves the
older mechanisms available as you requested. Please let me know if you
like the approach.

If you agree, I can extend the patch to cover most nolang values, but
I'd want to have some agreement beforehand, because this patch is very
likely to produce conflicts with ongoing package changes and I wouldn't
want to rebase it.

Helmut

#1135775#10
Date:
2026-07-07 12:39:15 UTC
From:
To:
I don't like the "verbosity" of these profiles, but it is what it is.

Did you check just building with DEB_BUILD_OPTIONS="nobiarch nolang=...
nohppa64 nogcn nonvptx" ?

Are you implementing that for all languages, the offload compilers,
hppa64 and biarch?

Matthias

#1135775#13
Date:
2026-07-07 12:39:15 UTC
From:
To:
I don't like the "verbosity" of these profiles, but it is what it is.

Did you check just building with DEB_BUILD_OPTIONS="nobiarch nolang=...
nohppa64 nogcn nonvptx" ?

Are you implementing that for all languages, the offload compilers,
hppa64 and biarch?

Matthias

#1135775#18
Date:
2026-07-07 13:42:36 UTC
From:
To:
Hi Matthias,

Are you referring to the "pkg.gcc." prefix or something else?

I no longer know what I checked, but that sounds like a good test before
applying a patch.

That is the question I am trying to figure out. The patch I posted is to
be understood as an example patch. It demonstrates one way of adding
build profiles to gcc. As indicated, adding it for all languages and
other features is a lot of work. I'm not here to perform that work and
then have a patch sit in the BTS for years as is happening for many
other patches. So this is one of the patches where I want to have
agreement on the approach before doing the work.

What I'm asking from you now is agreeing with the approach taken (if you
actually do agree) as well as a list of requirements. Possible
requirements:
 * The full patch should pass building with DEB_BUILD_OPTIONS="nobiarch
   nolang=... nohppa64 nogcn nonvptx".
 * The full patch should implement profiles for all languages and other
   features such as biarch, hppa64, gcn and nvptx that can now be
   disabled via nolang.

Of course, such a list cannot be exhaustive. There are things you only
spot in retrospect, but you can spell out the ones that you readily see
as relevant now.

I also ask you to review the produced patch in a timely manner, because
it likely produces merge conflicts quickly. We can also form an
agreement to reduce the chances of conflicts such as you telling me what
gcc version (17?) I should base this on and when to start.

The other approach we can take here is being iterative. In that
scenario, you'd merge my patch as is given a promise that I follow up
with other profiles. This produces smaller diffs and takes a while.

In either case, I agree to look into regressions and I shall produce
patches addressing them.

Helmut