| Age | Commit message (Collapse) | Author |
|
Some projects may want to override Meson's AST generation for Cargo
projects. This was not really doable before without hard coding the
results of feature resolution; however, now it will be possible by
accessing the results of the global feature resolution from the Rust
module's workspace object.
At the same time, the subproject must keep using the Cargo method,
which is forced by the workspace object's subproject() method,
because otherwise the interpreter is not propagated. So just
skip the interpretation phase if a Meson.build is present.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
What is basically impossible is to handle `SubprojectHolder`, because
it's not a true holder but an interpreter object. Well, impossible
without changing SubprojectHolder into a true holder, because it's
avoiding the circular import becomes extremely convoluted otherwise, and
refactoring is difficult because the held object is itself an
Interpreter. It's a rather complex problem to solve gracefully. I've
punted to avoid the complexity, it does mean that the error message is
somewhat less exact.
I don't think this is actually a huge problem because we've really
guided people away from using `subproject()` and to instead use
dependency fallbacks, which don't have this problem to begin with.
This removes validation from the build layer, and puts it in
interpreter. For code sharing reasons this means that
`internal_dependency` also gets more fine grained error messages.
The test case for this has been modified to use the `testcase
expect_error` construct, and thus has been moved to the common tests
directory. It's also been extended to cover both the library case, which
gives coverage for the `extra_types` in `KwargInfo`
|
|
With the previous change the build layer no longer needs to be concerned
about strings
|
|
This allows some additional cleanup, as we had code specifically for
doing version checking that was not only used here, and that can be
removed.
|
|
Instead of using the `extract_incdirs` function.
|
|
|
|
|
|
This extends the code that strips executable keyword arguments to also
default populate shared_library exclusive arguments.
Fixes: #15238
|
|
This really isn't a list because it's not homogenous data, it's really
`tuple[str, str | None] | None`, but we're using list length to decide
what to do with it, and that makes for strict null issues, as an
accurate annotation would be `list[str | None]`, which would require a
lot of `is not None` checking. By using a tuple we don't need to keep
checking length, which is more expensive than null checking.
To ensure correctness I annotated some things in the VS backend
|
|
|
|
This gets us to the point that the build layer can assume it's getting
valid inputs. This does two checks, an initial cheap check for generated
sources, and then an I/O check via `source_strings_to_files`.
|
|
These are two ways to implement the same thing, and at the DSL level the
`rust_abi` provides needed flexability, but at the lower level where a
target is a thing, the `rust_crate_type` is still proving to be more
useful. So, keep the `rust_abi` in the Interpreter and don't let it leak
into the build layer.
|
|
Because it's not clear how ownership is supposed to work here, and in
the case of `both_libraries()`, if there are any mutations made to them
then those propagate, which isn't what we want.
I'd like to do some further refactoring here that would make this not
necessary.
|
|
Why do work and then error out?
|
|
Place the build products in a directory of the specified name
somewhere within the build directory. This allows use of the target
that includes a specific directory name:
#include <subdir/configure.h>
This also allows creating targets with the same basename by using
different subdirectory names.
v2:
Move build_subdir to Target class.
Error if path separator in build_dir
v3:
Rename to 'build_subdir' to make it clear that the name is
appended to a meson-specific build directory, and does not
provide the user with a way to define the overall meson build
hierarchy.
Allow build_subdir to include path separators.
Support 'build_subdir' for configure_file.
build_subdir must not exist in the source directory and
must not contain '..'
Add documentation and tests
v4:
Rebase and prepare for version 1.9.1
Add failing test case when build_subdir is present in the
project.
Add release note snippet
v5:
Clarify wording on restrictions on the value of build_subdir. Use
the same wording in each place this restriction is described.
v6:
Move path validation to shared function, validate_build_subdir,
instead of duplicating the tests in two places.
v7:
Update version numbers to 1.10.0
Add TypedDict updates.
Remove spurious build_subdir instance variable
v8:
Oops, missed one version number update.
Signed-off-by: Keith Packard <keithp@keithp.com>
|
|
Options are now added to pending_options only if they *can* be accepted
as pending, so there is never a need check if something is in pending_options
but not acceptable.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
There is no point in doing so as it can be readily obtained from the
environment. This in preparation of extracting more installation
location from the environment.
|
|
The lookup code only has two callers. One of them is an internal caller
that never sets the `required` key, and the other is the interpreter.
Moving this code to the interpreter allows us to simplify the common
code, especially the types.
|
|
This allows us to avoid making `feature` a union, therefore if we write
code like:
```python
disabled, required, feature = extract_required_kwarg(...)
if disabled:
...
```
and now mypy knows that feature is a `str` inside the `if disabled`
block
|
|
Since it's basically unusued, but the DEPENDENCY_KWS can be used instead
This requires changing the number of arguments from 19 to 20 because the
`DEPENDENCY_KWS` includes `disabler`, but the
`permitted_dependency_kwargs` does not.
|
|
|
|
This is also the ideal time to remove the `allow_unknown` from
`typed_kwargs`, as permittedKwargs was providing extra key checking, so
now `typed_kwargs` can do that instead.
|
|
|
|
|
|
This allows us a bunch of nice things:
1. We can use the DependencyMethods enum everywhere
2. The deprecated methods can be checked in the Interpreter, so we can
now emit deprecation warnings for stuff that was deperecated in
0.44!
3. We can share this more strongly typed method everywhere
|
|
The cleanup this allows lower down points out that we don't properly
validate the value passed to `as_system()`. I have no idea what happens
if you pass a non-valid value, but it's a bug and I've simply made it a
hard error. We can re-assess if necessary.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
A cargo subproject can fallback to a regular Meson subproject in the
case it has system-deps.
|
|
Fixes: #12519
|
|
|
|
Cargo workspaces will use this to have a single subproject defining
multiple crates.
|
|
No one is accessing backend.interpreter anymore, get rid of it
to avoid future temptations.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
The interpreter's build_def_files are the only remaining piece
of interpreter state used by the backend. Compute it once
and store it in build, using a property to ensure that it's initialized
and accessed correctly.
This also removes one of the cases in which introspection uses the
interpreter object.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Objects like targets already store the environment in which they
were created, do the same for Generator: pass it to the constructor
and use it in process_files.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
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.
|
|
This includes cleaning up some of the type handling to account for
cleanups that are done at the DSL level.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|