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

Re: Bug#859177: meson is unuseable for package cross compilation

On Sat, Jul 29, 2017 at 09:12:56AM +0200, Michael Biebl wrote:
> Am 28.07.2017 um 22:06 schrieb Helmut Grohne:
> >  2. The debcrossgen.py script needs some place to live. When debhelper
> >     and meson are installed together, it needs to be in the filesystem.
> >     An easy approach to do so is to put it into the meson binary
> >     package. We should probably spend a little discussing bike shedding
> >     questions such as:
> >      a. What path/filename to use?
> >      b. What options/arguments should it take?
> >  3. debhelper needs to call debcrossgen.py during cross compilation and
> >     add the --cross-file option. This one is straight forward to
> >     implement once the questions from 2. are answered.
> My gut feeling is, that this functionality should be shipped in
> debhelper directly, specifically in the meson build system class [1].
> debhelper is written in perl, and I don't think we want to add a
> dependency on Python. But the  debcrossgen.py code looks straightforward
> enough to be ported to perl.

If it ends up being shipped in debhelper, I have a few questions. What
should I do if the cross file mostly is correct, but I need to tweak one
line (i.e. how to override it)? What should I do if I want to cross
build for a Debian-based system, but don't want to build a Debian
package, just a binary? (Do I have to write the cross file manually?)

> That said, if Jussi thinks that this script might be useful for other
> distros / use cases, then shipping it upstream in the meson package
> might be an option as well.

Indeed, the tool could be extended to be useful for other distros. There
is a de facto standard for describing architectures used across a number
of distributions and that is the GNU triplet (i.e. DEB_HOST_GNU_TYPE).
If the tool were deriving all of the values from the GNU triplet rather
than checking all dpkg-architecture variables, it could become useful
for others. At the same time, it would essentially duplicate autotools'
config.guess. Choose either simple or generic, but not both.

On Sat, Jul 29, 2017 at 09:19:22AM +0200, Michael Biebl wrote:
> While generating a (temporary) cross.txt file is not a huge deal, being
> able to directly pass the necessary options to meson via command line
> options would be a tad nicer.

That's what we do for CMake indeed, but it is not without problems
there. Some build systems behave differently when a CMAKE_TOOLCHAIN_FILE
is given and assume a non-cross build when there is none. That pitfall
should be avoided.


Reply to: