| Age | Commit message (Collapse) | Author |
|
|
|
|
|
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>
|
|
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>
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Move the logic for system dependencies outside Cargo.interpreter and
into the rust module, so that it can be reused by the workspace object.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Add rustc_args(), env(), and rust_dependency_map() methods to the
RustPackage class. They simply delegate to PackageState and
PackageConfiguration.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Note that, as shown in the testcase, package() works in the subproject
as well. This means that in the future the Cargo code generator can be
changed to reduce the amount of generated code and instead rely on the
package object.
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 up to 2x faster because it avoids checks for pkg-config and cmake.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Add features property to cargo.Interpreter to make default features configurable;
customization of which features are enabled by default is triggered by
rust.workspace().
Fixes: #14290
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
rust.workspace() is the entry point for global feature resolution.
It loads a Cargo.toml file and ensures that all dependencies will be
built with the correct set of features.
Fixes: #13404
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
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>
|
|
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".
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
This used to be
if for_machine is MachineChoice.BUILD and not is_cross:
so it needed to be negated. This is also clearly wrong because
"env.is_cross_build(for_machine)" has no effect - it is only true
if for_machine is MachineChoice.HOST, in which case key.as_host()
does nothing.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Since OptionKey is immutable, it is possible to return self
if we know that the returned value is the same as the one
being transformed.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
|
It's now only used to populate the DependencyCandidate, so we can remove
it and just calculate the same information from the `type_name`
parameter. This reduces code and the number of method calls.
|
|
Avoid extra method calls and repeating ourselves.
|
|
|
|
This makes the type checking more reasonable (including fixing an issue
that newer mypy is pointing out to us), consolidating special cases, and
improving code readability.
|
|
The goal is to have a single type for candidates that replaces having a
mixture of class initializers, partials, and factories with a single
wrapper class.
|
|
This simplifies a bunch of cases, and likely fixes some annoying bugs
in cross compile situations where should have been passing this and
weren't.
|
|
It's allowed in the `DependencyKeywordArguments` TypeDict already, so we
now have two sources of truth. Additionally, it's often populated by
reading from that dict, so we're just doing useless work.
|
|
We have type checking that ensures this is a string list already.
|
|
So we don't create a default name that is overwritten except in the case
of appleframeworks. This allows for some cleanup, including
deleting some initializers that were only setting the name.
|
|
This is really class constant for all dependencies, and by taking it out
of the initializer we make the `__init__` call have a more consistent
interface.
|
|
|
|
Some of these issues have been resolved
|
|
Splits the subclass specific code into those classes
|
|
This replaces the long explanation of `external_library`s in the
`link_with` parameter to the simpler one used by declare_dependency.
Additionally, declare_dependency now checks that a target is linkable
when adding it. This just catches the problem before it goes down into
the build layer giving a better error message.
There is a bug in the declare_dependency annotations, in that they don't
mark Executable as acceptable. So I've fixed that.
|
|
This puts subclass specific logic in the subclasses, and cleans up some
typing.
|
|
This catches the addition of un-linkable targets at the interpreter
level rather than requiring the build layer to handle this. In turn,
this gives the end user a better error message.
|
|
|
|
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`
|