#1135775 support build profiles in the gcc build

Package:
src:gcc-16
Source:
src:gcc-16
Submitter:
Helmut Grohne
Date:
2026-05-05 18:47: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