Commit Graph

19 Commits

Author SHA1 Message Date
Eli Schwartz bea735dd76
make sure files arguments to compiler.compiles and friends, performs rebuild
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-28 11:52:36 -05:00
Eli Schwartz 038b31e72b
various manual conversion of percent-formatted strings to f-strings 2021-11-01 20:26:18 -04:00
Christian Clauss a5020857f3 Fix typos discovered by codespell 2021-10-10 16:12:25 -04:00
Eli Schwartz d06cc042eb
f-strings 2021-10-04 16:29:32 -04:00
Eli Schwartz e8a85fa8a2
various python neatness cleanups
All changes were created by running

"pyupgrade --py3-only"

and committing the results. Although this has been performed in the
past, newer versions of pyupgrade can automatically catch more
opportunities, notably list comprehensions can use generators instead,
in the following cases:
- unpacking into function arguments as function(*generator)
- unpacking into assignments of the form x, y = generator
- as the argument to some builtin functions such as min/max/sorted

Also catch a few creeping cases of new code added using older styles.
2021-10-04 16:29:30 -04:00
Daniel Mensinger c10e228371
docs: Fixes found during the YAML conversion process 2021-10-03 11:51:37 +02:00
Paolo Bonzini 8596b3bcd1 interpreter: detect and pass compiler to be used for linker tests
Allow using the links method to test that the C++ driver (e.g. g++) can be used to
link C objects.  One usecase is that the C compiler's libsanitizer might not be
compatible with the one included by the C++ driver.

This is theoretically backwards-incompatible, but it should be treated as a
bugfix in my opinion. There is no way in Meson to compile a .c file with the
C++ driver as part of a build target, therefore there would be no reason to
do something like meson.get_compiler(meson.get_compiler('cpp').links(files('main.c')).

Fixes: #7703
2021-09-07 14:18:33 +02:00
Dylan Baker 11fbaf29d8 interpreter: fix cases of `KwargInfo(..., T, default=None)`
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-27 14:54:29 -07:00
Dylan Baker aa895b383c interpreter: Add a helper for checking constrained inputs
This is quite valuable for enum-like inputs, where only a certain set
of values is allowed.
2021-08-27 14:49:23 -07:00
Dylan Baker 272674e792 interpreter/compiler: make helper methods protected 2021-08-16 16:21:51 -07:00
Dylan Baker b30dddd4e5 interpreter/compiler: Add type checking for the Compiler object
This adds a full set of `typed_pos_args` and `typed_kwarg` decorations,
as well as fixing all of the typing errors reported by mypy.
2021-08-16 16:21:51 -07:00
Dylan Baker bcb5400e34 interpreter/compiler: Add type annotations to TryRunResultHolder 2021-08-16 16:21:51 -07:00
Dylan Baker 7dda90f1bf interpreter/compiler: remove unittest_args method
It's not documented, and it's been marked deprecated for who knows how
long.
2021-08-16 16:21:51 -07:00
Dylan Baker 32d3b5c9e2 interpreter/compiler: Replace permittedKwargs({}) with noKwargs
The former isn't really correct, as it wants a set and is getting a
dict, the other is also conceptually clearer I think.
2021-08-16 16:21:51 -07:00
Laurin-Luis Lehning 281f5abee3 interpreter: Replace manual kwarg validation in compiler.get_supported_arguments with @typed_kwargs 2021-06-22 07:59:08 +02: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
Daniel Mensinger 7c757dff71 holders: Fix the remaining code to respect the holder changes 2021-06-18 23:48:33 +02:00
Daniel Mensinger 202e345dfb interpreter: Refactor interpreter.compiler to use ObjectHolder 2021-06-18 23:48:33 +02:00
Xavier Claessens 558a7bc6ff interpreter: Move to its own folder and split it 2021-04-01 14:26:33 -04:00