17561 Commits

Author SHA1 Message Date
vanadiae
e0e728d556 msetup: Create CACHEDIR.TAG file in build dir
Fixes #11734
2026-06-23 16:32:33 -04:00
Jesper Wramberg
bcd5dd4577 docs: correct dep.as_system() default value
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
2026-06-23 14:24:23 +02:00
Paolo Bonzini
1b4a6498fd docs: fix incorrect return type
The reference manual expects "array[...]", fix the incorrect
type added by PR #14488.

Fixes: #15941
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-06-23 05:26:53 -04:00
Paolo Bonzini
82c25986d7 docs: accept 429 status for github search and topic pages
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>
2026-06-23 05:26:53 -04:00
Michał Górny
ea5af50bd1 ci: Disable git repository ownership checks
Disable the new feature that ensures that the git repository is owned
by the same user that runs the command.  This apparently is not true
when running the test suite and breaks at least the Gentoo CI job.

Signed-off-by: Michał Górny <mgorny@quansight.com>
2026-06-22 08:47:32 -07:00
L. E. Segovia
a7adffa210 windows: Implement RC depfile generation for clang targeting MSVC 2026-06-20 10:01:16 +02:00
Gabe Black
a5562ce95a Add to_list() method to include_directories objects
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
2026-06-19 17:26:06 +02:00
benjamin-otte
4146c44723 Improve error messages for wrap-redirect file
While discussing error messages on IRC with xclaesse, we found 448b11cb7f which improves one of the error messages, but leaves out the others. This commit updates them, too.
2026-06-19 17:07:31 +02:00
Loïc Estève
dba79292df Make cython generated targets less nested 2026-06-19 15:43:23 +02:00
Florian "sp1rit"​
5461ecf31e find_program: Respect --force-fallback-for
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.
2026-06-19 14:39:52 +02:00
L. E. Segovia
739e86f3e4 nasm: use the correct flag for response file support, try 2
This commit reenables and implements correct response file support for
Nasm.

Fortified with the knowledge of #15867 and #15872, and with a quick chat
with @nirbheek, I realised that the easiest way to fix this (since Ninja
does not support custom argument spacing) is to do it the obvious way,
with Meson's custom command support.

This commit implements an abridged version of that: when a non-standard
RspFileSyntax value is detected, the active NinjaBuildRule is temporarily
resolved to the corresponding NinjaRule on the fly and if the latter says
that a response file will be used, the NinjaBuildRule is immediately
converted into a CUSTOM_COMMAND, completing the arguments with
the bits for infile and outfile and triggering the executable
serialization. That serializes the response file and pickles the command.

Fixes building mpv with MSVC 2022+ and fdk-aac enabled.
2026-06-19 14:11:50 +02:00
Paolo Bonzini
d23570a90b ninjabackend: extract NinjaBuild object
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-06-19 14:11:50 +02:00
Paolo Bonzini
e4c7e61ab9 ninjabackend: add should_use_rspfile() method to NinjaRule
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-06-19 14:11:50 +02:00
Dylan Baker
8cd27e2ed4 programs: Fix strict-null issues
ExternalProgram has as weird way of setting self.command to `list[str |
None]`, but it should only be `list[None]` if `self.command = [None]`.
Instead, just set self.command to `list[str]`, and use an empty list as
the sentinel value.

