| Age | Commit message (Collapse) | Author |
|
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>
|
|
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.
|
|
|
|
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`
|
|
This just puts the type checking in the frontend, there's still some
serious cleanup in the build and backend that need to happen.
|
|
With the previous change the build layer no longer needs to be concerned
about strings
|
|
By setting the default `set_is_system` to `'preserve'`, we don't have to
have a check for None inside the body of the method.
|
|
Comparing the implementation of build_subdir with
https://github.com/mesonbuild/meson/pull/12258, both of them introduced
a similar separation between srcdir and builddir. There were some
differences in the choices of srcdir vs builddir; this commit tries to
identify which are bugs in which implementation, and get the best of
both worlds.
|
|
|
|
|
|
|
|
|
|
Compiler.get_language_stdlib_only_link_flags
|
|
|
|
Sometimes, a Rust static library's native static libs refer to
libraries installed in the rustc target libdir. This is always the
case for most musl targets (with the intention of making it easier to
use them on non-musl systems), and other targets can also be
configured to do this using e.g. the llvm-libunwind option when
building the standard libraries for the target. When rustc is
responsible for linking it will always add the appropriate directory
to the linker search path, but if we're not using Rust for linking, we
have to tell the linker about that directory ourselves.
The added test demonstrates a scenario where this comes up: linking a
static Rust library, built for musl, into a C executable. -lunwind is
in the native static libs list from the compiler, but it's referring
to the libunwind.a in the self-contained directory.
|
|
Which removes the need to assert it.
|
|
1. Generate OMF objs with `-Zomf' compiler flags
2. Generate OMF libs with `.lib' suffix using `emxomfar' as a librarian
|
|
Give an user opportunities to mangle a custom short name for a DLL on
OS/2.
|
|
On OS/2,
1. a shared libary has '.dll' suffix
2. a length of DLL name should not be longer than 8 chars
3. an import library is used to link against a DLL
4. an import library has '_dll.a' suffix.
|
|
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
|
|
|
|
What's left requires the Environment, so it will have to be handled in
the interpreter implementation for now.
|
|
|
|
This moves the listification and string checking to the interpreter, as
well as some basic size validation.
|
|
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.
|
|
|
|
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>
|
|
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
Fixes: #15028
|
|
This allows us to do a lot less proxy checking for vala, and lot more
"If this thing says it's going to output vala, it's going to output
vala. By only setting them when they use vala, we can also be sure that
the fields aren't meaningless.
|
|
|
|
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>
|
|
All that is needed is the subdir, pass it explicitly (and make it
an optional argument so that the backend does not have to pass it).
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>
|
|
GeneratedList does not need the full interpreter, only the source
and build directories which can be found in Environment.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
|
|
|
|
When a structured source contains non rust files, the backend may select
such a file to treat as the main file. That doesn't work obviously, so
instead filter the main file such that it must be a rust file.
|
|
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 just prevents some unintended instances of values become None, now
they always remain strings or literal-strings
|
|
There is some validation going on here that cannot (currently) be done
the KwargInfo validators, namely that the files exist. Additionally,
BuildTarget.extra_files is doing some membership checking for dups,
which means it should probably be an OrderedSet instead of a list.
|
|
|
|
|
|
|
|
|
|
|