Commit Graph

997 Commits

Author SHA1 Message Date
Eli Schwartz 81fbcd1df4
fix broken module tests which caused gtkdoc-check to traceback on assert
Regression in commit 566c2c9a9c.

The interpreter details are a bit of black magic. Functions expect
tuples, but they receive lists and then the type-checking decorators
convert those to tuples.

So, directly manhandling a self._interpreter.func_*() but passing it the
tuple it nominally expected, actually explodes in your face by way of
failing an assert, then dumping 'ERROR: Unhandled python exception'.

Fixes use of gnome.gtkdoc(..., check: true), for example when building
glib.
2022-01-10 23:06:51 -05:00
Michal Vasilek 9952446a2a gnome: fix typo in vapigen option metadatadir
This typo was introduced in 9ef36fa80b and
can cause a build failure, because --metadatdir is not a valid vapigen
option.
2022-01-10 15:30:53 -08:00
Eli Schwartz f67994476d remove the RPM module
It is unmaintained, broken (frequently for long periods of time) and not
really required for any meson functionality. Its purpose is to be used
as a one-shot tool for creating a distro package recipe, and then
deleted from your meson.build files.

Due to its fragile dependency on coredata implementation details, we
cannot assume it will reliably work, or continue to work, without
someone who is actively willing to take responsibility for it.

Even if that were to happen, this might be better off as an external
script that parses introspection data.

Closes #9764
Closes #9763
2022-01-10 20:21:40 +02:00
Pablo Correa Gómez 26c1869a14
modules/gnome: replace yelphelper with run and custom targets
This is basically a rewrite of the gnome.yelp target to remove the
ad-hoc script, which generates multiple issues, including meson
not knowing which files were installed.

Closes #7653
Closes #9539
Closes #6916
Closes #2775
Closes #7034
Closes #1052

Related #9105
Related #1601
2022-01-02 00:34:53 -05:00
Eli Schwartz 688b4bac76 add FeatureNew decorators for various modules that were lacking them
Going back to 0.38, though some of them are far older. The original
implementation of FeatureNew only added backdated feature checks that
far, anyway.
2021-12-31 12:03:57 +02:00
Xavier Claessens 95a4c6a62a pkgconfig: Fix linking to a custom target
When generating pkgconfig file for a library that links to an
uninstalled static library built by custom_target() Meson was crashing
when trying to access some attributes that does not exist on that class.

Also fix is_internal() implementation, it only really make sense on a
CustomTargetIndex or if CustomTarget has only a single output.
2021-12-22 08:04:08 +05:30
Eli Schwartz ee0baa97cd modules: use find_program implementation to find programs
Do not use ExternalProgram as that is too low-level and doesn't handle
e.g. machine file overrides.

