The reference manual states that the optional value argument to
dep.as_system() defaults to 'preserve'. In practice, omitting the
argument makes the dependency use the 'system' include type.
Update the documentation to describe the actual default behavior.
Fixes#13294
GitHub queries often returns a 429 Too Many Requests status code
to the runners. Ignore the error, as it makes CI flaky and a
Too Many Requests result (unlike a 404) is a sign that the
URL itself is ok.
While at it, improve slightly the formatting to avoid this:
>>> ASAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1 MESON_TEST_ITERATION=1 UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 MSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 MALLOC_PERTURB_=51 /usr/bin/python3 /home/runner/work/meson/meson/docs/./validatelinks.py /home/runner/work/meson/meson/docs/markdown/Users.md
――――――――――――――――――――――――――――――――――――― ✀ ―――――――――――――――――――――――――――――――――――――
"`meson` GitHub
topic" https://github.com/topics/meson 429
――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
clean up
fix tests for windows paths mimicing what was done in other unit tests (e.g., test case 74)
Update mesonbuild/interpreter/interpreterobjects.py
Co-authored-by: Charles Brunet <charles.brunet@optelgroup.com>
Update docs/markdown/snippets/include_directories_to_list.md
Co-authored-by: Charles Brunet <charles.brunet@optelgroup.com>
Update mesonbuild/interpreter/interpreterobjects.py
Co-authored-by: Charles Brunet <charles.brunet@optelgroup.com>
Update docs/yaml/objects/inc.yaml
Co-authored-by: Charles Brunet <charles.brunet@optelgroup.com>
Fix comment language
Previously, find_program only used the subproject fallback if it didn't
find the tool the normal way or global forcefallback was activated. Now
it should also fall back if the subproject that provides the fallback is
part of force-fallback-for.
Change the dependency resolution code to take a MachineChoice as an
argument. Create build- and/or host-side configurations
through the machines_from() method in Manifest.
The current situation in Meson is that subprojects are always built for
the host machine. This means that while cross compiling, a tool that
must be run on the build machine must have all of its dependencies met
by the system (pkg-config, cmake, config-tool, etc); but dependencies
for the host machine can be built. With this patch subprojects may also
be built for the build machine.
Nothing should ever be installed from a subproject for the build
machine, while cross compiling. However, if we are not cross compiling
they are installed, since Meson can't really tell the difference between
a host and build dependency in that case.
Extracted from a patch by Dylan Baker <dylan@pnwbakers.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Corresponding to the TypedDict change from the previous patch,
extend the choice of GeneratedTypes to the DSL and not just the
internal dictionaries.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Previously, `meson wrap install` took only one argument, so installing
multiple projects needed multiple invocations, which is not too convenient.
So add support for installing multiple projects.
Add a clippy-json target to the ninja script.
This is useful for rust-analyzer, which requires an "external check
command" to function when not using cargo.
Also we add a "clippy-json-prereq" target, and invoke it in the
clippy.py script. The prereq target tries to build as much of the
project as possible with "-k0".
Currently, `meson format --recursive` only recurse meson.build files
that are reachable via a `subdir` function. Add `--subprojects` flag to
also recurse subprojects.
I have two signing keys. One is an older rsa4096 one, the newer ed25519
key I created when joining the Gentoo Developers team. Both keys are
still valid, and the newer key is signed by the older key.
When tagging release 1.11.1, I mistakenly uploaded assets signed by the
newer key, which should not actually be a big deal but was confusing
since it was not on this page. Update the docs so that people know this
key is acceptable.
Proofs for the new key:
- cross-sig from the old to new key
- recorded by https://github.com/eli-schwartz.gpg as a known key for me
- recorded by https://codeberg.org/eschwartz.gpg as a known key for me
- this git commit adding the new key to the docs page is signed by the
old key
- my online identity as a Gentoo Developer is associated with this key
as observable via:
https://wiki.gentoo.org/wiki/User:Eschwartzhttps://www.gentoo.org/inside-gentoo/developers/#eschwartz
Fixes: https://github.com/mesonbuild/meson/issues/15901
Add support for parsing and formatting integers in hexadecimal, octal,
and binary representations to complement the existing decimal support.
str.to_int() now accepts strings with 0x/0o/0b prefixes and optional
leading signs (+/-), enabling direct parsing of hex, octal, and binary
literals while maintaining full backward compatibility with decimal
strings including those with leading zeros.
int.to_string() gains a new format keyword argument that accepts 'dec',
'hex', 'oct', or 'bin', allowing integers to be formatted with
appropriate prefixes (0x, 0o, 0b). The format parameter works correctly
with the existing fill parameter and handles negative numbers properly.
Round-trip conversions are fully supported: values formatted with
int.to_string(format: 'hex') can be parsed back with str.to_int().
Fixes: #2047Fixes: #15201
Cargo.toml workspace members are glob expressions, which we'd rather
not rely on. Treat them always as non-default members, so that they
have to be listed explicitly in extra_members but are nevertheless
available.
Co-authored-by: Florian sp1rit <sp1rit@disroot.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Cargo allows building non-default workspace members via the -p
option. Within Meson, we still want to do a single configuration
process for the workspace, but we need to add any non-default
members (typically chosen via machine objects and/or Meson options)
at the time workspace() is invoked. Add a new argument to
workspace() for this.
Co-authored-by: Florian sp1rit <sp1rit@disroot.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Instead of raising an exception for accessing a field of a NoneType,
report a Meson error and omit the entry from packages().
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
The type check fix in _BASE_LANG_KW is all that's needed since
__convert_file_args already handles File objects correctly (converts
to path string + adds to depend_files for rebuild tracking). In fact,
the vala_args case 569 already had (str, File). This just brings
the other languages in line.
Fixes: #1633
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Previous version of Meson were returning an Executable instead of
the LocalProgram.
While at it, add CustomTargetIndex to the type as well - it is
included in the KwargInfo but not in the TypedDict.
Fixes: #15774
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Previous version of Meson were returning an Executable instead of
the LocalProgram, so allow it again; use a convertor so that
the LocalProgram is resolved to the underlying file or target.
Add support for ExternalProgram while at it.
Fixes: #15774
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Support `--exclude name` where `name` is a full test name, optionally
including the subproject name. Wildcards are not currently supported.
Accept both `name` for the main project and `subproject:name`. We want `name`
for convenience so users don't have to write out their project name when
no subprojects are involved.
Extended matching could be added in future, but the primary usecase for
this is where distributions want to skip known-buggy or irrelevant tests,
rather than developers working on their own project.
The test changes are a bit noisy because needed to add a test with
the same name in the main project and a subproject to check that --exclude
w/ an unqualified name only affected the main parent, but adding 2 new failing
tests required all the numbers to be adjusted.
Closes: https://github.com/mesonbuild/meson/pull/11502
Closes: https://github.com/mesonbuild/meson/issues/6999
Signed-off-by: Sam James <sam@gentoo.org>
This reverts commit 74faddbb44.
It is vibe-coded and also seems to have gotten merged without discussion
of what the point of this is supposed to be. There's no motivating use
case to point at, which normally should be a given? It's a lot of code
in order to support cp'ing an executable()? Is this a sign that humans
weren't involved in choosing to try implementing this?
Allow CustomTarget, CustomTargetIndex, and BuildTarget as the first
argument to fs.copyfile(), so that build artifacts can be copied
without resorting to a manual custom_target.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
The function is using source_strings_to_files, and that makes
it trivial to pass generated sources to the CustomTarget
constructor.
Fixes: #2748
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>