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

Re: Crosscompiling rust apps ?



Hi Matthias,

On Sun, Aug 31, 2025 at 09:13:11PM +0200, Matthias Geiger wrote:
> I 'd like some input/help on [0].
> According to [1] the crossbuild fails because the relevant meson snippet is
> not set. Would a crossbuild work once that is implemented ?

I don't know. I stopped there because working around further problems
gets annoying rather quickly and the main motivation for my cross
porting work is to fix toolchain issues exactly like the one in meson's
env2mfile here. Fixing glycin itself is less important to me.

> On a similar note, a standalone rust program crosscompiles fine: [2]
> However, it fails because the manpage is generated from the binary which is
> expected to be executable during build time. What would be the best way to
> fix this ?

I think this is most commonly known as "the help2man problem". The
TL;DR is that there are no nice solutions. Your bad options are:
 * Write a real manual page.
 * Generate the manual page before creating the source package and do
   not render it at build time.
 * If you have few Build-Depends, you may duplicate them all as :native
   and perform an additional native build just for generating the manual
   page.
 * You might Build-Depends: $yourself <cross> and run the installed
   native version of the tool to generate the manual page.
 * You may write some code parsing the Rust source (e.g. using Perl) and
   extract the manual page without actually building it.
 * You may compromise on reproducibility and skip installing a manual
   page for cross builds (or only support cross building with a nodoc
   profile).
 * You may split manual pages into an Arch:all package.
 * You may decide that the convenience of having a manual page is more
   important than spending effort on cross building.

So yeah, you do have lots of options, but they're all bad.

Helmut


Reply to: