aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/interpreter/mesonmain.py
AgeCommit message (Collapse)AuthorFilesLines
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-11-22interpreter: use find_program_impl internally instead of func_find_programDylan Baker1-1/+1
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-15interpreter: disallow RunTarget in meson.add_install_scriptPaolo Bonzini1-5/+5
Without this patch, the name of the RunTarget is passed to the install script; for the enclosed test, meson setup (incorrectly) succeeds, but installation fails.
2021-10-30Typo fixes (CustomTaget -> CustomTarget)rusty-snake1-1/+1
2021-10-27Fix add_install_script() ignoring install_tagXavier Claessens1-0/+1
Fixes: #9454
2021-10-10Fix typos discovered by codespellChristian Clauss1-1/+1
2021-10-04fix extra whitespaceEli Schwartz1-1/+0
discovered via flake8 --select E303
2021-09-25interpreter: Introduce StringHolderDaniel Mensinger1-2/+3
Another commit in my quest to rid InterpreterBase from all higher level object processing logic. Additionally, there is a a logic change here, since `str.join` now uses varargs and can now accept more than one argument (and supports list flattening).
2021-09-24interpreter/mesonmain: remove unreachable codeDylan Baker1-5/+2
Now that we have type checking, we can be sure that this code is unreachable, and remove it.
2021-09-24interpreter/mesonmain: Fix remaining typing problems and add to run_mypyDylan Baker1-25/+36
2021-09-24build: use an object rather than a dict for the dep_manifestDylan Baker1-3/+3
This really is more of a struct than a dict, as the types are disjoint and they are internally handled, (ie, not from user input). This cleans some things up, in addition I spotted a bug in the ModuleState where the dict with the version and license is passed to a field that expects just the version string.
2021-09-24interpreter/mesonmain: Add full set of typed_argument guardsDylan Baker1-99/+122
2021-09-24interpreter/mesonmain: fix type annotationsDylan Baker1-3/+3
Taht should have been converted to build/program module objects, not interpterter objects
2021-08-30make EnvironmentVariablesObject a proper holderDylan Baker1-7/+8
Currently, EnvironmentVariablesObject is a strange holder-that's-not-a-holder. This has implicaitons for things that expect to get an EnvironmentVariables object, as we can't automatically unholder it, and instead have to to manually do so. Now we can automatically unholder it, which makes everything much nicer.
2021-08-30Simplify condition in can_run_host_binaries()Xavier Claessens1-7/+6
2021-08-27interpreter: fix cases of `KwargInfo(..., T, default=None)`Dylan Baker1-6/+11
The correct way to mark these is `KwargInfo(..., (T, type(None)))`. There's also a few cases of `(T, None)` which is invalid, as `None` isn't a type
2021-08-23interpreter: Fix dependency(..., static: true) fallbackXavier Claessens1-10/+48
It should build the fallback subprject with default_library=static and override the dependency for both static=True and static kwarg not given. Fixes: #8050.
2021-08-17Add install tagsXavier Claessens1-8/+7
Fixes: #7007.
2021-07-21Fix meson.version().version_compare() regression in subprojectXavier Claessens1-1/+1
2021-07-05more f-strings too complex to be caught by pyupgradeEli Schwartz1-4/+4
2021-06-18holders: Fix the remaining code to respect the holder changesDaniel Mensinger1-12/+11
2021-06-18holders: remove unholderDaniel Mensinger1-3/+0
2021-06-18interpreter: Add a new MesonInterpreterObject for non-elementary objectsDaniel Mensinger1-4/+7
2021-04-09Add global_source/build_root()Xavier Claessens1-2/+16
2021-04-01interpreter: Move to its own folder and split itXavier Claessens1-0/+369