Fixes #9733
2021-12-21 12:17:10 +01:00
Eli Schwartz 6be258137e
modules: let the proxy state find_program do silent lookups 2021-12-20 16:03:43 -05:00
Dylan Baker 3656b8c6d4 modules/gnome: use T.Sequence instead of T.List
because List is invariant, and that's not what we want.
2021-12-20 16:03:19 -05:00
Dylan Baker 1410d2e9c5 modules/gnome: use typed_kwargs for mkenum
This is the last function that doesn't use typed_kwargs. This now uses
the same shared path as the mkenums_simple
2021-12-20 16:03:19 -05:00
Dylan Baker 7e833d1484 modules/gnome: don't call through mkenums for mkenums_simple
It's just a bad idea, but especially once we start adding type
annotations to both of them.
2021-12-20 16:03:19 -05:00
Dylan Baker 4d8c91134c gnome: use typed_kwargs for mkenums_simple
the simple_version still goes through the big version of this function,
but at last we have type checking
2021-12-20 16:03:19 -05:00
Dylan Baker b2eb890da9 gnome: remove 'template' handling from mkenums
This has never been in permittedKwargs, it does nothing, and it was
never documented, so it seems pretty safe to just remove it.
2021-12-20 16:03:19 -05:00
Daniel Mensinger c5ce9744b2 Fix mypy errors 2021-12-17 14:00:28 -05:00
Dylan Baker 21c3ee3ee7 modules/gnome: fix genmarshall install_dir default
Which needs to be converted from None to an empty list
2021-12-09 13:00:42 -08:00
Dylan Baker e37fd94654 modules/gnome: Fix handling of flags to genmarshal
These are actually just flags, they don't take any arguments (except
prefix, which was already handled correctly), and as such their
arguments should be booleans, not strings, and they should default to
False.
2021-12-09 13:00:42 -08:00
Dylan Baker 29f6724f39 modules/gnome: set genmarshal extra_args default to list
Which is what it should have been all along.
2021-12-09 13:00:42 -08:00
Dylan Baker 824e09159b modules/gnome: replace FeatureDeprecatedKwarg with typed_kwarg
Using the deprected_message helper.
2021-12-07 16:12:23 -05:00
Dylan Baker 9ef36fa80b modules/gnome: use typed_kwargs for generate_vapi
There is a change here, in that packages has error messaging for using
IncludeDirs objects in the packages argument, but it never worked, so
the message was useless.
2021-12-07 16:12:23 -05:00
Dylan Baker 4ed0df4c31 modules/gnome: use typed_kwargs for genmarshal 2021-12-07 16:12:23 -05:00
Dylan Baker 2a1c0358f4 gnome/genmarshal: Add missing kwargs to permittedKwargs
There are thee arguments that are passed directly to CustomTarget which
are not in the permittedKwargs: depends, depend_files, and build_always.
The first two are obviously generically useful, as they allow creating
correct ordering. The latter, not so much. Since it was an error to pass
it, we'll just delete it.
2021-12-07 16:12:23 -05:00
Eli Schwartz bc8c938148
gnome module: deprecate passing false to install_dir_gir
Use a proper install option for this. Now `install_<type>` can directly
override `install` instead of passing a boolean to the string kwarg
`install_dir_<type>`.
2021-12-06 20:59:45 -05:00
Eli Schwartz bed55a902c
gnome module: document and fix install_dir x3, by allowing false *_gir and *_typelib
generate_gir forces building both the typelib and gir, and some people
only want one or the other (probably only the typelib?) which means
flagging the other as install_dir: false in the same way custom_target
supports.

As this always worked, albeit undocumented, make sure it keeps working.
It's pretty reasonable to allow, anyway.

Fixes https://github.com/mesonbuild/meson/pull/9484#issuecomment-980131791
2021-12-06 20:07:43 -05:00
Dylan Baker 4f0c5af390 modules/qt: compeil_resources allow name to be unset
Originally name should have been set to required=True, but since then
the requirement to name CustomTargets (which compile_resources is a
wrapper around) has been dropped. As such we just need to allow the
default value of None through.

Fixes: #9698
2021-12-05 08:33:32 -08:00
Alexander Kanavin c88bfdbefc gtkdoc: add support for a binary wrapper
Make it possible to specify a wrapper for executing binaries
in cross-compiling scenarios.
(usually, some kind of target hardware emulator, such as qemu)
2021-12-02 19:33:45 -05:00
Eli Schwartz 172fa4d3b2
i18n module: correctly annotate the availability of data_dirs
It was originally forgotten in merge_file() and later added for parity
with gettext(). This means that the FeatureNew for each function is
different.
2021-12-02 12:29:58 -05:00
Dylan Baker 904771c4e1 modules/keyval: add type annotations
And use typed_pos_args
2021-11-23 13:20:11 -08:00
Dylan Baker 717d03af1c modules/keyval: cleanup imports 2021-11-23 13:15:28 -08:00
Pablo Correa Gómez 905a361ca0 modules/gnome: import missing FeatureDeprecated for generate_gir
Commit dbb109703e broke generate_gir
by using FeatureDeprecated without importing it.
2021-11-23 10:20:58 -08:00
Paolo Bonzini 47ba919b21 rust: clean up inputs and outputs to bindgen
Make the handling of bindgen inputs consistent with the inputs and outputs of
source_strings_to_files.

However, for the first source argument reject anything that cannot
possibly be an header file.  This also fixes a mypy failure from the next
patch, since ExtractedObjects does not have a zero-argument get_outputs
method.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-11-23 18:10:15 +05:30
Eli Schwartz 5163a02fec
qt module: fix stupid copy-paste error
As evidenced by the warning message immediately below this, I meant to
write "5.15" here. As is, this will enable depfile support on too-old
versions of moc.
2021-11-22 16:28:13 -05:00
Chris Lamb 958b1a7fb4 Make the generated reproducible .cmake files reproducible.
Whilst working on the Reproducible Builds effort [0], I noticed that meson did
not generate reproducible .cmake files: they include the full path name.

