aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
AgeCommit message (Collapse)AuthorFilesLines
2022-01-16install: Setup VS env if we did that during setupNirbheek Chauhan1-1/+4
Otherwise we might not find a ninja that was picked up from the Visual Studio installation. ``` $ meson setup _build ... Activating VS 15.9.40 ... Found ninja-1.8.2 at "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja\ninja.EXE" $ meson compile -C _build Activating VS 15.9.40 ... $ meson install -C _build Can't find ninja, can't rebuild test. ``` Fixes https://github.com/mesonbuild/meson/issues/9774
2022-01-15gnome.genmarshal: restore the ability to pass sources as Files objectsEli Schwartz1-2/+2
It used to support: - a single string - an array of anything And as long as CustomTarget supported it too, everything worked fine. So, a `files('foo')` worked but a `files('foo')[0]` did not, which is silly... and it's not exactly terrible to use files() here, the input is literally a list of source files. Fixes building gnome-terminal Fixes #9827 Test updated by Nirbheek Chauhan <nirbheek@centricular.com>
2022-01-15Fix system include arguments for clang-clGatgat1-0/+4
2022-01-12gome.gdbus_codegen: fix annotations argument for multiple annotations, harderEli Schwartz1-6/+27
The original attempted fix only allowed configuration to succeed, but not building. It was modeled based on the gdbus-codegen documentation, which states: --annotate WHAT KEY VALUE WHAT KEY VALUE WHAT KEY VALUE Add annotation (may be used several times) which clearly indicates that gdbus-codegen accepts an --annotate flag that is followed by a multiple of 3 values, despite this not actually working. The manpage actually contradicts the --help text: --annotate ELEMENT KEY VALUE Used to inject D-Bus annotations into the given XML files. [] ... and gives examples that use multiple --annotate flags each with 3 arguments. To better understand what meson is supposed to do here, we should look at ef52e60936665c982cd17a4a17c2045b445d8e6d, which ported to typed_kwargs. There is actually a big chunk of code to handle annotations that got completely dropped, leading with a comment (that did not get dropped): "they are a list of lists of strings..." Reimplement this logic inside a validator/converter for the annotations kwarg container: - do not listify, we don't accept `annotations: ''` and listify is supposed to be for when either x or list[x] is valid - go back to checking for a list of exactly 3 values - allow a list of the aforementioned, in the traditionally expected form: [ ['foo1', 'foo2', 'foo3'], ['bar1', 'bar2', 'bar3'], ] - pass one --annotate flag per 3-value-list And add some better error reporting for the cause of errors when processing lists of lists.
2022-01-13Search for Visual Studio Express when activating VS envDFOVIT1-0/+4
Visual Studio Express does not come with the 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64' workload. This adds a check for the 'Microsoft.VisualStudio.Workload.WDExpress' workload. Non-express versions take precedence over express versions when activating.
2022-01-12subproject: fix version validation on lookupØyvind Aarrestad Aakre1-0/+5
Fixes a bug where the subproject version was not validated when the subproject had already been processed. The bug would cause inconsistent build results if the subproject was referenced more than once (diamond) with conflicting version requirements.
2022-01-12ninja backend: Fix custom_target() console: kwarg when using envDeclan Qian1-1/+2
When a custom_target() uses an env, meson uses a wrapper script to run the executable. This breaks the console: kwarg because the wrapper script buffers the output. Fix it by setting the verbose flag which will not buffer output.
2022-01-11fix typo in error messageEli Schwartz1-1/+1
2022-01-11gnome.gdbus_codegen: allow File objects as XML fileEli Schwartz1-2/+2
As soon as we check for args[1] we declare it is of type FileOrString, and the additional ones specified in the `sources` kwarg explicitly allow this. It makes no sense to not accept it as the posarg too. Fixes building tracker-miners.
2022-01-11gnome.gtkdoc: fix passing file arguments as a configured fileEli Schwartz1-6/+6
Fixes gtk3 build, which uses typesfile. All these arguments are processed by a function that explicitly handles both str and File, and converts them to absolute paths. They clearly need to handle File objects.
2022-01-11gome.gdbus_codegen: fix annotations argument for multiple annotationsEli Schwartz1-1/+1
Per the gdbus-codegen documentation, this "may be used several times", and it is: - a valid use case - used that way in the wild Fixes building at least geoclue2, gdm.
2022-01-10fix broken module tests which caused gtkdoc-check to traceback on assertEli Schwartz1-1/+4
Regression in commit 566c2c9a9c98d13f85ccef624e9ac584f64c6a4a. 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-10depfile: type annotateDylan Baker1-15/+20
2022-01-10first pass at migrating to dataclassesEli Schwartz7-281/+259
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-10manually clean up some python 3.6 era codeEli Schwartz1-7/+3
2022-01-10port from embedded data to importlib.resourcesEli Schwartz5-368/+21
2022-01-10pyupgrade --py37-plusEli Schwartz1-1/+1
2022-01-10bump minimum required version of python to 3.7Eli Schwartz1-2/+5
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-10clean up even more function signatures in preparation for dataclassesEli Schwartz1-2/+2
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-10gnome: fix typo in vapigen option metadatadirMichal Vasilek1-1/+1
This typo was introduced in 9ef36fa80bf4483bcd837ea3985a51ab533c7972 and can cause a build failure, because --metadatdir is not a valid vapigen option.
2022-01-10compilers: push the compiler id to a class variableDylan Baker21-74/+79
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-10remove the RPM moduleEli Schwartz1-186/+0
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-10Merge pull request #9739 from mathstuf/armclang-supportJussi Pakkanen6-3/+61
Armclang support
2022-01-10Bump version number for new development.Jussi Pakkanen1-1/+1
2022-01-10Prepare release 0.61.0.0.61.0Jussi Pakkanen1-1/+1
2022-01-10add pending deprecation notice for python 3.6Eli Schwartz1-0/+11
2022-01-03armltdclang: add support for ARM Ltd.'s `armclang` toolchainBen Boeckel4-1/+48
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-02Bump version numbers for rc1.0.61.0rc1Jussi Pakkanen1-1/+4
2022-01-02Merge pull request #9757 from eli-schwartz/broken-typesJussi Pakkanen8-19/+19
Fix some broken type annotations
2022-01-02modules/gnome: replace yelphelper with run and custom targetsPablo Correa Gómez2-171/+91
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
2021-12-31Merge pull request #9758 from eli-schwartz/meson_add_foo_script-argchecksJussi Pakkanen1-26/+20
add_*_script: fix validation and do FeatureNew checks
2021-12-31add FeatureNew decorators for various modules that were lacking themEli Schwartz5-1/+8
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-30fix type annotations for mlog nestingEli Schwartz1-1/+1
In commit 8cd4d0b2832666f19660b9006040e5ff7e5d4576 we added a feature that took True/False but said it took str.
2021-12-30fix type annotations for compiler toolchain rpathsEli Schwartz5-16/+16
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-30correct type annotations for File.endswithEli Schwartz1-1/+1
It should accept whatever str.endswith accepts, which means optionally a tuple of options.
2021-12-30fix crash during MesonExceptionEli Schwartz1-1/+1
In commit e5a6283c4cf288fdfc9b43a92bf0ddd74dbf90f8, 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-30remove no longer needed validation routineEli Schwartz1-6/+4
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-30add_*_script: fix incorrect typed_pos_args allowing built targetsEli Schwartz1-8/+8
In commit c239ce31f55579cfe1e29b769a8bda97deca2166 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 6c5bfd4c241e94f5e0f4dea9ba7fb5d5090a4802 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-30add_*_script: fix missing FeatureNew for non-string argumentsEli Schwartz1-14/+10
In commit 2c0eaf5c4f4493146355eeb8521c17a3c2ef5acd support was added for install scripts to accept found programs, built executables, or custom targets. In commit c239ce31f55579cfe1e29b769a8bda97deca2166, 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 f808c955eab983b31feee130f0947c7cb254a94f. 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-30Fix mypy 0.930 issuesTristan Partin2-3/+3
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-22Don't wipe out RPATHs specified by dependenciesNirbheek Chauhan2-1/+11
Since we scan all dependencies for build-only RPATHs now (which are removed on install), we must take care not to add build-only RPATHs pointing to directories that dependencies explicitly add -Wl,-rpath link args for, otherwise the paths will get wiped on install. Caught by LinuxlikeTests::test_usage_pkgconfig_prefixes
2021-12-22Set RPATH for all non-system libs with absolute pathsNirbheek Chauhan1-28/+27
If a pkg-config dependency has multiple libraries in it, which is the most common case when it has a Requires: directive, or when it has multiple -l args in Libs: (rare), then we don't add -Wl,-rpath directives to it when linking. The existing test wasn't catching it because it was linking to a pkgconfig file with a single library in it. Update the test to demonstrate this. This function was originally added for shared libraries in the source directory, which explains the name: https://github.com/mesonbuild/meson/pull/2397 However, since now it is also used for linking to *all* non-system shared libraries that we link to with absolute paths: https://github.com/mesonbuild/meson/pull/3092 But that PR is incomplete / wrong, because only adding RPATHs for dependencies that specify a single library, which is simply inconsistent. Things will work for some dependencies and not work for others, with no logical reason for it. We should add RPATHs for *all* libraries. There are no special length limits for RPATHs that I can find. For ELF, DT_RPATH or DT_RUNPATH are used, which are just stored in a string table (DT_STRTAB). The maximum length is only a problem when editing pre-existing tags. For Mach-O, each RPATH is stored in a separate LC_RPATH entry so there are no length issues there either. Fixes https://github.com/mesonbuild/meson/issues/9543 Fixes https://github.com/mesonbuild/meson/issues/4372
2021-12-22pkgconfig: Fix linking to a custom targetXavier Claessens2-9/+13
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-21modules: use find_program implementation to find programsEli Schwartz2-10/+8
Do not use ExternalProgram as that is too low-level and doesn't handle e.g. machine file overrides. Fixes #9733
2021-12-20modules: let the proxy state find_program do silent lookupsEli Schwartz1-2/+2
2021-12-20restore additional info about the potential cause of find_program failingEli Schwartz1-1/+1
Before commit f08eed37cb69ba0d793c0f1d086eaef7f25c2ea3 we also mentioned that it might not be executable.
2021-12-20restore the ability in the backend to silently find a programEli Schwartz1-2/+4
Broken in commit f08eed37cb69ba0d793c0f1d086eaef7f25c2ea3 which moved the reporting and unconditionally added it.
2021-12-20modules/gnome: use T.Sequence instead of T.ListDylan Baker1-3/+3
because List is invariant, and that's not what we want.
2021-12-20modules/gnome: use typed_kwargs for mkenumDylan Baker1-94/+65
This is the last function that doesn't use typed_kwargs. This now uses the same shared path as the mkenums_simple
2021-12-20modules/gnome: don't call through mkenums for mkenums_simpleDylan Baker1-33/+60
It's just a bad idea, but especially once we start adding type annotations to both of them.