git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] meson: distinguish build and target host binaries

From
Patrick Steinhardt <ps@pks.im>
Date
Mar 4, 2025, 09:07 UTC
Message-ID
<Z8bC5LINEPmoarRy@pks.im>
In-Reply-To
<20250303150956.24a1815e@gmx.net>
On Mon, Mar 03, 2025 at 03:09:56PM +0100, Peter Seiderer wrote:
Show 12 quoted lines
> > this patch addresses the issue reported at [1], where it is impossible
> > to specify the shell, Python and Perl paths during cross-compilation
> > when using Meson.
> 
> I still believe that is is a 'misuse' of the cross-file (as stated already
> here [1]) the given programs in cross-file are to be meant to run while
> cross-compiling (at compile time) and not on the target (e.g. it would be
> impossible to find a program (as the name find_program indicates) at
> compile/configure where the target layout is yet unknown....
> 
> I believe the correct solution is an extra configure option for cross-compile
> and a sane default (or find_program) in case of native build...
I'm mostly going by Eli's assessment [1]:
On Tue, Feb 18, 2025 at 09:41:23AM -0500, Eli Schwartz wrote:
Show 9 quoted lines
> Overriding it via the cross file would be fine -- if your goal is to
> only ever find_program(..., native: false) in order to detect a path and
> embed it, then it doesn't matter whether cross files are for running
> cross tools on the build machine or for looking up cross tools to detect
> a path and embed it, since the two goals would never *come into
> conflict*. And that's what actually matters -- if you are concerned that
> cross files will be wrong as they specify the cross-compile environment
> not the install environment, then you shouldn't be using find_program()
> either, you should be exclusively using build options.
So this makes me assume that this usage is okay.

The reason why I prefer using a cross-file is that it makes it possible to specify the complete environment for a cross-compilation in a single file. This would include both the toolchain, but also target-specific options like the shell/Python/Perl path. In theory, this would make it possible to eventually start shipping machine files as part of the Git project that are completely sufficient to set up cross-compilation for e.g. Windows.

That being said, this is only my opinion and it's not set into stone. I just don't quite see the cross-file as abuse and think it has merit to do it that way. If there is another good argument why having a build option is preferable then I'm all ears and happy to revise my opinion.

Patrick
[1]: 24df8aa2-760f-4da3-88b0-ab97796373fd@gentoo.org
Previous: Peter Seiderer
Message 3 of 3 in “meson: distinguish build and target host binaries”
  1. meson: distinguish build and target host binariesPatrick Steinhardt, Mar 3, 2025
  2. Peter SeidererMar 3, 2025
  3. Patrick SteinhardtMar 4, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.