summaryrefslogtreecommitdiff
path: root/mesonbuild/modules/unstable_rust.py
AgeCommit message (Collapse)Author
2022-08-17interpreter: move handling of module stability to interpreterDylan Baker
Thanks to `ModuleInfo`, all modules are just named `foo.py` instead of `unstable_foo.py`, which simplifies the import method a bit. This also allows for accurate FeatureNew/FeatureDeprecated use, as we know when the module was added and if/when it was stabilized.
2022-08-17modules: Add stabilization information to ModuleInfoDylan Baker
We're going to do more with this in the next commit, but this just adds the information for now. This allows the next commit have 100% mv changes for some of the modules, which makes review easier
2022-08-17modules: use module level information about new and deprecationDylan Baker
Instead of using FeatureNew/FeatureDeprecated in the module. The goal here is to be able to handle information about modules in a single place, instead of having to handle it separately. Each module simply defines some metadata, and then the interpreter handles the rest.
2022-05-31fix regression that broke type checking of CustomTarget outputsEli Schwartz
We validate a few things here, such as the non-presence of '@INPUT' in an output name. These got moved out of the CustomTarget constructor in commit 11f96380351a88059ec55f1070fdebc1b1033117 and into KwargInfo, but only for kwargs that took multiple values. This caused configure_file() and unstable_rust.bindgen() to stop checking for this. Add a shared single-output KW and use it in both places. This now dispatches to _output_validator. configure_file now validates subdirectories in output names the same way we do elsewhere, directly in the typed_kwargs and by specifying the erroring kwarg.
2022-03-29Pass environment down to base Target classXavier Claessens
2022-03-24Make compilers list per subprojectXavier Claessens
Previously subprojects inherited languages already added by main project, or any previous subproject. This change to have a list of compilers per interpreters, which means that if a subproject does not add 'c' language it won't be able to compile .c files any more, even if main project added the 'c' language. This delays processing list of compilers until the interpreter adds the BuildTarget into its list of targets. That way the interpreter can add missing languages instead of duplicating that logic into BuildTarget for the cython case.
2022-03-20modules/rust: set bindgen include_dirs for both build and source dirDylan Baker
Which we pretty obviously need if any of our headers are generated
2022-03-07build: plumb structured sources into BuildTargetsDylan Baker
2022-01-28build: replace kwargs in CustomTarget initializerDylan Baker
Because we don't want to pass the Interpreter kwargs into the build layer. This turned out to be a mega commit, as there's really on elegant way to make this change in an incremental way. On the nice side, mypy made this change super easy, as nearly all of the calls to `CustomTarget` are fully type checked! It also turns out that we're not handling install_tags in custom_target correctly, since we're not converting the boolean values into Optional values!
2021-11-23rust: clean up inputs and outputs to bindgenPaolo Bonzini
Make the handling of bindgen inputs consistent with the inputs and outputs of source_strings_to_files. However, for the first source argument reject anything that cannot possibly be an header file. This also fixes a mypy failure from the next patch, since ExtractedObjects does not have a zero-argument get_outputs method. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-08-16modules/rust: fix initialize signatureDylan Baker
So that it's accurate, and we don't need to use to use `#type: ignore` declaration
2021-08-16modules/rust: use typed_kwargs for bindgenDylan Baker
This was the only function left in here that wasn't fully typed, so let's fix that
2021-06-18holders: Fix the remaining code to respect the holder changesDaniel Mensinger
2021-06-18holders: remove unholderDaniel Mensinger
2021-06-15modules/qt: fully annotate and check qt.has_toolsDylan Baker
2021-06-14interpreter: use typed_*args for test and benchmarkDylan Baker
this also requires some changes to the Rust module, as it calls into the test code.
2021-06-14interpreter: use typed_pos_args for func_test and func_benchmarkDylan Baker
Requires a few small changes to the Rust module, as it calls `func_test`
2021-05-28modules: Replace find_program_impl() by state.find_program()Xavier Claessens
2021-05-28modules: Add methods dict everywhereXavier Claessens
This fix calling random internal methods from meson.build as long as they were not prefixed by underscore.
2021-05-28modules: Stop using ModuleReturnValue where it's not neededXavier Claessens
It is only needed in functions that need to add targets to the interpreter.
2021-05-19interpreter: Add docstring and fix types of source_strings_to_filesDylan Baker
2021-04-12interpreter: Split permitted_kwargs dictXavier Claessens
2021-04-01interpreter: Move to its own folder and split itXavier Claessens
2021-03-19split program related classes and functions out of dependenciesDylan Baker
Dependencies is already a large and complicated package without adding programs to the list. This also allows us to untangle a bit of spaghetti that we have.
2021-03-04Simplify module APIXavier Claessens
- ModuleState is now a real class that will have methods in the future for actions modules needs, instead of using interpreter internal API. - New ModuleObject base class, similar to InterpreterObject, that should be used by all objects returned by modules. Its methods gets the ModuleState passed as first argument. It has a `methods` dictionary to define what is public API that can be called from build definition. - Method return value is not required to be a ModuleReturnValue any more, it can be any type that interpreter can holderify, including ModuleObject. - Legacy module API is maintained until we port all modules. In the future modules should be updated: - Use methods dict. - Remove snippets. - Custom objects returned by modules should all be subclass of ModuleObject to get the state iface in their methods. - Modules should never call into interpreter directly and instead state object should have wrapper API. - Stop using ModuleReturnValue in methods that just return simple objects like strings. Possibly remove ModuleReturnValue completely since all objects that needs to be processed by interpreter (e.g. CustomTarget) should be created through ModuleState API.
2021-02-06rust: Add a module wrapper for bindgenDylan Baker
This has a couple of advantages over rolling it by hand: 1. it correctly handles include_directories objects, which is always handy 2. it correctly generates a depfile for you, which makes it more reliable 3. it requires less typing
2021-02-06modules/rust: use typed_pos_argsDylan Baker
2021-01-19Replace NinjaBackend is_rust_target with build.uses_rustDylan Baker
we have two functions to do the exact same thing, and they're basically implemented the same way. Instead, let's just use the BuildTarget one, as it's more generally available.
2021-01-13Fix misspellsAntonin Décimo
Signed-off-by: Antonin Décimo <antonin.decimo@gmail.com>
2021-01-05modules: Add an unstable-rust moduleDylan Baker
Like other language specific modules this module is module for holding rust specific helpers. This commit adds a test() function, which simplifies using rust's internal unittest mechanism. Rust tests are generally placed in the same code files as they are testing, in contrast to languages like C/C++ and python which generally place the tests in separate translation units. For meson this is somewhat problematic from a repetition point of view, as the only changes are generally adding --test, and possibly some dependencies. The rustmod.test() method provides a mechanism to remove the repatition: it takes a rust target, copies it, and then addes the `--test` option, then creates a Test() target with the `rust` protocol. You can pass additional dependencies via the `dependencies` keyword. This all makes for a nice, DRY, test definition.