aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/interpreter
AgeCommit message (Collapse)AuthorFilesLines
2022-01-18interpreterobjects: deprecated passing a number to configuration_data.set10Dylan Baker1-0/+8
This is currently allowed, and is used in at least a few projects. It was not intended to work or documented, but it does and since it is in use a full deprecation period must be used. A warning has also been added for values < 0, which have surprising behavior.
2022-01-18interpreterobjects: remove no-flattening from configuraiton_data.getDylan Baker1-1/+0
It's no longer required because we don't allow arrays as fallbacks anymore.
2022-01-18interpreterobjects: don't allow keyword arguments in configuration_data.keysDylan Baker1-0/+1
Which do nothing, and shouldn't be allowed.
2022-01-18interpreter: replace ConfigurationDataObject with ConfigurationDataHolderDylan Baker3-41/+42
This is much cleaner, and more in line with the way we handle interpreter objects in modern meson practice
2022-01-18interpreterobjects: clean up ConfigurationData initializerDylan Baker1-4/+2
2022-01-18interpreterobjects: use typed_* for configuration_data.set*Dylan Baker2-43/+28
This removes the ability to use ConfigurationData as a dict, but restricting the inputs to `str | int | bool`. This may be a little too soon for this, and we may want to wait on that part, it's only bee 8 months since we started warning about this.
2022-01-18interpreterobjects: use typed_* with configuration_data.merge_fromDylan Baker1-7/+5
2022-01-18interpreterobjects: use typed_* with configuration_data.get_unquotedDylan Baker1-7/+5
2022-01-18interpreterobjects: use typed_args for configuration_data.getDylan Baker1-12/+6
2022-01-18interpreterobjects: use typed_pos_args and noKwargs for configuration.data.hasDylan Baker1-1/+3
2022-01-18interpreterobjects: use typed_kwargs for dependency.get_variableDylan Baker2-8/+31
2022-01-18interpreterobjects: use typed_kwargs for dependency.get_pkgconfig_variableDylan Baker2-2/+18
2022-01-18dependencies: don't pass kwargs from get_pkgconfig_variableDylan Baker1-1/+1
This is a layering violation, we're relying on the way the interpreter handles keyword arguments. Instead, pass them as free variables, destructuring in the interpreter
2022-01-18interpreterobjects: use typed_kwargs for FeatureOption.requireDylan Baker2-10/+14
2022-01-18interpreterobjects: use typed_pos_args for FeatureOpotionDylan Baker1-10/+4
2022-01-18interpreterobjects: use typed_pos_args for dependency.as_system_methodDylan Baker1-11/+3
2022-01-18interpreterobjects: use typed_pos_args for dependency.get_configtool_variableDylan Baker1-8/+3
2022-01-18interpreterobjects: use typed_pos_args for dependency.get_pkgconfig_variableDylan Baker1-8/+3
2022-01-18interpreterobjects: consistently use dependency. for error messagesDylan Baker1-16/+16
We currently use a mixture of dependency, Dependency, and dep
2022-01-12subproject: fix version validation on lookupØyvind Aarrestad Aakre1-0/+5
Fixes a bug where the subproject version was not validated when the subproject had already been processed. The bug would cause inconsistent build results if the subproject was referenced more than once (diamond) with conflicting version requirements.
2021-12-30remove no longer needed validation routineEli Schwartz1-6/+4
We don't need to check when processing the script args, whether the correct types were passed. We check this upfront in typed_pos_args now.
2021-12-30add_*_script: fix incorrect typed_pos_args allowing built targetsEli Schwartz1-8/+8
In commit c239ce31f55579cfe1e29b769a8bda97deca2166 support was added to these functions to accept various non-string types. Despite the commit/PR documenting that only add_install_script is permitted to accept built files, the actual check parameter was set, for all three, to "True" (so the function was never invoked with False at all). This meant that actually attempting to use the allowed types would fail at postconf or dist, with python tracebacks in the former case and "Failed to run dist script" in the latter case. This was partially ameliorated in commit 6c5bfd4c241e94f5e0f4dea9ba7fb5d5090a4802 which added typed_pos_args, but unfortunately those typed_pos_args were all over the place. For postconf: - They banned external programs as additional args (which should be allowed) - They banned built executables (good) - They allowed custom targets as additional args (bad) For dist: - they allowed external programs (good) - they allowed built executables, but only as the first argument (bad, also ???) - they allowed custom targets, but only as additional arguments (bad, also ???) Fix this all to only allow the same argument types for both the script argument and the script-args arguments. That type is known at configure time and restricted to source files, configured files, and found programs.
2021-12-30add_*_script: fix missing FeatureNew for non-string argumentsEli Schwartz1-14/+10
In commit 2c0eaf5c4f4493146355eeb8521c17a3c2ef5acd support was added for install scripts to accept found programs, built executables, or custom targets. In commit c239ce31f55579cfe1e29b769a8bda97deca2166, this was extended to dist and postconf scripts too (although it was documented that those should not accept targets that are built by ninja). Despite the commit/PR claiming that all of these should always accept files and configured files, this was only true for arguments other than the first, until commit f808c955eab983b31feee130f0947c7cb254a94f. In amongst all this, FeatureNew checks were never registered for the first argument, only for additional arguments, until late in the game with the addition of FeatureNew checks for File objects. Fix this in part by moving the 3 different File checks into one, inside the function that processes the first script, and make that function check for FeatureNew on anything else too.
2021-12-20restore additional info about the potential cause of find_program failingEli Schwartz1-1/+1
Before commit f08eed37cb69ba0d793c0f1d086eaef7f25c2ea3 we also mentioned that it might not be executable.
2021-12-20restore the ability in the backend to silently find a programEli Schwartz1-2/+4
Broken in commit f08eed37cb69ba0d793c0f1d086eaef7f25c2ea3 which moved the reporting and unconditionally added it.
2021-12-17Fix mypy errorsDaniel Mensinger1-0/+1
2021-12-07custom_target: catch and reject input files that do not existEli Schwartz1-10/+14
Currently there is a try/except around the function that detects and rejects this, which instead of rejecting it, spawns a warning and continue. This warning exists because of 'test cases/vala/9 gir/' which passes a vala generated output that isn't a return value (!!!) using string joining with the meson.current_build_dir() function (also !!!) because we officially document this (!!! for a third time) as the only way to make a vala shared library generate a typelib with a custom_command from the automatically generated gir: https://mesonbuild.com/Vala.html#gobject-introspection-and-language-bindings In #3061 we converted strings to Files, but only if none of them were this vala hack. Due to the precise implementation, we also failed to convert strings to Files if any other error occurred, but since we only want to ignore errors for generated vala outputs, tighten that check and specifically call out generated files in the warning. Fixes #8635
2021-12-07interpreter: use common DEPENDS_KWDylan Baker2-3/+3
2021-12-07interpreter: move more custom_target keyword arguments to the type_checking ↵Dylan Baker2-3/+8
module These are going to be used in the gnome module.
2021-12-06interpreter: use build.GeneratedTypesPaolo Bonzini1-1/+1
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-12-06interpreter: allow extract_objects to receive generated sourcesPaolo Bonzini1-2/+2
Fixes: #8333
2021-12-06allow passing a CustomTargetIndex as argument to a testPaolo Bonzini1-1/+1
Fixes: #7585 Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-12-01add install_symlink functionPablo Correa Gómez2-0/+25
Allows installing symlinks directly from meson, which can become useful in multiple scenarios. Current main use is to help moving forward #9557
2021-12-01interpreter: reorder functions alphabeticallyPablo Correa Gómez1-15/+15
2021-11-30fix broken FeatureNew checks that never printedEli Schwartz1-2/+2
They passed the arguments in the wrong order, so the version parsed as the message and the message parsed as a version. While we are at it, pass the location node in too.
2021-11-29interpreter: allow Compiler as a variadic positional argumentDylan Baker1-6/+15
We allow this for the command (the first parameter), but not later parameters, which is just odd. This also allows us to give better error messages for the case of overridden programs.
2021-11-29interpreter: use typed_kwargs for run_commandDylan Baker2-16/+22
This also cleans up a couple of internal callers of the internal impl version that don't set the `check` argument, and therefore trigger a warning about not setting the check argument.
2021-11-29interpreter: use typed_pos_args for run_commandDylan Baker1-8/+18
2021-11-28make sure files arguments to compiler.compiles and friends, performs rebuildEli Schwartz1-0/+3
If the compiler check is updated as a string in meson.build, we force rebuild, which is a good thing since the outcome of that check changes the configuration context and can enable or disable parts of the build. If the compiler check came from a files() object then we didn't add a regen rule on those files. Fixes #1656
2021-11-27Merge pull request #9531 from dcbaker/submit/interpreter-more-typingJussi Pakkanen4-114/+193
More use of typed_* in the interpreter module
2021-11-25interpreter: fix `feature.require` handling of error messageBenoit Pierre1-1/+2
Don't show a blank error when no `error_message` was passed as argument.
2021-11-23interpreter: extract_objects provides a valid sourcePaolo Bonzini1-4/+5
This ensures that there is no warnings when running meson on test cases/common/22 object extraction. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-11-22simplify passing some nodes aroundEli Schwartz1-2/+2
Every function has a copy of the node as a kwarg, and doesn't need to go through the class's self.current_node.
2021-11-22interpreter: use typed_kwargs for find_programDylan Baker2-10/+20
2021-11-22interpreter: use find_program_impl internally instead of func_find_programDylan Baker2-4/+4
Calling interpreter implementation methods is just a bad idea, apart from the extra type checking that goes into it, we need to pass more arguments than we need to calling the impl method.
2021-11-22interpreter: move disabler KwargInfo to the type_checking moduleDylan Baker2-1/+4
2021-11-22interpreter: use typed_pos_args for find_programDylan Baker1-8/+6
2021-11-22interpreter: add type annotations to find_program_implDylan Baker1-4/+8
2021-11-22interpreter: use typed_* args for the summary functionDylan Baker2-24/+28
This also includes a few type annotation cleans for the Summary object. Getting the positional arguments exactly right is impossible, as this is really a function with two different signatures: ``` summary(value: dictionary): void summary(key: string, value: any): void ``` We can get close enough in the typed_pos_args by enforcing that there are two parameters, one required and one optional, and that the first must be either a dictionary or a string.
2021-11-22interpreter: add typed_kwargs to subdirDylan Baker2-7/+30