This commit not only makes the build reproducible, but it also matches CMake's
own behaviour. Specifically, CMakePackageConfigHelpers.cmake does the
equivalent transformation using:

    get_filename_component(inputFileName "${_inputFile}" NAME)

I originally filed this in Debian as bug #1000327 [1].

 [0] https://reproducible-builds.org/
 [1] https://bugs.debian.org/1000327
2021-11-21 14:38:33 -05:00
Eli Schwartz 32821be623
add location nodes to some Feature calls 2021-11-20 20:48:30 -05:00
Eli Schwartz dbb109703e
convert more mlog.deprecation into FeatureDeprecated 2021-11-20 20:48:29 -05:00
Eli Schwartz 4a65f3dead
fix missing subproject kwarg to FeatureDeprecated
We went straight to the extra message, which when parsed as a subproject
string resulted in the Feature being entirely skipped because "project()
has not been parsed yet" as it could not find a subproject named that.
2021-11-20 20:48:29 -05:00
Xavier Claessens 018d928cf5 i18n: Fix backtrace when missing input kwarg
When input kwarg is missing in i18n.merge_file() it was crashing with a
backtrace because of kwargs['input'][0]. That code was useless anyway
because CustomTarget now uses first output as default name which is what
we need here.
2021-11-16 23:35:46 -05:00
Dylan Baker 40a8a3f8fe modules/gnome: fix warning message that will always fire
`typed_pos_args` ensures that the length of args is always true.
2021-11-16 01:20:03 +02:00
Dylan Baker aaac5538bf modules/gnome: Add back deprecation message
This looks like it was probably removed in a bad rebase
2021-11-16 01:20:03 +02:00
Matthew Brett bd5e520672 Fix to find Python files for Windows virtualenvs
Virtualenvs do not have their Python DLLs etc in the `sys.prefix`
directory, but in the `sys.base_prefix` directory.  This directory is
the same as `sys.prefix` if not in a virtualenv, so is safe for either
case:

https://docs.python.org/3/library/sys.html#sys.base_prefix
2021-11-15 23:20:48 +02:00
Jussi Pakkanen cad109607d
Merge pull request #9520 from dcbaker/submit/gnome-first-typed-kwargs
Add typed_kwargs to some of the gnome module functions
2021-11-15 22:07:03 +02:00
Eli Schwartz 0bc0905210
qt module: add depfile support to moc as well
We currently enable this only for rcc (where this really really matters)
but it can often matter for moc as well, and is just generally more
correct.

Really, this should have been added in #7451 too, but I neglected it
since the module warned about inaccurate dependencies only for rcc...
2021-11-13 23:28:59 -05:00
Xavier Claessens 898bf6e518 python: Better detect when install path is not in sys.path
Using pathlib ensure propre platform specific path handling, such as
case sensitivity.
2021-11-09 18:49:03 +02:00
Dylan Baker ef52e60936 modules/gnome: use typed_kwargs for gdbus_codegen 2021-11-08 12:39:38 -08:00
Dylan Baker 566c2c9a9c modules/gnome: use typed_kwargs for gtkdoc method 2021-11-08 12:29:01 -08:00
Dylan Baker be1d013453 modules/gnome: use typed_kwargs for generate_gir
This removes the `packages` keyword argument, which was added in
80d665e8de, but beyond not warning about
unknown arguments has never done anything, and has never been
documented. The only users I could find were in our own test suite. If
someone is using this we can add it back with a deprecation warning.
2021-11-08 12:29:01 -08:00
Dylan Baker 6137c21eb6 modules/gnome: use typed_kwargs for compile_resources 2021-11-08 12:29:01 -08:00
Dylan Baker fa2affe47c modules/gnome: use typed_kwargs for yelp 2021-11-08 12:29:01 -08:00
Dylan Baker 3894f80e21 modules/gnome: use typed_kwargs for compile_schemas 2021-11-08 12:29:01 -08:00
Xavier Claessens c8d125653d
python.dependency(): Do not stop when first candidate is not found
It has to lookup the dependency with required=False otherwise it raises
an exception when the first candidate (pkg-config) failed.
2021-11-02 14:24:08 -04:00
Eli Schwartz 038b31e72b
various manual conversion of percent-formatted strings to f-strings 2021-11-01 20:26:18 -04:00