Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: meson toolchain #7662

Merged
merged 3 commits into from Nov 23, 2020
Merged

Feature: meson toolchain #7662

merged 3 commits into from Nov 23, 2020

Conversation

SSE4
Copy link
Contributor

@SSE4 SSE4 commented Sep 5, 2020

related: #7155 #7075

/cc @TheQwertiest @KristianJerpetjon @kristofferkoch

this is an early WIP - mostly to discuss the interface and implementation details.
unfortunately I cannot get even basic things of meson native file to work according to the documentation - meson appears to ignore project-specific options and built-in options specified in the native file.
meson issues: mesonbuild/meson#7697 mesonbuild/meson#7699
as things above didn't work for me, there are not many things tested yet.

open questions:

  • should we manage directories (such as libdir, bindir and so on)?
  • what to do with custom build types? (reject/specify custom/specify nothing)

Changelog: Feature: meson toolchain
Docs: conan-io/docs#1943

  • Refer to the issue that supports this Pull Request.
  • If the issue has missing info, explain the purpose/use case/pain/need that covers this Pull Request.
  • I've read the Contributing guide.
  • I've followed the PEP8 style guides for Python code.
  • I've opened another PR in the Conan docs repo to the develop branch, documenting this one.

Note: By default this PR will skip the slower tests and will use a limited set of python versions. Check here how to increase the testing level by writing some tags in the current PR body text.

Copy link
Member

@memsharded memsharded left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking very good, a great good first step to start improving Meson integration via toolchains.

conans/client/toolchain/meson.py Outdated Show resolved Hide resolved
conans/client/toolchain/meson.py Outdated Show resolved Hide resolved
conans/client/toolchain/meson.py Outdated Show resolved Hide resolved
@SSE4
Copy link
Contributor Author

SSE4 commented Sep 6, 2020

@memsharded thanks, the bad thing is probably it will be blocked until meson 0.56 release as most of things in native/cross files right now don't work according to the documentation - values specified in toolchain are simply ignored...

@memsharded
Copy link
Member

@memsharded thanks, the bad thing is probably it will be blocked until meson 0.56 release as most of things in native/cross files right now don't work according to the documentation - values specified in toolchain are simply ignored...

Uhm... I guess that we should wait, yes, and plan for the future of Meson, not the current state, because it is still not stable 0.X release. Is there an estimated date for 0.56? It would be great to know how fast the community is upgrading to newer Meson versions too.

@SSE4
Copy link
Contributor Author

SSE4 commented Sep 6, 2020

asked at mesonbuild/meson#7699 (comment) about ETA for 0.56

@SSE4
Copy link
Contributor Author

SSE4 commented Oct 21, 2020

update: meson 0.56rc1 is out, and I expect release in several days, so I am going back to refresh this PR

@SSE4
Copy link
Contributor Author

SSE4 commented Oct 28, 2020

updated, works locally with meson 0.56rc2. please review.

@SSE4
Copy link
Contributor Author

SSE4 commented Oct 28, 2020

@jgsogo @memsharded how can I ensure the right meson is installed on CI?

ERROR: Could not find a version that satisfies the requirement meson>=0.56.0rc2 (from -r conans/requirements_dev.txt (line 6)) (from versions: 0.29.0.dev1, 0.29.0.dev2, 0.29.0.dev3, 0.29.0, 0.30.0, 0.31.0, 0.32.0, 0.33.0, 0.34.0, 0.35.0, 0.35.1, 0.36.0, 0.37.0, 0.37.1, 0.38.0, 0.38.1, 0.39.0, 0.39.1, 0.40.0, 0.40.1, 0.41.0, 0.41.1, 0.41.2, 0.42.0, 0.42.1, 0.43.0, 0.44.0, 0.44.1, 0.45.0, 0.45.1, 0.46.0, 0.46.1, 0.47.0, 0.47.1, 0.47.2, 0.48.0, 0.48.1, 0.48.2, 0.49.0, 0.49.1, 0.49.2, 0.50.0, 0.50.1, 0.51.0, 0.51.1, 0.51.2, 0.52.0, 0.52.1, 0.53.0)

locally, seems to be working with requirements_dev.txt adding meson>=0.56.0rc2

@SSE4 SSE4 closed this Oct 28, 2020
@SSE4 SSE4 reopened this Oct 28, 2020
@SSE4 SSE4 closed this Oct 28, 2020
@SSE4 SSE4 reopened this Oct 28, 2020
@SSE4 SSE4 force-pushed the meson_toolchain branch 3 times, most recently from eb2d05d to 3a6df52 Compare October 30, 2020 18:14
@SSE4 SSE4 marked this pull request as ready for review November 19, 2020 10:13
Copy link
Member

@memsharded memsharded left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good job. Check the comments, and lets have this merged in Conan 1.32

conans/client/toolchain/base.py Outdated Show resolved Hide resolved
conans/test/functional/toolchain/test_meson.py Outdated Show resolved Hide resolved
@memsharded memsharded added this to the 1.32 milestone Nov 19, 2020
Signed-off-by: SSE4 <tomskside@gmail.com>

try:
from collections.abc import Iterable
except ImportError:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All this was not strictly necessary, as Meson only works with Py3, but not necessary to change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

meson yes, but conan works with 2.x and 3.x, and they may use different interpreters (e.g. conan might use pyinstaller's one)

Signed-off-by: SSE4 <tomskside@gmail.com>
Signed-off-by: SSE4 <tomskside@gmail.com>
@memsharded memsharded merged commit e4c37ab into conan-io:develop Nov 23, 2020
@memsharded
Copy link
Member

Merged!

Note that in #8096, it will be moved to the new from conan.tools.meson import MesonToolchain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants