149 Commits

Author SHA1 Message Date
Daniel Foster
1a69438552 mtest: add -k as alias to --maxfail
An equivalent option is available on ninja as -k, so let's alias that.
2026-04-20 09:33:47 +01:00
Paolo Bonzini
6e67be7492 mdist: add -j/--num-processes
Add the ability to adjust the number of worker processes in meson dist's
ninja invocation.

Fixes: #15489
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-03-08 14:30:03 +01:00
Paolo Bonzini
dca71a2239 shell-completions: zsh: fix spec for meson test
Follow the same model as for other options with an argument.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-03-08 14:30:03 +01:00
Paolo Bonzini
26d5e2e244 shell-completions: bash: add missing -j/--num-processes for meson wrap update
The option is present in the case statement but not in the
completions arrays.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-03-08 14:30:03 +01:00
Bernhard M. Wiedemann
65ce2dcbfe macros: use smp_mflags
to avoid embedding the number of CPU cores
in the .src.rpm header's expanded SPEC field.

See also https://github.com/rpm-software-management/rpm/issues/2343

This patch was done while working on reproducible builds for openSUSE.
2026-03-04 19:44:58 +01:00
na-trium-144
aee88e2363 Enable test case common/230 on msys2
Implemented 'windows' and '!windows' as platform value in test
configuration for this.
In MSVC environment this test is ignored anyway since make command is
not available.
2026-03-04 14:48:50 +01:00
ChaseKnowlden
06672a30f6 Remove echomsg from vim indent file 2026-02-20 10:34:22 -05:00
Dominique Leuenberger
12b1e3c6a7 macros: fix feature to disable verbosity
Instead of relying on __meson_verbose being defined or not, handle
its value; in context of larger build systems (like open build service)
this allows a project wide configuration to override %__meson_verbose to 0
2025-11-19 10:48:01 -08:00
Eli Schwartz
5c0aad57f9 revert local_program()
This reverts https://github.com/mesonbuild/meson/pull/15107

Explicit objections regarding the design were raised and not answered,
so it shouldn't have been merged. It needs to be discussed and
revisited.
2025-10-15 23:01:36 -04:00
Xavier Claessens
1826cba8d8 Add local_program() function 2025-10-15 12:15:39 -04:00
Tobias Stoeckmann
e771882a3c Use https for mesonbuild.com
Since http://mesonbuild.com redirects to https://mesonbuild.com anyway,
use https directly in documentation.
2025-09-03 22:44:54 +03:00
meator
c45f80ac25 zsh: Fix 'meson init --language' completion
This commit fixes invalid syntax, which leads to

(eval):1: number expected
_arguments:465: command not found: _

when trying to complete 'meson init --language=<TAB>'.
2025-01-19 18:25:14 +02:00
meator
386fee2305 zsh: Add missing flags to 'meson install'
Also start flag description with a lowercase letter.
2025-01-19 18:24:51 +02:00
fundawang
7a8a89aab2 Add macros for declarative buildsystems of rpm >= 4.20 2025-01-08 12:17:03 +02:00
Andreas Karlsson
2d40813d42 Add -q as alternative to --quiet for meson install
Since "meson test" already has both -q and --quiet it makes a lot of
sense to add the short option to "meson install" too for reasons of
symmetry.
2024-11-02 19:55:09 -04:00
spaette
4179996fef Fix typos 2024-09-11 15:51:04 -07:00
Joey Pabalinas
9459bd8bd4 zsh: Fix incorrect __meson_wrap_modes expansion
Signed-off-by: Joey Pabalinas <joeypabalinas@gmail.com>
2024-07-21 17:38:28 -04:00
Joey Pabalinas
8554699c42 zsh: Add completions for {rewrite,devenv,env2mfile,format,help} subcommands
Signed-off-by: Joey Pabalinas <joeypabalinas@gmail.com>
2024-07-21 17:38:28 -04:00
Joey Pabalinas
7f5262b483 zsh: Fix spelling errors
Signed-off-by: Joey Pabalinas <joeypabalinas@gmail.com>
2024-07-21 17:38:28 -04:00
Joey Pabalinas
9a6adc1e36 zsh: Add new vs backends
Signed-off-by: Joey Pabalinas <joeypabalinas@gmail.com>
2024-07-21 17:38:28 -04:00
Jussi Pakkanen
47fd13aefc tests: Clean up leftover files from source dirs. 2024-07-10 21:32:35 +03:00
Daan De Meyer
a3d3efd3cf Add meson test --max-lines
Let's allow users to configure how many lines are shown at most when
a test fails.
2024-06-17 19:30:10 +03:00
Daan De Meyer
344a97e08a Add meson test --interactive
This is very similar to --gdb, except it doesn't spawn GDB, but
connects stdin/stdout/stderr directly to the test itself. This allows
interacting with integration tests that spawn a shell in a container
or virtual machine when the test fails.

In systemd we're migrating our integration tests to run using the
meson test runner. We want to allow interactive debugging of failed
tests directly in the virtual machine or container that is spawned
to run the test. To make this possible, we need meson test to connect
stdin/stdout/stderr of the test directly to the user's terminal, just
like is done with the --gdb option.
2024-04-23 21:36:22 +02:00
Tristan Partin
2d3954efac Add bztar support to meson dist
Some projects, like Postgres, distribute code in this format.
2024-04-15 16:17:44 -04:00
Christoph Reiter
0762b86e59 tests: rename skip_on_jobname to expect_skip_on_jobname and skip_on_os to expect_skip_on_os
The test.json format currently has three keys related to skipping tests:

* `skip_on_jobname`
* `skip_on_os`
* `skip_on_env`

While `skip_on_env` marks the test itself as skipped, i.e. they don't get run when the
conditions are met, the other two skip options are just marking the test as "expected to be skipped"
if the conditions apply, i.e. they want to see `MESON_SKIP_TEST` in the output and things will
fail if that doesn't happen. They don't actually skip the tests as the names imply.

To make this clearer rename the keys:

* `skip_on_jobname` -> `expect_skip_on_jobname`
* `skip_on_os` -> `expect_skip_on_os`

`skip_on_env` stays the same, since that actually skips.

The docs were also confused about this, so adjust that too.
2024-03-17 04:46:26 -04:00
Daan De Meyer
163d703a18 macros: Allow disabling verbose mode
This allows using "--undefine __meson_verbose" to disable the verbose
mode. This is useful when running rpmbuild in an interactive terminal
and you don't want to be flooded with compilation outputs.

We also add --quiet to the meson install macro if __meson_verbose is
undefined to reduce the output generated by meson install.

The default output stays the same, the output is only affected if
__meson_verbose is explicitly undefined.
2024-02-16 07:43:16 -05:00
Tristan Partin
4ea51e1b25 Continue fleshing out bash completion script
This adds bash completion to everything that I could think of except for
the rewriter.
2024-02-09 22:26:46 +05:30
Luke Elliott
99fadccd29 completions: bash: add a bunch of missing completion options 2023-11-01 00:06:19 +02:00
Arsen Arsenović
56ef698426 run_project_tests: support checking for symlinks 2023-09-13 21:44:40 -04:00
Liam Beguin
983562c66e syntax-highlighting: vim: update builtin function list
Update builtin function list using the refman

	python docs/genrefman.py \
		-g vim \
		-o data/syntax-highlighting/vim/syntax/

This also drops gettext() and find_library() from the list of builtin
functions that have been deprecated since 2016.

Changes are squashed here because test_vim_syntax_highlighting() would
validate the file against the list of builtin functions that no longer
matches the yaml documentation.

Signed-off-by: Liam Beguin <liambeguin@gmail.com>
2023-09-07 19:14:03 -04:00
Xavier Claessens
b2654b2d43 Fix crash when installing a vala library and python sources
Installing python sources causes the python module to call
create_install_data() before Ninja backends adds extra outputs to Vala
targets.

Target objects are supposed to be immutable, adding outputs that late is
totally wrong. Add extra vala outputs immediately, but be careful
because the main output is only added later in post_init(). Luckily
the base class already puts a placeholder item in self.outputs for the
main filename so we can just replace self.outputs[0] instead of
replacing the whole list which would contain vala outputs at that stage.
This is surprisingly what SharedLibrary was already doing.
2023-09-07 10:56:37 -04:00
Luke Elliott
2c22311737 completions: bash: don't show json errors when completing "meson test".
E.g. "meson test<tab>"

json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
2023-09-06 16:06:00 +01:00
Luke Elliott
df24e36a62 completions: bash: added "compile" (and "help") completion. 2023-09-06 16:06:00 +01:00
Luke Elliott
7e3f419c7a completions: bash: fix -x<tab>.
If x was a known short option, would complete to "-". If unknown, "--".
2023-09-06 16:06:00 +01:00
Luke Elliott
6a62d49122 completions: bash: added a bunch of missing completion options. 2023-09-06 16:06:00 +01:00
Andrew McNulty
c730807696 Python: Add 'limited_api' kwarg to extension_module
This commit adds a new keyword arg to extension_module() that enables
a user to target the Python Limited API, declaring the version of the
limited API that they wish to target.

