Age | Commit message (Collapse) | Author | Files | Lines |
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Make the dataclasses closer to the TypedDicts.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
|
This is required by meson-python to fix RPATH entries when building a wheel.
|
|
Currently the unittests are not runnable with pytest or unittest
without going through the run_unittests.py wrapper, or setting
certain env vars like MESON_UNIT_TEST_BACKEND.
This has that downside that the common "pytest ..." fails and integration
with things like VSCode fails too.
To work around that we set everything that is needed to run the tests
in __init__.py and run_unittests is only one more variant to invoke them
by providing different defaults and settings.
To make sure that pytest/unittest discover and run_unittests don't diverge
implement an automatic test discovery in run_unittests to avoid hardcoding
the tests to run there. There shouldn't be any functional changes.
|
|
Ensure that valobj.yielding is cleared for options in the toplevel project.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
This makes it possible to adjust the value of the option with a
subproject-specific augment. This was an undocumented change in 1.8
which was (voluntarily) undone in commit eae4efa72 ("options: resolve
yielding options at the time they are added", 2025-07-13), but is
useful. This reimplementation of yielding options makes it possible
to presreve the bugfix while restoring this new feature.
Reported-by: Nirbheek Chauhan <nirbheek@centricular.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Optional[str]]
As a side effect, this deduplicates -D and -U arguments passed
to meson configure, taking into account the relative ordering
of -D and -U options.
Fixes: #14754
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Check that build options fall back to host options, and that they
can be retrieved with get_option.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
This commit completes 5de09cbe8838e8febf1ca3aa83b53cf06972bff3,
ensuring that only POSIX style paths are passed to the compiler
line, and thus fixing UNIX-style tools that treat single
backward slashes as Unicode escaped characters.
Fixes #12191
Completes #12534
Completes #12564
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Go through the whole initialization and set_option process, and check that the
option value is unaffected by the creation of a subproject.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Restore behavior of 1.7.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Remove all the special casing and late validation now that early augments
are stored in pending_subproject_options until the subproject is found.
As a result, this makes the buildtype special case operate on subprojects
as well. It also simplifies set_from_configure_command(), which does not
have to treat various kinds of options in different ways.
Fixes: #14729
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Remove knowledge of the internal pending_options from msetup;
operate on the command line and check against the option store.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
As shown in the test, "-Dtests=true" should not override the
subproject() call because tests is a project options and those
do not share a namespace.
Fixes: #14728
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Previously, meson would only check if glib was part of
target.external_dependencies and add --target-glib appropriately. This
however had the downside of meson not adding --target-glib if glib was
included as a subproject, potentially breaking otherwise builds.
Instead of checking external_dependencies, check target.added_deps for
an occurrence of 'glib-2.0' and then pick the appropriate codepath
(either from the external dependency based on version_reqs or for the
internal dependency based on the actual version, potentially downgraded
to the latest release version)
Related-to: #14694
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
The test covers overriding an option from the dependency() function.
If the same option is passed on the command line, it overrides the
dependency()'s default_options as well.
Tweak the description of the unittests that uses the same sources.
The tests pass, but I am not sure they should. For example in
the second test the default_library=both setting in the machine file
should have the same effect as the -D option (machine files have lower
priority than command line, but higher priority than anything in meson.build
files).
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
There is common logic hiding between project() and "meson configure": the
complication that the comment mentions for the "default_options" case
actually applies to "meson configure", to machine files, to command line
options and to project options. Reuse the same function in all four cases.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
They must be there when running re-configuring, because the backend cannot
be changed, but they can be pending on the first invocation.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Once unknown options will go through accept_as_pending_option, only system options
that really exist in Meson will be accepted. Adjust the unit tests.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Starting with Meson 1.8.0, "meson configure" prints some options as
":foo" instead of "foo". Print the option as it was passed by the
user.
While at it, make errors more consistent and/or correct (e.g.
"Unknown option" instead of "Unknown options").
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Without this commit, the rewriter and the static introspection tool
crash if `meson.build` contains something like
```meson
if false
foo = not_defined
endif
```
or
```meson
if false
message(not_defined)
endif
```
While it could be argued, that you should not write stuff like this,
this used to raise a `MesonBugException`, which we have to fix.
Fixes #14667
|
|
it uses the existing 14 configure file test case to configure
config 7 and 10 with cmake and meson and then compares the
relevant output to see if they are equal
|
|
Which doesn't give helpful error messages unless used with pytest
|
|
This wraps all of the compiler detections in this test case in
try/except blocks. These blocks will return a skipTest for Python >=
3.11 (where subTest and skipTest interact correctly), and continue if
they do not. For Meson CI runs they will fail the specific subtest,
which is also an improvement as it can help pinpoint exactly which
subtest failed.
Fixes: #14579
|
|
Add a few asserts for functions that could in theory return None, but if
they do something has gone *really* wrong with the test.
|
|
Which is a very large and complicated test function
|
|
ELD is Qualcomm's open-source embedded linker.
https://github.com/qualcomm/eld
Signed-off-by: Kushal Pal <kushpal@qti.qualcomm.com>
|
|
DirectoryLock provides a generic locking implementation the replaces the
previously used BuildDirLock.
|
|
We'll need to evaluate those expressions before generating the AST.
Instead take a config key-value dictionary and evaluate the expression
to return a boolean.
|
|
Add cfg token to be able to parse the top level cfg() function.
Fix parser which was creating a new iterator when recursing which caused
the caller function's iterator to not have advanced when recursing
function returns.
|
|
Change the semantics of IntrospectionBuildTarget.source_nodes
and IntrospectionBuildTarget.extra_files .
The rewriter and the static introspection tool used to be very broken,
now it is *less* broken, hence we add some tests in this commit.
Fixes #11763
|
|
Make the AstInterpreter create a directed acyclic graph (called
`dataflow_dag`) that stores the how the data flowes from one node in
the AST to another.
Add `AstInterpreter.node_to_runtime_value` which uses `dataflow_dag`
to find what value a variable at runtime will have.
We don't use dataflow_dag or node_to_runtime_value anywhere yet, but
it will prove useful in future commits.
|
|
The order in which the rewriter outputs the listed sources is more or
less arbitrary anyways, so we ignore it to prevent the tests from
breaking after small irrelevant changes.
|
|
Restore the behavior from before commit d37d649b0 ("Make all Meson level
options overridable per subproject.", 2025-02-13). The old code was:
options: T.MutableMapping[OptionKey, T.Any] = OrderedDict()
# process project default options
for k, v in default_options.items():
if not subproject or k.subproject == subproject:
options[k] = v
# override them with machine default and command line options
options.update(env.options)
env.options = options
Fixes: #14608
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
configure"
Follow the same logic that is used at the end of the first invocation.
This fixes
meson setup --reconfigure -Db_ndebug=true
on a project that has no language that defines b_ndebug.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
The check for unknown options is duplicated in OptionStore and MesonApp. Place the
better version of the two as a new method of OptionStore, and use it in
OptionStore.validate_cmd_line_options.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
On Windows, os.execv spawn the process in background and returns 0.
Therefore, it prevents devenv to return proper exit code from the
called process. (see https://github.com/python/cpython/issues/63323
for reference.)
The solution is to call subprocess.run instead, on Windows, at the
price of keeping the meson python process alive while the devenv
subprocess runs.
|
|
Since opt.deprecated is a dictionary with string keys, the lookup must use
str() around the user-provided value; with some care because booleans
will be the meson-ic 'true' and 'false' instead of Python's 'True' and
'False'.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
The unit tests for the `meson test --slice=` option check that the
option is working by extracting all tests that have been run from the
command output. This is done with a rather loose regular expression
"test-[0-9]*", which can easily match other parts of the output, as
well.
One user for example reported that the test broke because they were
executing tests in a directory called "meson-test-1.8.0-build", and
given that the "test-1" part of that directory matches the regular
expression we have too many matches.
Fix the issue by tightening the regex so that is way less likely to
match anything from the host's build environment.
Reported-by: Dominique Leuenberger <dleuenberger@suse.com>
Signed-off-by: Patrick Steinhardt <ps@pks.im>
|
|
Path.is_dir() can raise a PermissionError if a parent does not have
the executable permission set; plus the "in p.parents" tests are
very expensive. Do not use Path at all.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|