Commit Graph

12067 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
Dylan Baker fe51450970 depfile: type annotate 2022-01-10 23:06:20 -05:00
Eli Schwartz 4b351aef26
first pass at migrating to dataclasses
In some cases, init variables that accept None as a sentinel and
immediately overwrite with [], are migrated to dataclass field
factories. \o/

Note: dataclasses by default cannot provide eq methods, as they then
become unhashable. In the future we may wish to opt into declaring them
frozen, instead/additionally.
2022-01-10 18:36:57 -05:00
Eli Schwartz 98a41ec24e
manually clean up some python 3.6 era code 2022-01-10 18:36:57 -05:00
Eli Schwartz 140097faf0
port from embedded data to importlib.resources 2022-01-10 18:36:57 -05:00
Eli Schwartz be6e09bfdb
condense lines 2022-01-10 18:36:57 -05:00
Eli Schwartz 751f84405e
pyupgrade --py37-plus 2022-01-10 18:36:56 -05:00
Eli Schwartz ad525dcce4
bump minimum required version of python to 3.7
Comment out the pending deprecation notice. It cannot be reached
anymore, but is still useful for the next time we do a version bump.
2022-01-10 18:36:56 -05:00
Eli Schwartz 0c30db20b1
update ubuntu bionic to use python 3.7
The pip package is for python 3.6, but installs pip for all versions of
python. Apparently. Including python 3.7.

So do all other packages, especially the ones where it doesn't work but
pip thinks it is installed anyway. Force a reinstall.
2022-01-10 18:36:56 -05:00
Eli Schwartz 6f8008cd7d
clean up even more function signatures in preparation for dataclasses
Names used in init functions are sometimes pointlessly different from
the class instance attributes they are immediately assigned to. They
would make more sense if defined properly.
2022-01-10 18:36:56 -05:00
Dylan Baker e77582b251 docs: fix rust module bindgen arguments
Fixes: 9795
2022-01-10 15:34:03 -08: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
Dylan Baker 1209b8820b compilers: push the compiler id to a class variable
It really is a per class value, and shouldn't be set per instance. It
also allows us to get rid of useless constructors, including those
breaking mypy
2022-01-10 15:53:26 -05: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
Jussi Pakkanen 251d6f0f5d
Merge pull request #9739 from mathstuf/armclang-support
Armclang support
2022-01-10 19:01:11 +02:00
Jussi Pakkanen 3ab08265c0 Bump version number for new development. 2022-01-10 19:00:28 +02:00
Jussi Pakkanen 9e1f20728f Prepare release 0.61.0. 2022-01-10 18:27:11 +02:00
Eli Schwartz 09f03a8424 add pending deprecation notice for python 3.6 2022-01-10 01:36:46 +02:00
Jussi Pakkanen 43c6860a3a Use VS 2022 release version for packaging. 2022-01-09 21:48:06 +02:00
x-yuri 84ac1b6fbb Running-Meson.md: fix a broken link 2022-01-10 00:45:13 +05:30
Jussi Pakkanen a311364f54 Remove docs for ghwt that got deleted ages ago. 2022-01-09 11:14:21 -05:00
Itoh Shimon a22d0f9a0a Fix typo. 2022-01-07 09:25:16 -08:00
Jussi Pakkanen 8b54ee58ef
Merge pull request #9773 from annacrombie/master
Add a man page backend to refman
2022-01-07 18:55:07 +02:00
Stone Tickle 2c4a98f851
add release notes for refman man page 2022-01-06 20:14:34 -06:00
Stone Tickle 71ea9e3d4c
add man page generation to build 2022-01-06 20:14:34 -06:00
Stone Tickle ac468a1394
add man page backend to refman 2022-01-06 20:14:29 -06:00
John Kilpatrick 484a389bbe Fix syntax highlighting Continuous-Integration.md 2022-01-05 18:59:04 -05:00
Stone Tickle 95057340b3
cleanup _extract_meson_version() 2022-01-05 11:32:03 -06:00
Ben Boeckel f30e83efd6 armltdclang: add support for ARM Ltd.'s `armclang` toolchain
This is another toolchain also called `armclang`, but it is not a cross
compiler like Keil's `armclang`. It is essentially the same as `clang`
based on its interface and CMake's support of the toolchain.

Use an `armltd` prefix for the compiler ID.

Fixes: #7255
2022-01-03 12:49:04 -05:00
Jussi Pakkanen 09f52a3817 Bump version numbers for rc1. 2022-01-02 22:22:31 +02:00
Jussi Pakkanen c8733f65b3
Merge pull request #9757 from eli-schwartz/broken-types
Fix some broken type annotations
2022-01-02 21:48:28 +02:00
Jussi Pakkanen 117ba23071 Condense test directory numbers for rc1. 2022-01-02 19:07:36 +02:00
Jussi Pakkanen 4101ca6eaa Fix files in the unittests subdir. 2022-01-02 19:07:36 +02:00
Pablo Correa Gómez 6a5c99b0c7
docs: Update yelp documentation to reflect what it is actually doing 2022-01-02 00:34:58 -05: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
Pablo Correa Gómez 270843ed34
test cases/frameworks/13 yelp: Do not reuse sources files
Additionally reorder test.json for better readability
2022-01-02 00:34:49 -05:00
Jussi Pakkanen cf3a23dcce
Merge pull request #9758 from eli-schwartz/meson_add_foo_script-argchecks
add_*_script: fix validation and do FeatureNew checks
2021-12-31 15:58:30 +02: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
Eli Schwartz 9f8df3529f rename lint workflow for less confusion
For a long time now, this has done 3 different things, only one of which
is mypy. But they are labeled:

- LintMypy / lint

  (runs pylint)

- LintMypy / custom_lint

  (runs a custom script)

- LintMypy / mypy

  (actually runs mypy)

This reduces the usable length of the label which isn't all that long to
begin with, is actively misleading, and even when you know what is going
on, it becomes harder to tell at a glance what failed. Change it to be
more unambiguous.
2021-12-31 12:01:34 +02:00
Eli Schwartz 812ad2e6d1
fix type annotations for mlog nesting
In commit 8cd4d0b283 we added a feature
that took True/False but said it took str.
2021-12-30 15:15:25 -05:00
Eli Schwartz 9f384e9207
fix type annotations for compiler toolchain rpaths
We pass around a tuple of rpaths, because rpaths *can* be more than one.
But all the annotations said it would be a str instead.
2021-12-30 15:15:25 -05:00
Eli Schwartz 19c9f32cef
correct type annotations for File.endswith
It should accept whatever str.endswith accepts, which means optionally a
tuple of options.
2021-12-30 15:15:25 -05:00
Eli Schwartz db528e3bb9
fix crash during MesonException
In commit e5a6283c4c, this function was
reorganized to assign value -> newvalue instead of overwriting newvalue,
but the error message case wasn't updated to match. As a result,
actually hitting the error would report an even more errory error, i.e.
a traceback.

(Actually hitting the error requires passing an array option as a python
object that isn't a list or a string. This is impossible to do from the
command line or meson_options.txt, but can be done with builtin options.)
2021-12-30 15:15:25 -05:00
Eli Schwartz d46ac459e9
fix incorrect docs for add_*_script
They claimed that all of these functions accepted any posargs or varargs
that install scripts supported. This was inconsistent with both the
types that meson currently allowed, and the types that we documented in
refman 1.0 *should* be allowed.

Take the opportuninty to be clear as refman 1.0 never was, about the
difference between types supported in the first posarg, and the ypes
supported in succeeding varargs.
2021-12-30 15:14:18 -05:00
Eli Schwartz cb6a6dbca4
remove no longer needed validation routine
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-30 15:14:18 -05:00
Eli Schwartz 6e25548d06
add_*_script: fix incorrect typed_pos_args allowing built targets
In commit c239ce31f5 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
6c5bfd4c24 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-30 15:14:18 -05:00
Eli Schwartz f6eaf55906
add_*_script: fix missing FeatureNew for non-string arguments
In commit 2c0eaf5c4f support was added for
install scripts to accept found programs, built executables, or custom targets.

In commit c239ce31f5, 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 f808c955ea.

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-12-30 15:14:17 -05:00
Eli Schwartz 1708148f51
unpin pylint in CI -- the mentioned issue is long since fixed
And the outdated pin means some error messages that are a lot better in
newer versions aren't available.
2021-12-30 14:28:45 -05:00
Eli Schwartz 3304a38496
cygwin: fix broken python versions
multiple versions of python are packaged by cygwin, and the default
python is auto-selected as the latest one via a Debian-like alternatives
system.

This recently broke because dblatex is built against 3.9, causing it to
be installed too and resulting in multiple (inconsistent) versions of
python being installed, and `python3` pointing to the one we don't have
devel packages for and isn't even the default version.

Fix this by pointing back to the intended python.
2021-12-30 00:54:14 -05:00
Tristan Partin 269337ceb2 Fix mypy 0.930 issues
Removed errant "type: ignore".

Fixed issue with "fetch" call. This issue was the following:

Dict::get() and Dict::pop() have the following signature:

T.Callable[[_T, _U], _U | None] OR T.Callable[[_T], _U | None]

Note how the return type is _U here. When the fetch() function was
actually being called, it had the following signature:

T.Callable[[_T, T.List[_U]], T.Union[T.List[_U], _U]]

This is incompatible with the previous definitions. The solution is
simply to move where the default value is introduced if fetch() produces
None.
2021-12-30 00:53:58 -05:00