question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Expose `Environment::get_build_command()` to meson.build

See original GitHub issue

Hi,

As part of the build generation I would like to generate tests / scripts that in invoke meson. One example is generating a script that runs DESTDIR=/sometemp meson install and then runs tests against that temporary installation. I can’t just use find_program('meson') because meson may not be on PATH or the meson on PATH isn’t the same as used in a build directory.

I obviously can just invoke ninja install in such scripts / tests, but that will not work in case a different backend is used. Hence the desire to expose get_build_command().

Would a patch adding that feature have a decent chance of getting accepted?

A second, less crucial, use-case for this is that I would like to generate a script that uses meson introspect + knowledge of the source-tree to compares - and optionally resyncs - the list of tests existing in the source tree and the tests that the corresponding meson.build knows about.

get_build_command() effectively already is exposed via MESONINTROSPECT (including inside run_command and add_postconf_script, which doesn’t seem to be documented). Exposing just the meson invocation as an array to meson.build seems a lot cleaner however than needing to do shell-splitting inside commands.

Regards,

Andres

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
anarazelcommented, Apr 2, 2021

Hi,

On Fri, Apr 2, 2021, at 08:43, behlec wrote:

To clarify what you are asking for: Do you want to have a MESONCOMMAND variable like MESONINTROSPECT in run_command or do you want a command in meson.build that returns an array with the meson command?

The latter. That way no shell string parsing has to be done.

Regards,

Andres

0reactions
anarazelcommented, May 27, 2022

@jpakkane ping? There’s a PR, implementing this - but it seems to be stuck waiting for design input?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tutorial - The Meson Build system
This page shows from the ground up how to create a Meson build definition for a simple project. Then we expand it to...
Read more >
Running Meson
We run the following commands to get the build started. cd /path/to/source/root meson setup builddir. We invoke Meson with the setup command, giving...
Read more >
An in-depth tutorial - The Meson Build system
In this tutorial we set up a project with multiple targets, unit tests and dependencies between targets. Our main product is a shared...
Read more >
Command-line commands - The Meson Build system
GI_TYPELIB_PATH includes every directory where a GObject Introspection typelib is built. This is automatically set when using gnome.generate_gir() .
Read more >
Quickstart Guide - The Meson Build system
Meson has been designed to be as simple to use as possible. This page outlines the initial steps needed for installation, troubleshooting, and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found