conan-io / conan

Conan - The open-source C and C++ package manager
https://conan.io
MIT License
8.31k stars 986 forks source link

[question] cross compile meson packages from CCI #10285

Open andiwand opened 2 years ago

andiwand commented 2 years ago

I tried to cross compile fribidi and glib from CCI and noticed that it does not work out of the box.

After searching I found this closed ticket https://github.com/conan-io/conan/issues/4529 which introduced MesonToolchain and a new Meson class documented here https://docs.conan.io/en/latest/reference/conanfile/tools/meson.html.

Now I wondered what is best practice to enable cross compile for meson packages on CCI. I could refactor the existing recipes to use the new MesonToolchain and Meson class but those are experimental and the interface of Meson seems to be incompatible. (new vs old)

SpaceIm commented 2 years ago

They were several attempt in CCI to support cross-build in Meson based recipes, but without luck as you can see in https://github.com/conan-io/conan-center-index/pull/6678 and https://github.com/conan-io/conan-center-index/pull/7360. I think there is no straightforward solution currently without automagic handling of https://mesonbuild.com/Cross-compilation.html in Meson helpers.

/cc @SSE4

SSE4 commented 2 years ago

there is some ongoing effort in #10174 and #9710

jwillikers commented 2 years ago

A couple of related issue reports in Conan Center: conan-io/conan-center-index#11332 and conan-io/conan-center-index#11362

andiwand commented 2 years ago

thank you @jwillikers ! but for now we have to go with custom recipes right? no CCI meson cross builds there as far as I can tell

jwillikers commented 2 years ago

@andiwand At the moment, I'm not aware of any that use the new MesonToolchain generator in CCI. I'm not sure when that will be possible, but perhaps before too long it will be allowed as things transition to supporting Conan V2.

For the Wayland package specifically, I have a fork available here that uses the new MesonToolchain generator and can be used to cross-compile the package. It requires Conan version 1.50.0 at this time.

SSE4 commented 2 years ago

I have an ongoing effort to convert GLib recipe to use MesonToolchain: https://github.com/conan-io/conan-center-index/pull/11053 still, there are several flaws in conan cliient itself, and recipe needs several workarounds. I've opened some issues, hopefully in 1.51 it will be much better: https://github.com/conan-io/conan/issues/9713 https://github.com/conan-io/conan/issues/11398 https://github.com/conan-io/conan/issues/10683 https://github.com/conan-io/conan/issues/11397

andiwand commented 2 years ago

thank you @jwillikers and @SSE4 ! I will use your resources and try to create a recipe that works for me until conan catches up on this