aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
AgeCommit message (Collapse)AuthorFilesLines
2022-01-28gnome: genmarshal: If the source includes the header, depend on itDylan Baker1-15/+18
Otherwise we're racing between the header generation and the source generation.
2022-01-28build: replace kwargs in CustomTarget initializerDylan Baker12-464/+496
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!
2022-01-28interpreter: use find_program_impl instead of shutil.which for vcs_tagDylan Baker1-2/+1
This is the right thing to do, using which is wrong.
2022-01-28interpreter: remove dead code from custom_targetDylan Baker1-2/+0
This has been completely replaced by typed_kwargs now
2022-01-28interpreter: use typed_kwargs for vcs_tagDylan Baker2-24/+45
2022-01-27add location data to various Feature checksEli Schwartz3-20/+21
2022-01-27pkgconfig module: fix incorrect Feature logging for uninstalled_variablesEli Schwartz1-2/+2
The utility function that processes this for both 'variables' and 'uninstalled_variables' accepts a kwarg for the name of the argument, but then hardcodes 'variables' in the warning message. This is misleading.
2022-01-27do not report context on python traceback, for PermissionErrorEli Schwartz1-0/+5
It's not a MesonBug which needs to be reported, and the existing error already adequately points out the problematic file. It is impossible to get a PermissionError for files created by meson itself, once the build directory has been created, anyway.
2022-01-27modules/gnome: Allow gdbus_annotations to take an empty list againDylan Baker1-2/+3
This was allows up to 0.61.0 (including with the initial type annotations), but was accidentally broken by fixes for other bugs in 0.61.1. Fixes: #9883
2022-01-27remove incorrect deprecated feature for vcs_tagEli Schwartz2-2/+1
In commit 06481666f4e74ecef01e59351fc345ab0962d998 this warning got moved from build.py to the interpreter. Unfortunately it got added to the wrong function... it is supposed to be part of custom_target and even mentions this as the feature_name. Since then, build_always became a KwargInfo and has the deprecated-since attribute baked into it. But it didn't have the additional message which it really should have. Add that message at the same time we remove it from vcs_tag.
2022-01-27move the version info for build_always* directly into the kwarginfoEli Schwartz2-4/+9
Rather than pointlessly evolving it in the exactly one place which it is used. It's not clear what the purpose for this was.
2022-01-27mark regex string as raw string to fix invalid escapesEli Schwartz1-2/+2
2022-01-27flake8: fix indentation styleEli Schwartz8-37/+37
2022-01-27flake8: fix wonky comment styleEli Schwartz1-1/+1
2022-01-27fix some flake8 violations for unused importsEli Schwartz4-5/+4
And one undefined T.cast name in a file that isn't yet mypy-ready anyway.
2022-01-27Checkout subproject submodules even when nestedWill Toohey1-3/+8
2022-01-26Popen_safe and wrappers can accept os.PathLike for cwdEli Schwartz2-4/+4
Do not require users to convert it to a string first. This is a waste of time and effort for exactly the same results.
2022-01-26gnome: Fix gtk4 pkgconfig nameBilal Elmoussaoui1-1/+1
2022-01-26compilers/c_function_attributes: add retainArsen Arsenović1-0/+1
retain is a relatively young attribute which has proven itself useful for working with --gc-sections -z start-stop-gc.
2022-01-26mcompile: fix broken codepaths and restore orphaned codeEli Schwartz1-7/+5
In commit 928078982c8643bffd95a8da06a1b4494fe87e2b a good error message about the directory not being a valid build directory, was replaced by a worse message. In commit abaa980436f53100041bd5535589bb1c42019bd6 the error message was replaced by a traceback when trying to load the coredata before checking if it was a build directory. Revert back to using the helper function with the good error message. Reorganize code so that we check basic things first, and do less work before detecting errors. Fixes #9584
2022-01-24properly error out when project version is an array other than files()Eli Schwartz1-2/+2
Due to the support for specifying version as files('VERSION'), we need to internally accept an array, since that is what files() returns. Before that, we didn't accept arrays, and after that, we don't intend to accept generic arrays, only arrays as a side effect of files(). So tighten the typechecking to ensure that that is what we actually get.
2022-01-23interpreterobjects: Don't warn on set10(bool)Dylan Baker1-1/+4
Python inherited a really bad design from C, booleans happen to be ints. Which is awful, but it's true. Fixes: #9858
2022-01-22fix broken version annotations for the new itstool_join featureEli Schwartz1-1/+1
It was not added in 0.61.0 as that was already released.
2022-01-22Merge pull request #9742 from ximion/wip/itstoolJussi Pakkanen2-1/+162
i18n: Add support for joining XML localization via itstool
2022-01-21i18n: Add support for joining XML localization via itstoolMatthias Klumpp2-0/+161
2022-01-20python module: only find a pkg-config dependency from the found pythonEli Schwartz1-8/+21
If the found python returns None from sysconfig.get_config_var('LIBPC') then we cannot (and don't) set PKG_CONFIG_LIBDIR from it. In fact, we can virtually guarantee we won't find a PkgConfigDependency either, because any python that doesn't have a LIBPC is presumably not installed to the system pkg-config directory (maybe it's an isolated relocatable install, maybe it just doesn't have pkg-config support for who knows what reason). Trying to find one anyway using pkg-config's builtin search paths can unexpectedly succeed, though, by finding a completely unrelated python installation installed to a system location, which isn't the one we are actually building for. Instead, return early so that we use the system dependency class fallback. While we are at it, add back the debug messages from #3989 which got removed.
2022-01-18modules/gnome: make some methods staticDylan Baker1-13/+25
Since they don't use the instance or class state, they should be static methods.
2022-01-18modules/gnome: fix remaining typing errorsDylan Baker1-8/+13
Which is one incorrect type annotation, and a couple of instances of concatenating lists of unlike types. List being invariant is super annoying.
2022-01-18modules/gnome: fix annotation to type that isn't definedDylan Baker1-1/+1
2022-01-18modules/gnome: fix _get_build_args type annotationsDylan Baker1-1/+2
2022-01-18modules/gnome: fix _make_typelib_target typesDylan Baker1-3/+4
2022-01-18modules/gnome: Fix typing with _get_dependencies_flags andDylan Baker1-17/+25
_get_gir_target_deps The typing issues with these are tightly intertwined, so it didn't really make sense to solve them independently
2022-01-18build: Fix return types of a couple of methodsDylan Baker2-3/+3
These don't return `Target`, they return `BuildTarget | CustomTarget | CustomTargetIndex`
2022-01-18modules/gnome: fix issues with _make_gir_targetDylan Baker1-5/+13
2022-01-18modules/gnome: fix declared type of listDylan Baker1-1/+1
2022-01-18modules/gnome: use T.Sequence instead of T.ListDylan Baker1-2/+3
Which is pretty much necessary to make anything involving unions of lists work
2022-01-18modules/gnome: use itertools.chain instead of list concatenationDylan Baker1-1/+2
This is better as it avoids building unnecessary lists, and two fixes the typing issue from concatenating lists of different types.
2022-01-18dependencies: fix libraries and whole_libraries typesDylan Baker1-4/+5
gnome points out that CustomTargets can be linked with, so we should allow that.
2022-01-18modules/gnome: ignore the return type of _get_depDylan Baker1-2/+5
This is hard to fix, and it's really doing something bad anyway. But we know it's right, so just tell mypy to not worry about it.
2022-01-18modules/gnome: fix type annotations and issues with ↵Dylan Baker1-5/+9
_gather_typelib_includes_and_update_depends There is the problem of the annotations themselves, then there is the problem with depends being mutated. The mutation side effect is a problem in itself, but there's also the problem that we really want to use Sequence, which isn't mutable.
2022-01-18modules/gnome: define and annotate all instance variables in the initializerDylan Baker1-3/+5
2022-01-18build: Fix annotations to RunTarget and AliasTargetDylan Baker1-2/+2
RunTargets and AliasTargets may depend on RunTargets, so annotate them that way. The Gnome module relies on this internally.
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 Baker6-50/+55
This is much cleaner, and more in line with the way we handle interpreter objects in modern meson practice
2022-01-18build: move configuration_data initial value handling to build.ConfigurationDataDylan Baker1-9/+8
It really belongs here, not in the interpreter
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