aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-12-30fix incorrect docs for add_*_scriptEli Schwartz1-8/+23
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-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-30unpin pylint in CI -- the mentioned issue is long since fixedEli Schwartz1-2/+1
And the outdated pin means some error messages that are a lot better in newer versions aren't available.
2021-12-30cygwin: fix broken python versionsEli Schwartz1-0/+7
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-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-22unit tests: Don't check quoting with multiple libsNirbheek Chauhan2-2/+3
pkgconf has a bug on MSYS2 due to which prefixes with spaces are not handled correctly if the library has a Requires: on another library and both have prefixes with spaces in them. See: https://github.com/pkgconf/pkgconf/issues/238 So move the unit test to libanswer.pc instead of libfoo.pc till that is fixed.
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 Chauhan6-32/+50
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 Claessens4-9/+30
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 Schwartz2-2/+2
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.
2021-12-20gnome: use typed_kwargs for mkenums_simpleDylan Baker1-35/+52
the simple_version still goes through the big version of this function, but at last we have type checking
2021-12-20gnome: remove 'template' handling from mkenumsDylan Baker1-9/+1
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-17Fix mypy errorsDaniel Mensinger6-8/+17
2021-12-17add ft32 cpu familyRafael Silva2-0/+2
2021-12-16armclang: extend the prefix detection for Keil armclangBen Boeckel1-2/+2
This will avoid false positives with the ARM Ltd. `armclang` compiler.
2021-12-16armclang: clarify that this is support for the Keil cross-compilerBen Boeckel3-0/+11
2021-12-15mesonlib: make get_meson_command return an ImmutableListDylan Baker1-2/+2
We really don't want to be mutating global state, so let mypy yell at us when we try.
2021-12-15rewriter: create {add,rm}_extra_files commandsCeleste Wouters8-57/+518
Add ability to mutate a target's `extra_files` list through the rewriter. The logic is copied from sources add/rm, but changes the `extra_files` kwarg instead of the sources positional argument. Has additional logic to handle creating the `extra_files` list if it doesn't exist.
2021-12-12intl dep: forward static to iconv if neededChristoph Reiter1-1/+1
In 1fb6c939473ca7cdab2 the intl dep gained support for static linking which also forwarded this property to the iconv sub dependency. The refactoring in 214d03568f75 lost this change, which results in iconv getting linked dynamically again. Forward static again to fix this.
2021-12-12Merge pull request #9711 from dcbaker/submit/fix-gnome-typing-regressionsJussi Pakkanen1-13/+13
Fix regressions caused by typing changes
2021-12-11install: Don't run ldconfig on cross buildsDylan Baker2-6/+10
Even if we install without a DESTDIR set, we should never update ldconfig when cross compiling. Fixes #9707
2021-12-11Activate VS env when running `meson test`William Toohey1-1/+4
2021-12-09modules/gnome: fix genmarshall install_dir defaultDylan Baker1-1/+1
Which needs to be converted from None to an empty list
2021-12-09modules/gnome: Fix handling of flags to genmarshalDylan Baker1-11/+11
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-09modules/gnome: set genmarshal extra_args default to listDylan Baker1-1/+1
Which is what it should have been all along.
2021-12-09tests/rust polyglot: we need to link with bcrypt.lib as wellDylan Baker1-1/+1
2021-12-08docs: Add the `configuration` keyword argument to `configure_File`Dylan Baker1-0/+7
We were missing the most important keyword argument of them all!
2021-12-07custom_target: catch and reject input files that do not existEli Schwartz1-10/+14
Currently there is a try/except around the function that detects and rejects this, which instead of rejecting it, spawns a warning and continue. This warning exists because of 'test cases/vala/9 gir/' which passes a vala generated output that isn't a return value (!!!) using string joining with the meson.current_build_dir() function (also !!!) because we officially document this (!!! for a third time) as the only way to make a vala shared library generate a typelib with a custom_command from the automatically generated gir: https://mesonbuild.com/Vala.html#gobject-introspection-and-language-bindings In #3061 we converted strings to Files, but only if none of them were this vala hack. Due to the precise implementation, we also failed to convert strings to Files if any other error occurred, but since we only want to ignore errors for generated vala outputs, tighten that check and specifically call out generated files in the warning. Fixes #8635
2021-12-08clang-cl: add a translation pass for `-isystem` args to workSahnvour1-0/+14
2021-12-07modules/gnome: replace FeatureDeprecatedKwarg with typed_kwargDylan Baker1-3/+6
Using the deprected_message helper.
2021-12-07modules/gnome: use typed_kwargs for generate_vapiDylan Baker1-47/+52
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-07modules/gnome: use typed_kwargs for genmarshalDylan Baker1-43/+57
2021-12-07gnome/genmarshal: Add missing kwargs to permittedKwargsDylan Baker2-8/+13
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-07interpreter: use common DEPENDS_KWDylan Baker2-3/+3
2021-12-07interpreter: move more custom_target keyword arguments to the type_checking ↵Dylan Baker2-3/+8
module These are going to be used in the gnome module.
2021-12-06gnome module: deprecate passing false to install_dir_girEli Schwartz4-7/+21
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-06gnome module: document and fix install_dir x3, by allowing false *_gir and ↵Eli Schwartz4-11/+29
*_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-06decorators: fold some duplicated code into a closureDylan Baker1-26/+17
2021-12-06add message option to since_values and deprecated_valuesDylan Baker2-7/+24
This allows these two arguments to take a tuple of (version, message), where the message will be passed to Feature*'s message parameter
2021-12-06unittests/internal: use more subTestDylan Baker1-13/+11
2021-12-06Add deprecated_message and since_message to KwargInfoDylan Baker2-12/+23
For passing an extra message to Feature* This allows providing a more detailed message.
2021-12-06unittests/internal: use mock and subTestDylan Baker1-7/+9
This just makes things a little cleaner, and allows more accurate error reporting.