This also fixes a few issues where we use Any or reduce to Any.
2026-06-18 17:37:02 +02:00
Dylan Baker
e52dafea4e minstall: Turn on mypy strict optional 2026-06-18 17:37:02 +02:00
Dylan Baker
de69a6ebe8 backend/backends: Make TargetInstallData.install_mode non-optional 2026-06-18 17:37:02 +02:00
Dylan Baker
feee3a3546 minit: Turn on mypy strict optional 2026-06-18 17:37:02 +02:00
Dylan Baker
7b6de79f06 mesonmain: Turn on mypy strict optional 2026-06-18 17:37:02 +02:00
Dylan Baker
0c106b2b8a mesondata: Turn on mypy strict optional 2026-06-18 17:37:02 +02:00
Dylan Baker
6f956acb5f mdist: Turn on mypy strict optional 2026-06-18 17:37:02 +02:00
Dylan Baker
b4588460dd mdevenv: Turn on mypy strict optional 2026-06-18 17:37:02 +02:00
Dylan Baker
4e272176e6 mconf: Turn on mypy strict optional 2026-06-18 17:37:02 +02:00
Dylan Baker
a4492c2710 mcompile: Turn on mypy strict optional 2026-06-18 17:37:02 +02:00
Dylan Baker
e3b1eca625 environment: Turn on mypy strict optional 2026-06-18 17:37:02 +02:00
Dylan Baker
91fd982c7f envconfig: Turn on mypy strict optional
We might want to go the otherway on the MachineInfo, not allowing the
cpu_fmaily and cpu to be None. Unsure yet
2026-06-18 17:37:02 +02:00
Dylan Baker
da834ea82a cmdline: Turn on mypy strict optional 2026-06-18 17:37:02 +02:00
Dylan Baker
7cd66d39f4 coredata: Turn on mypy strict optional 2026-06-18 17:37:02 +02:00
Dylan Baker
73bb614328 mlog: Turn on mypy strict optional 2026-06-18 17:37:02 +02:00
Dylan Baker
4098ece0db machinefile: Turn on mypy strict optional 2026-06-18 17:37:02 +02:00
Dylan Baker
cc21ae35df depfile: Turn on mypy strict optional 2026-06-18 17:37:02 +02:00
Dylan Baker
9e31ba0cb2 tooldetect: use strict optional
This makes use of mypy.ini to enable stricter checking.
2026-06-18 17:37:02 +02:00
Dylan Baker
7498aa1553 make use of the unwrap function 2026-06-18 17:37:02 +02:00
Dylan Baker
d075ba33ca utils/universal: Add unwrap functions for removing None values from unions 2026-06-18 17:37:02 +02:00
Dylan Baker
55321d5cd7 compilers/compilers: Use wallrus operator for exe_wrapper
less code, tighter typing
2026-06-18 17:37:02 +02:00
Dylan Baker
777981033f interpreter: Use the late_property for Interpreter.backend 2026-06-18 17:37:02 +02:00
Dylan Baker
ba834349b0 utils/universal: Add a late_property
This is a decorator that allows declaring a property as initialized
late. This allows for more ergonomic typing than using a union of `T |
None` for late initialized variables.
2026-06-18 17:37:02 +02:00
Dylan Baker
f22f674855 utils/universal: Use ParamSpec for decorators
Sot that they have correct typing.
2026-06-18 17:37:02 +02:00
Dylan Baker
43b301f3ee utils/universal: Fix typing of PerThreeMachine.miss_defaulting
It doesn't return a `_T | None`, the type Defaultable type already has
`_T | None` baked in, so it just needs a
`PerThreeMachineDefaultable[_T]`
2026-06-18 17:37:02 +02:00
Dylan Baker
28f3dbbbac interpreter: Project(version) cannot be None
We have a default value of `'undefined'`, so it can't actually be None.
Remove the annotations that would let None pass.
2026-06-18 17:37:02 +02:00
Dylan Baker
4ed8dedd57 cmake/interpreter: ConverterCustomTarget.get_ref cannot return None
In every case where None is returned we'd either hit an assertion
failure, or an uncaught exception. So instead, raise if we don't find an
output.
2026-06-18 17:37:02 +02:00
Dylan Baker
f302ad477d backends/ninja: refactor RustrCrate to remove is_proc_macro
It's always derived from the value of proc_macro_dylib_path anyway, so
move that into the function itself. This also resolves some strict null
issues.
2026-06-18 17:37:02 +02:00
Dylan Baker
9151be0088 backend: Don't return none from backend getters
Instead raise an exception. There is never a case where we don't error
if we get a None, so stop returning it.
2026-06-18 17:37:02 +02:00
Dylan Baker
6f52381199 utils: make get_meson_command return a list[str] or error
We have one, and only one case where we use the fact it can return None,
and otherwise assert (or should assert) that the value is not None.
Instead, raise if the command is None, and in the one case catch the
exception.
2026-06-18 17:37:02 +02:00
Dylan Baker
f3877152b4 compilers/rust: Use get_linker_id() instead of .linker.id
Which never returns None.

The result will be the same either way, but this fixes strict null
issues.
2026-06-18 17:37:02 +02:00
Dylan Baker
46c4034df3 compilers: Add a method to get a static linker or error
Sometimes we just need a static_linker, and not having one is an error.
This removes a use of `assert` to help mypy, and makes the code clearer.
2026-06-18 17:37:02 +02:00
Dylan Baker
b6f1863c09 internaltests: Fix test_program_version type (and use subtests)
This was passing a `list[list[str] | str]` to
`ExternalProgram(command)`, which is invalid.
2026-06-18 17:37:02 +02:00
Paolo Bonzini
142f44a3c4 cargo: vary crate names per machine
When a crate name is compiled for both the build and the host machine,
give it two different names to avoid conflicts.  This is not needed
for subprojects, but it is still necessary for packages that are part
of the toplevel workspace.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-06-18 10:47:44 +02:00
Paolo Bonzini
891f276550 cargo: assert that proc-macro crates are built once
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2026-06-18 10:47:44 +02:00
Paolo Bonzini
e6bb057839 cargo: implement machine-specific dependency tracking
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.
2026-06-18 10:47:44 +02:00
Paolo Bonzini
65ffb1d07b cargo: store machine-specific configuration
Make the PackageConfiguration a PerMachine object.  This makes it
possible to do dependency resolution separately for build- and/or host-side
libraries.

For now, all users only fill in or consume the host side, but that will change.
2026-06-18 10:47:44 +02:00