Two new unittests have been added to test this functionality.
2023-08-14 20:02:09 -04:00
Josh Soref
0551a8847d zsh: fix help / descriptions
* --load-average
* --gdb-path
* description for install

Found by https://www.check-spelling.dev/

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-11 19:21:05 -04:00
Josh Soref
01016fc554 syntax-highlighting: vim: fix mesonSpaceError
Fixes regression from 388fa6e776

Found by https://www.check-spelling.dev/

Signed-off-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
2023-04-11 19:21:05 -04:00
Dylan Baker
4a014d1724 Add support for meson.options as a replacement for meson_options.txt
We will still try to load `meson_options.txt` if `meson.options` doesn't
exist. Because there are some advantages to using `meson.options` even
with older versions of meson (such as better text editor handling)
we will not warn about the existence of a `meson.options` file if a
`meson_options.txt` file or symlink also exists.

The name `meson.options` was picked instead of alternative proposals,
such as `meson_options.build` for a couple of reasons:

  1. meson.options is shorter
  2. While the syntax is the same, only the `option()` function may be
     called in meson.options, while, it may not be called in meson.build
  3. While the two files share a syntax and elementary types (strings,
     arrays, etc), they have different purposes: `meson.build` declares
     build targets, `meson.options` declares options. This is similar to
     the difference between C's `.c` and `.h` extensions.

As an implementation detail `Interpreter.option_file` has been removed,
as it is used exactly once, in the `project()` call to read the options,
and we can just calculate it there and not store it.

Fixes: #11176
2023-03-28 15:01:10 +03:00
Jani Välimaa
99dfc988eb Use meson setup [options] in meson RPM macro
Fixes the following warning when building a rpm pkg using %meson macro:
WARNING: Running the setup command as `meson [options]` instead of `meson setup [options]` is ambiguous and deprecated.
2022-12-05 08:09:12 -05:00
Liam Beguin
020e16a2b5 completions: bash: add simple init competion
Populate the _meson-init() completion function.

Signed-off-by: Liam Beguin <liambeguin@gmail.com>
2022-09-18 15:22:48 -04:00
Liam Beguin
3f86f19f95 completions: bash: define sub-commands as an array
Define subcommands as an array so that they can be reused for the
top-level sub-command completion.

Signed-off-by: Liam Beguin <liambeguin@gmail.com>
2022-09-18 15:22:48 -04:00
Liam Beguin
24e97e1945 completions: bash: update meson sub-command list
Add all meson sub-commands to the autocompletion script.

Signed-off-by: Liam Beguin <liambeguin@gmail.com>
2022-09-18 15:22:48 -04:00
Liam Beguin
f08c788f61 completions: bash: add missing functions
Add empty functions for all commands defined in the autocompletion script.
When these functions are not defined, bash raises the following error:

       $ meson init <TAB>-bash: _meson-init: command not found

Signed-off-by: Liam Beguin <liambeguin@gmail.com>
2022-09-18 15:22:48 -04:00
Liam Beguin
ebe14848e0 completions: bash: order function definitions like in help
Move _meson-introspect() to follow the command list defined at the top
of the script which follows the help message order.

Signed-off-by: Liam Beguin <liambeguin@gmail.com>
2022-09-18 15:22:48 -04:00
Paolo Bonzini
3a960023d3 interpreter: new function add_project_dependencies()
This function can be used to add fundamental dependencies such as glib
to all build products in one fell swoop.  This can be useful whenever,
due to a project's coding conventions, it is not really possible to
compile any source file without including the dependency.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-05-03 02:00:29 -04:00
Marvin Scholz
2cdddbab56 Add new debug() function
Adds a new debug() function that can be used in the meson.build to
log messages to the meson-log.txt that will not be printed to stdout
when configuring the project.
2022-03-30 06:57:30 -04:00
Dylan Baker
cbc62e892a interpreter: add an implementation for structured_sources 2022-03-07 12:33:33 -08:00
andy5995
b1e6cc5553 implement 'dist --allow-dirty' flag
closes #9824
2022-02-10 21:23:20 -05:00
Marc-André Lureau
db680a78d1 Drop emacs meson-mode
The one on MELPA is way more advanced: https://melpa.org/#/meson-mode
https://github.com/wentasah/meson-mode

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2022-02-04 20:59:10 +02:00