Commit Graph

232 Commits

Author SHA1 Message Date
Dylan Baker 011f13bcdc interpreter: use typed_pos_args for add_langauges 2021-07-07 11:21:05 -07:00
Dylan Baker 011b58d75f interpreter: use typed_pos_args for project 2021-07-07 11:21:05 -07:00
Dylan Baker 015e44014a interpreter: use typed_pos_args for subdir 2021-07-07 11:21:05 -07:00
Dylan Baker 3f6afa2693 interpreter: use typed_pos_args for assert 2021-07-07 11:21:05 -07:00
Dylan Baker 2486938011 interpreter: use typed_pos_args for subproject 2021-07-07 11:21:04 -07:00
Dylan Baker 9f07a1ad41 interpreter: use typed_pos_args for get_option 2021-07-07 11:21:04 -07:00
Dylan Baker 6f6db0f2e3 interpreter: use typed_pos_args configuration_data 2021-07-07 11:21:04 -07:00
Dylan Baker 982973f303 interpreter: use typed_pos_args for alias_target 2021-07-07 11:21:04 -07:00
Dylan Baker 09d7da19c1 interpreter: use typed_kwargs for include_directories 2021-07-07 11:21:03 -07:00
Dylan Baker 3135b130b8 interpreter: use typed_pos_args for include_directories 2021-07-07 11:20:43 -07:00
Dylan Baker 5aed9dd939 interpreter: use typed_pos_args for add_test_setup 2021-07-07 11:20:43 -07:00
Dylan Baker e71a6544c5 interpreter: use typed_pos_args for join_paths 2021-07-07 11:20:43 -07:00
Dylan Baker 9ecd578167 interpreter: use typed_pos_args for set_variable 2021-07-07 11:20:43 -07:00
Dylan Baker 20c5dfe869 interpreter: use typed_pos_args for get_variable 2021-07-07 11:20:41 -07:00
Dylan Baker 4d05f9d64b interpreter: use typed_pos_args for is_variable 2021-07-07 11:20:07 -07:00
Dylan Baker 30a9bb60ee interpreter: use typed_pos_args for is_disabler 2021-07-07 11:20:07 -07:00
Eli Schwartz bd6f46e723 condense lines 2021-07-05 17:55:04 +03:00
Eli Schwartz dd31891c1f more f-strings too complex to be caught by pyupgrade 2021-07-05 17:55:04 +03:00
Jussi Pakkanen ec5baa62c8
Merge pull request #8950 from dcbaker/submit/import-required-disabled
Add required and disabled to import, modules.found method
2021-07-03 14:00:47 +03:00
Daniel Mensinger 971a0b1775 fix: get_variable default variables are not ObjectHolders (fixes #8936) 2021-07-02 17:14:44 +03:00
Dylan Baker bc4201a7f1 interpreter: add required and disabled to import
This is useful both from the perspective of optional functionality that
requires a module, and also as I continue to progress with Meson++,
which will probably not implement all of the modules that Meson itself
does.
2021-06-30 16:28:14 -07:00
Dylan Baker 4a0a6a8083 modules: modules need to return either an ExtensionModlue or a
NewExtensionModule object

So that we get the found() method.
2021-06-30 14:07:26 -07:00
Dylan Baker 351a1e9ec9 interpreter: use typed_pos_args for func_import
and make the helper method private
2021-06-30 12:46:33 -07:00
Simon Ser 1f3adc4dbe Add feed arg to custom_target() 2021-06-29 20:54:13 +03:00
Daniel Mensinger 3e396b3782
fix: Always explicitly set encoding for text files (fixes #8263) 2021-06-29 11:28:08 +02:00
Daniel Mensinger 8f7343831b refactor: Refactor BothLibraries logic
This commit introduces a new type of `HoldableObject`: The
`SecondLevelHolder`. The primary purpose of this class is
to handle cases where two (or more) `HoldableObject`s are
stored at the same time (with one default object). The
best (and currently only) example here is the `BothLibraries`
class.
2021-06-26 12:49:35 +02:00
Daniel Mensinger 3f889606c7 Split compiler detection from Environment
This moves all the compiler detection logic into the new
compilers.detect module. This dramatically reduces the size
and complexity of Environment.
2021-06-25 19:34:48 +02:00
Xavier Claessens 0bef89b0c2 interpreter: Empty list used to be allowed in install_headers/man
That change introduced when porting to @typed_pos_args breaks gtk4. We
could decide to deprecate/warn but should not error for backward
compatibility.
2021-06-23 10:15:00 -04:00
Jussi Pakkanen 6e0a0fd1da
Merge pull request #8884 from dcbaker/submit/type-and-annotate-install-functions
Add annotations for the various install_* functions
2021-06-23 01:00:59 +03:00
Jussi Pakkanen 0e5f88baf4
Merge pull request #8912 from mensinda/fixBothLibraries
Fix `BothLibraries` processing
2021-06-23 00:54:58 +03:00
Daniel Mensinger 0c4dd81c4d
fix: Handling BothLibraries objects (fixes #8907) 2021-06-22 21:09:19 +02:00
Jussi Pakkanen 39f25ec6aa
Merge pull request #8905 from mensinda/refactorFix
fix: Fix set_variable not holderifying (fixes #8904)
2021-06-22 21:26:38 +03:00
Dylan Baker d636b92c1a install_*: FileMode doesn't need to be None
There's no reason to allow None into the backend, it already has code to
check that all of the values of the FileMode object are None, so let's
use that, which is much simpler all the way down.
2021-06-22 09:13:41 -07:00
Dylan Baker 7213b7d81f interpreter: use typed_kwargs for install_man 2021-06-22 09:13:41 -07:00
Dylan Baker 7619f31f71 interpreter: man sections can be up to 9 on many platforms
Linux and FreeBSD use section 9 for kernel man pages, so we should allow
that.
2021-06-22 09:13:41 -07:00
Dylan Baker 9611bd8244 interpreter: use typed_pos_args for install_man 2021-06-22 09:13:41 -07:00
Dylan Baker f4d2efbed3 interpreter: use typed_kwargs for install_headers 2021-06-22 09:13:41 -07:00
Dylan Baker 251dff56fb interpreter: use typed_pos_args for install_headers 2021-06-22 09:13:41 -07:00
Dylan Baker ea3d85a1c0 interpreter: use typed_kwargs for install_data 2021-06-22 09:13:41 -07:00
Dylan Baker a551e76137 interpreter: use typed_pos_args for install_data 2021-06-22 09:13:41 -07:00
Dylan Baker 596c8d4af5 interpreter: use typed_kwargs for install_subdir 2021-06-22 09:12:54 -07:00
Dylan Baker 3d940fec98 interpreter: use typed_pos_args for install_subdir 2021-06-22 09:12:54 -07:00
Dylan Baker a024f432dd interpreter: add overload for source_strings_to_files
when only passing strings or Files we only get back Files. This is
useful for the install_* methods
2021-06-22 09:12:54 -07:00
Laurin-Luis Lehning d5ed8f61a5 interpreter: Move argument checks from add_*_arguments to compiler.get_supported_arguments 2021-06-21 09:15:13 +02:00
Laurin-Luis Lehning e44587fc73 interpreter: Consider the compiler language before checking arguments 2021-06-21 09:15:13 +02:00
Laurin-Luis Lehning c9ad98ef5e interprter: Add required kwarg to add_(project|global)_arguments
To avoid manual compiler support checks add_project_arguments and
add_global_arguments receive a new keyword argument to perform
them automatically.
2021-06-21 09:15:13 +02:00
Daniel Mensinger a73791b529
fix: Fix strange holder_map bug in combination with subprojects
I was unable to reproduce this in a minimal test-case, so there
is currently no new test :(
2021-06-20 00:26:06 +02:00
Daniel Mensinger f1ac7db2e6
fix: Fix set_variable not holderifying (fixes #8904) 2021-06-20 00:26:02 +02:00
Daniel Mensinger 7c757dff71 holders: Fix the remaining code to respect the holder changes 2021-06-18 23:48:33 +02:00
Daniel Mensinger 34c28dc92c holders: remove unholder 2021-06-18 23:48:33 +02:00
Daniel Mensinger 84a3e459a8 holders: Introduce BothLibraries 2021-06-18 23:48:33 +02:00
Daniel Mensinger c2c7f7c9d7 holders: Ensure that InterpreterBase is the sole instance for (un)holderifying 2021-06-18 23:48:33 +02:00
Daniel Mensinger 66b32a4591 holders: Introduce HoldableObject 2021-06-18 23:48:33 +02:00
Daniel Mensinger d601227cb2 interpreter: Add FileHolder and remove specical case for File 2021-06-18 23:48:33 +02:00
Daniel Mensinger 63ade7d937 interpreter: Add a new MesonInterpreterObject for non-elementary objects 2021-06-18 23:48:33 +02:00
Dylan Baker 3ec2cf9c60 interpreter: add type annotations to build_incdir_object
and use textwrap.dedent to make the very large messages more readable
and not break method folding.
2021-06-18 09:52:23 -07:00
Xavier Claessens b6d754a40c interpreter: Extract dependency() logic into its own helper class
The dependency lookup is a lot of complex code. This refactor it all
into a single file/class outside of interpreter main class. This new
design allows adding more fallbacks candidates in the future (e.g. using
cc.find_library()) but does not yet add any extra API.
2021-06-16 19:04:03 -04:00
Dylan Baker 35bdaada1d interpreter|build: Do Generator keyword argument checking in the interpreter
For qt we already have all of the necissary checking in place. Now in
the interpreter we have the same, the intrperter does all of the
checking, then passed the arguments to the Generator initializer, which
just assigns the passed values. This is nice, neat, and clean and fixes
the layering violatino between build and interpreter.
2021-06-15 12:48:53 -07:00
Dylan Baker 491c756dc9 interpreter: use typed_kwargs for func_generator
Do the type checking in a nice tidy way
2021-06-15 12:48:53 -07:00
Dylan Baker d2c1ab40a0 interpreter|build: Pass just the executable down to Generator
This requires that the interpreter has done the validation, which it now
does at all callsites. This simplifies the Generator initializer.
2021-06-15 12:48:53 -07:00
Dylan Baker 2ac9b32391 interpreter: Do not create Generator in GeneratorHolder
This is an odd pattern, not the way most Holders work, and would be
problematic if a method wanted to return a Generator.
2021-06-15 12:48:53 -07:00
Dylan Baker e2266e8708 interpreter: use typed_*args for test and benchmark
this also requires some changes to the Rust module, as it calls into the
test code.
2021-06-14 12:30:02 -07:00
Dylan Baker 86704261a7 interpreter: use typed_pos_args for func_test and func_benchmark
Requires a few small changes to the Rust module, as it calls `func_test`
2021-06-14 12:30:02 -07:00
Xavier Claessens 5a5ab79078 interpreter: Add missing FeatureNewKwarg for allow_fallback 2021-06-10 11:22:18 +02:00
Dylan Baker 98efec5c2b interpreter: make helper methods protected
They really aren't meant to be called outside of the interpreter itself,
so don't expose them as public
2021-06-08 11:00:55 +02:00
Dylan Baker bf656ce0ec interpreter: Add type annotations for the add_*_arguments helpers
internally these all used a set of shared heleprs, add type annotations
for those as well
2021-06-08 11:00:55 +02:00
Dylan Baker 3f9a81e7f1 interpreter: use typed_kwargs for the add_*_arguments family
This makes use of the new convertor and validator arguments, so that we
can check that the languages passed are in fact vaild, and then convert
the native boolean into a MachineChoice internally.
2021-06-08 11:00:55 +02:00
Dylan Baker 3e998527a3 interpreter: use typed_pos_args for add_*_args
This just replaces stringArgs with the typed_pos_args, and it's better
error message.
2021-06-08 11:00:55 +02:00
Dylan Baker b9f33c2380 Add C compiler when using Cython
Since cython transpiles to C.
2021-06-07 09:17:39 -07:00
Xavier Claessens 3340284805 modules: Stop using InterpreterObject
Custom objects returned by modules must be subclass of ModuleObject and
have the state argument in its methods.

Add MutableModuleObject base class for objects that needs to be deep
copied on assignation.
2021-05-28 15:17:10 -04:00
Xavier Claessens a9959a3859 Vala: Add missing FeatureNew() when C is missing
It was previously an hard error, only permitted since 0.59.0.
2021-05-28 10:20:08 -04:00
Dylan Baker 17eb224aa7 interpreter: Automatically add 'c' to languages when 'vala' is used
This is so dumb, we can just insert C for you without you having to know
that you're using C under the hood. This is nicer because:
1) Meson doesn't make the user add a language they're not explicitly
   using
2) If there was ever an implementaiton of Vala that didn't use C as
   it's assembly language, this wouldn't make any sense.
2021-05-19 23:28:17 +03:00
Dylan Baker 7bd7d1cd73 interpreter: Pass unholdered sources into BuildTarget
The build level shouldn't be deal with interpreter objects, by the time
they leave the intpreter they should be in the Meson middle layer
representaiton
2021-05-19 23:28:17 +03:00
Dylan Baker f2ae92368a interpreter: Add docstring and fix types of source_strings_to_files 2021-05-19 23:28:17 +03:00
Xavier Claessens aa700fe982 interpreter: Skip not_found_message and include_type in cache id 2021-05-08 21:31:55 +03:00
Xavier Claessens ed57646475 interpreter: 'embed' kwarg is only valid in python module 2021-05-08 21:31:55 +03:00
Dylan Baker d4e867809b store the list of initializes subprojects in the coredata structure
We need to konw on rconfigure which options have already bee set not
just for the super project, but also for the subproject. However, using
first_invocation is not sufficient, as a reconfigure could add a new
subpproject that wasn't present before, and we need to initialize that
project's builtins.
2021-04-26 17:05:44 +01:00
Xavier Claessens 3af39a463b Interpreter: Fallback when required is false but forcefallback is true 2021-04-26 17:04:57 +01:00
Jussi Pakkanen e80a13af73 Xcode: do not reuse objs in both_libraries because Xcode fails on targets with no sources. 2021-04-23 23:03:26 +03:00
Xavier Claessens b3a76fea64 interpreter: Add missing allow_fallback kwarg 2021-04-16 14:15:45 -07:00
Xavier Claessens 7ffe1b4a66 interpreter: Split permitted_kwargs dict 2021-04-12 21:30:00 +03:00
Xavier Claessens 558a7bc6ff interpreter: Move to its own folder and split it 2021-04-01 14:26:33 -04:00