Discussion:
norust profile, and setting it by default on alpha, hppa, m68k, sh4, x32 port buildds
Add Reply
Julian Andres Klode
2024-12-20 11:30:01 UTC
Reply
Permalink
(CC me, I'm not subscribed to debian-devel or maintain ports :D)

Hi,

# norust build profile

I propose we add a `norust` build profile such that packages
building Rust parts or integrating with Rust parts can
disable those parts.

For example, if apt gains sqv support, we can define a
pkg.apt.nosqv buildprofile, but it would be nice to just
use norust too.

The norust profile must NOT be used by packages building
exclusively Rust pieces, that is, it should be possible
to bootstrap a Rust toolchain and package set with the
profile set (and potentially you need externally built
cargo idk).

# setting the profile

I then propose we inject the

DEB_BUILD_PROFILES=norust

in the buildds for the ports architectures that do not have
a rustc.

This would allow them to build packages with optional Rust
parts with reduced functionality. The same can be applied
to other toolchains.

This avoids having to encode entire lists of architectures
for those packages.

## caveats

There is a caveat in that local builds do not know about
the profiles the buildds have set. This means that you
may not easily be able to build packages locally that
are available in the ports archive.

This could be solved by encoding the build profiles in the
dpkg vendor module instead, but it may also be beneficial
to be able to experiment more and have local builds try
to build with everything.
--
debian developer - deb.li/jak | jak-linux.org - free software dev
ubuntu core developer i speak de, en
Samuel Thibault
2024-12-20 12:00:01 UTC
Reply
Permalink
Hello,
Post by Julian Andres Klode
# setting the profile
I then propose we inject the
DEB_BUILD_PROFILES=norust
in the buildds for the ports architectures that do not have
a rustc.
wanna-build would also need to be told to drop <!norust> build-deps.

Samuel
Helmut Grohne
2024-12-28 08:00:01 UTC
Reply
Permalink
Hi Julian,
Post by Julian Andres Klode
# norust build profile
I propose we add a `norust` build profile such that packages
building Rust parts or integrating with Rust parts can
disable those parts.
Thanks for taking this to the appropriate place.
Post by Julian Andres Klode
For example, if apt gains sqv support, we can define a
pkg.apt.nosqv buildprofile, but it would be nice to just
use norust too.
Contrary to what we earlier chatted on IRC, I am no longer convinced
that "norust" is a useful profile name for your use case. If you look at
the other language-specific profiles, they're all about bindings into
other languages. A common theme applicable to multiple languages is a C
library that also provides a Python and Perl extension to interface
with. The language is the addon to something that can exist without that
language. In case of Rust, it tends to go in reverse. The thing is
implemented in Rust and you interface with other ecosystems via various
mechanisms - CLI in this case.
Post by Julian Andres Klode
The norust profile must NOT be used by packages building
exclusively Rust pieces, that is, it should be possible
to bootstrap a Rust toolchain and package set with the
profile set (and potentially you need externally built
cargo idk).
I suggested this restriction for a very different reason. I don't see a
reason to want to bootstrap a Rust toolchain with a norust profile set
yet. My reason was to avoid excessive churn in lots of Rust libraries
where removing Rust removes the reason for existence. In keeping with
the spirit of other no$LANG profiles, norust has a place, but it is
bindings bolted onto other packages. However, this is not how bindings
are typically packaged. Unlike other languages Rust tends to put them
into separate crates and package them as separate Debian source packages
rendering the utility of a norust profile minimal here.

The no$LANG profiles are all (but nogir) marked as "reproducible"
profiles. That is, if you enable the profile, you do not expect output
artifacts to change (but you expect the set of output artifacts to
change). This is very much not how you intend to use norust.

Conversely, we would not expect a nopython build profile to skip
building documentation generated using sphxindoc. We would not expect a
noperl profile to skip generating pod2man documentation. I think your
use case warrants a different approach and as a result a different
naming pattern.

What you are concerned with is availability (being ported) of a
software. It's not about whether you can interface with it using that
language but about whether you can use anything that uses it. It's a
different level of not wanting something.

As a result, my preliminary conclusion here is to NACK your request
barring further insight.

My intuition now is to add a separate concept "unavailable" to the
profile naming scheme. Beyond Rust, valgrind, ebpf and llvm are fairly
obvious candidates for things you may want to integrate with but that
are not universally available on all architectures.
Post by Julian Andres Klode
I then propose we inject the
DEB_BUILD_PROFILES=norust
in the buildds for the ports architectures that do not have
a rustc.
I think this is a separate matter to defining the meaning of the
profile. I defer to port maintainers (e.g. Samuel) on this matter but
suggest that more work may be needed.
Post by Julian Andres Klode
This could be solved by encoding the build profiles in the
dpkg vendor module instead, but it may also be beneficial
to be able to experiment more and have local builds try
to build with everything.
Please add detail here. I don't think a change to dpkg is sufficient
here. For instance, sbuild would have to somehow discover the
per-architecture profiles and apply them to installing Build-Depends.
We likely need to update Debian policy here.

Helmut
Helmut Grohne
2025-01-02 07:20:01 UTC
Reply
Permalink
Hi Julian,
Post by Helmut Grohne
As a result, my preliminary conclusion here is to NACK your request
barring further insight.
I pondered your use case in my head a bit more and am less and less
convinced that build profiles are the right hammer for your screw.

Earlier, I suggested copying the valgrind-if-available approach and you
took issue with that. Unfortunately, that is now lost to IRC history.
Maybe you could summarize it here?

I also did not flesh out how I would transfer valgrind-if-available to
the problem at hand. The better model may be mysql/mariadb where we now
have src:mysql-defaults. Similarly, we could have a gpgv-defaults source
package building a default-gpgv package whose dependency depends on the
architecture. I remember that you took issue with encoding the
availability of Rust into a source package and there definitely is a
cost to this approach if it is needed for more packages. At a later
point, we may reconsider a profile based approach and use it in the
proposed gpgv-defaults package. The upshot is that this works today
without any changes to our buildd infrastructure. From an apt point of
view, you end up having a build dependency on default-gpgv. At build
time, you need to branch on what implementation actually got installed.

In the event that you move forward with this, I'd still appreciate a
pkg.apt.nosqv build profile that reverts back to gnupg for all
architectures, because I don't see a good way to add Rust to the
architecture cross bootstrap due to unresolvable disagreement with llvm
toolchain maintainers. It could also be a profile of gpgv-defaults. I'd
really like us to benefit from Rust implementations in more areas, but
the current way its requirements are packaged pose road blocks.

Helmut
John Paul Adrian Glaubitz
2025-01-02 11:10:01 UTC
Reply
Permalink
Hello,
Post by Helmut Grohne
In the event that you move forward with this, I'd still appreciate a
pkg.apt.nosqv build profile that reverts back to gnupg for all
architectures, because I don't see a good way to add Rust to the
architecture cross bootstrap due to unresolvable disagreement with llvm
toolchain maintainers. It could also be a profile of gpgv-defaults. I'd
really like us to benefit from Rust implementations in more areas, but
the current way its requirements are packaged pose road blocks.
With both gccrs and rustc_codegen_gcc in the works, I am expecting that this
problem will be eventually resolved and Rust can be deployed universally like
C/C++ or other languages supported by GCC.

The GCC backend rustc_codegen_gcc was supposed to be usable for several years
now, but it seems that upstream integration in the official Rust compiler is
rather slow unfortunately.

Adrian
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer
`. `' Physicist
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
Helmut Grohne
2025-01-02 20:50:02 UTC
Reply
Permalink
Hi Adrian,
Post by John Paul Adrian Glaubitz
With both gccrs and rustc_codegen_gcc in the works, I am expecting that this
problem will be eventually resolved and Rust can be deployed universally like
C/C++ or other languages supported by GCC.
The GCC backend rustc_codegen_gcc was supposed to be usable for several years
now, but it seems that upstream integration in the official Rust compiler is
rather slow unfortunately.
Even though that is very welcome news, gcc-15 now Build-Depends on cargo
-> rustc -> llvm. I do not see how rustc_codegen_gcc is going to resolve
this dependency chain. I also do not see us wanting to break it.
Realistically, we cannot keep all pieces that transitively depend on
llvm out of essential forever. At some point, llvm will need to be
fixed.

llvm support practically is a requirement for full ports already. It
will be a hard requirement before too long. The Python JIT now also
relies on llvm.

Helmut

Loading...