Age | Commit message (Collapse) | Author | Files | Lines |
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
|
|
|
|
|
Signed-off-by: Filipe LaÃns <lains@riseup.net>
Signed-off-by: Michał Górny <mgorny@quansight.com>
|
|
Fixes: #14956
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
This reverts commit 12563f74a9f3dda70dcd4778aa958de355d1fae7.
|
|
This reverts commit 651aede977179c5fe382744e3dd91ca8e01d050c.
This was most certainly not acceptable.
|
|
|
|
We might run into an assertion failure down the road, if we don't fail
here. Specifically
project('proj')
executable('bin', 'header.h')
will throw during the ninja generation.
|
|
OptionStore.get_value did not change build keys to host when not
cross-compiling. get_value_object_and_value_for also didn't when
accessing self.augments.
Make all accessors go through ensure_and_validate_key so that the
conversion is done early. Otherwise, when "native: true" targets look
up compiler options they do so with the "build.*" name, which does not
exist when not cross compiling.
This removes the distinction between get_value(), meant to be for global
options, and get_value_for() which would be for project-specific options.
While the distinction was added in commit d37d649b0 ("Make all Meson
level options overridable per subproject.", 2025-02-13), it is not
particularly useful and can be a source of bugs like the one in
test_build_to_host_subproject testcase (corresponding to issue #14869).
Fixes: #14869
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
It does not seem to be needed anymore, and the incomplete mock does
not have for example the "yielding" attribute that is used by
OptionStore.get_value_object_and_value_for.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Fixes #14840
|
|
The introspection interpreter sometimes produces targets with no source
files; BuildTarget will then pick a random compiler, according to the
order in clink_langs.
According to the comment in sort_clink, clink_langs are supposed
to list languages from *lowest* to highest priority. However,
process_compilers_late() process clink_langs in straight order and
returns the first language; which is the one with lowest priority.
This became visible with the addition of Rust to clink_langs,
because Rust has limitation on the names of library targets, but
the bug existed before.
Fixes: e49f2f7283e1d9f18e2f5f54647c07287cd70339
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
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
|