aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
AgeCommit message (Collapse)AuthorFilesLines
2022-03-29Replace backend.get_option_for_target() with target.get_option()Xavier Claessens5-67/+57
That method had nothing specific to the backend, it's purely a Target method. This allows to cache the OptionOverrideProxy object on the Target instance instead of creating a new one for each option lookup.
2022-03-29Pass environment down to base Target classXavier Claessens11-18/+60
2022-03-29Fix CMake deprecation warning generated from interpreterTristan Partin1-1/+1
2022-03-29gnome: Fix gtkdoc when using multiple Apple frameworksJan Tojnar1-30/+48
The `-framework Foundation -framework CoreFoundation` ended up de-duplicated by OrderedSet into `-framework Foundation CoreFoundation`.
2022-03-29gnome: Fix typo in _get_dependencies_flagsJan Tojnar1-1/+1
This was introduced in https://github.com/mesonbuild/meson/commit/823da3990947a8f4a2152826f0d7229f8a7a0159
2022-03-29runpython: support --versionEli Schwartz1-2/+6
argparse is the gift that keeps on giving, hahaha. Suppress the script argument when --version is specified to avoid "required argument not provided" errors, and print the python version. The version argument is required in order to make this baseline functional as a resolved python for find_program, which may specify a version and expect this to work with python itself. Our incomplete CLI wrapper over the python CLI interface was missing this. Fixes #10162
2022-03-28fix regression in propagating depends in gtkdocEli Schwartz1-6/+11
In commit 68e684d51f1e469e0d9f4b499ffda15146cad98a the function signature was changed, but several places did not adapt. Additionally, we now totally dropped the in-place update of gtkdoc's sole source of dependencies, but didn't propagate them upward to assign the newly collected dependencies anywhere. Fixes building gtkdoc with internal dependencies and failing when specified directly (when building the 'all' target with sufficiently random parallelism, deps may be built on time). Fixes: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1008382 https://gitlab.gnome.org/GNOME/libmediaart/-/issues/4
2022-03-27wrap: implement allow-insecure for 'meson wrap'Eli Schwartz2-16/+29
2022-03-27wrap: use shared function to connect to wrapdb with better errorsEli Schwartz1-5/+4
We currently inconsistently handle connection, `has_ssl`, and printing errors on urlopen failure between `meson subprojects` and `meson wrap`. Make the latter work more like the former.
2022-03-27wrap: add functionality to specify whether insecure downloads should be usedEli Schwartz2-10/+30
We have a fallback route in `meson subprojects download` and friends, which tries to retrieve wrapdb urls via http, if Python was not built with SSL support. Stop doing this. Replace it with a command line option to specify that insecure downloads are wanted, and reference it in the error message if downloading fails due to SSL issues.
2022-03-24install_symlink: Handle $DESTDIR case for links with absolute pathMarco Trevisan (Treviño)1-2/+4
In case a link is pointing_to an absolute path and we are using $DESTDIR we fail in case the target is missing. This is incorrect because we may need to use an absolute path to an already installed file that is in $DESTDIR. So if an absolute target is not existing, check if we have such file in $DESTDIR before failing for real.
2022-03-24build.py: Simplify uses_rust()Xavier Claessens1-19/+1
There is no need to check all source files again, if there are .rs sources then rust compiler is in self.compilers already.
2022-03-24build.py: Simplify validate_sources()Xavier Claessens1-15/+3
There is no need to go through all sources again, we already did that to populate self.compilers. When cs or java compilers are in the list, then there must be only one compiler. The code was also not considering generate sources any way.
2022-03-24Make compilers list per subprojectXavier Claessens4-123/+123
Previously subprojects inherited languages already added by main project, or any previous subproject. This change to have a list of compilers per interpreters, which means that if a subproject does not add 'c' language it won't be able to compile .c files any more, even if main project added the 'c' language. This delays processing list of compilers until the interpreter adds the BuildTarget into its list of targets. That way the interpreter can add missing languages instead of duplicating that logic into BuildTarget for the cython case.
2022-03-24Debian renamed cython to cython3, support bothXavier Claessens1-1/+1
2022-03-24hotdoc module: use typed_pos_args to check positional argumentsEli Schwartz1-6/+4
We cannot use typed_kwargs though, because we allow fully arbitrary kwargs and pass them as arguments to the hotdoc program.
2022-03-24dub module: use typed_pos_args to check positional argumentsEli Schwartz1-4/+2
We cannot use typed_kwargs though, because we allow fully arbitrary kwargs and add them as keys in the generated dub file.
2022-03-24python 3 module: type-check all posargsEli Schwartz1-3/+4
Yes, it's deprecated, but we can still stop people doing the wrong thing with it if they are still using it.
2022-03-23gnome module: properly fallback to gtk-update-icon-cacheAntoine Jacoutot1-1/+1
Commit a0cade8f introduced a typo and wrongly check for gtk4-update-icon-cache twice. If gtk4-update-icon-cache (gtk4) is not found, look for gtk-update-icon-cache (gtk3) instead.
2022-03-23Add support for cython_argsTristan Partin1-0/+1
cython_args was previoously ignored by Meson.
2022-03-23Make sure we support "<lang>_args" kwarg for all languagesXavier Claessens1-25/+8
2022-03-23boost: preserve compiler/linker argument orderHemmo Nieminen1-2/+2
Looks like boost dependency mixes up it's compiler and linker argument order when it is removing duplicates (?) from those. This causes unnecessary recompilations of everything depending on those components. Use OrderedSet to remove the duplicates while also maintaining consistent order for them.
2022-03-23Fix DUB dependenciesRemi Thebault1-126/+295
- fix the research of target built by DUB - explicitely state that DUB dynamic libraries and source libraries are not supported (yet) (mesonbuild#6581) - fix the build settings of recipes having sub-dependencies (mesonbuild#7560) - fix winlibs added from dub recipe - sanitization, comments, explanations...
2022-03-23ninja backend: do not fatally error on compdb failureEli Schwartz1-1/+1
We print a warning if a compilation database isn't successfully generated, which is good, because that gives some visibility in case the user really wanted to use the compdb. But warnings default to being fatal with --fatal-meson-warnings, which is not so good, because this isn't a very important warning at all, and we'd rather not error out in such cases when building works fine and a random bonus IDE feature doesn't work. Mark this particular warning as non-fatal. Fixes side issue in https://github.com/mesonbuild/wrapdb/pull/343#issuecomment-1074545609
2022-03-22interpreter: Make compiler options per-subprojectXavier Claessens2-1/+20
2022-03-22coredata: Do not forget subproject's default_optionsXavier Claessens1-6/+9
2022-03-22OptionOverrideProxy: Handle per-subproject optionsXavier Claessens2-17/+25
2022-03-22OptionOverrideProxy: Make it immutable to avoid copiesXavier Claessens14-74/+70
It is always used as an immutable view so there is no point in doing copies. However, mypy insist it must implement the same APIs as Dict[OptionKey, UserOption[Any]] so keep faking it.
2022-03-22backends: Stop separating base and compiler optionsXavier Claessens5-25/+18
Since OptionKey is used we can mix all options together in a single dictionary. That's already what we do in coredata.options.
2022-03-22envconfig: use $PKG_CONFIG for pkg-config find_program as well as pkgconfigDylan Baker1-0/+1
It looks like internally we use pkgconfig, even though the installed name is pkg-config. This fixes `tests cases/common/44 pkgconfig-gen`, which will ignore PKG_CONFIG and select the wrong pkg-config binary if you have $PKG_CONFIG set.
2022-03-22compilers: fix mypy warning in Rust detectionDylan Baker1-0/+1
2022-03-22Add ability to add resources to jarsTristan Partin2-7/+15
Previously Meson lacked the ability to add resources to jar files. Fixes #9945
2022-03-22Bump version number for new development.Jussi Pakkanen1-1/+1
2022-03-21Prepare the 0.62.0 release.0.62.0Jussi Pakkanen1-2/+2
2022-03-21Merge pull request #10147 from dcbaker/submit/structured-sources-subdirJussi Pakkanen3-20/+23
structured_sources: fix subdir handling
2022-03-21ninja: fix handling of rust structured_sources in rare caseDylan Baker1-4/+11
In the even that all of the inputs are generated, and they're all generated into the same folder, and there are no subfolders, we would fail to correctly handle all of the files after the main file. Let's fix that.t
2022-03-20modules/rust: set bindgen include_dirs for both build and source dirDylan Baker1-1/+2
Which we pretty obviously need if any of our headers are generated
2022-03-18structured_sources: fix subdir handlingDylan Baker3-16/+12
We currently don't handle subdirectories correctly in structured_sources, which is problematic. To make this easier to handle correctly, I've simply changed `structured_sources` to only use Files and not strings as an implementation detail.
2022-03-18gnome module: fix incorrect lookup of nonexistent dependencies in post_installEli Schwartz1-3/+3
While gtk+-3.0 / gtk4 do exist, they have never provided the location of the gtk-update-icon-cache program as a pkgconfig variable. Trying to find one anyway, resulted in two things happening: - a useless dep lookup - a fatal-meson-warnings error and build failure because the get_pkgconfig_variable() in question never existed The desktop-file-utils package is a package solely providing some command line programs, and has never provided a pkg-config file in the first place, so this always logged that the dependency was not found and fell back to normal find_program_impl(), although without fatal-meson-warnings build errors. Fixes #10139
2022-03-16fix detection of language standard library pathsPaolo Bonzini2-20/+10
The code in the C++ and Fortran compilers' language_stdlib_only_link_flags method is broken and cannot possibly have ever worked. Instead of splitting by line, it splits by whitespace and therefore, instead of the last line of the compiler output: programs: =/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin libraries: =/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0 it is only the last field that has its first 11 characters removed. Instead of reinventing the wheel with a new and brittle pattern, reuse get_compiler_dirs. Fixes: 64c267c49 ("compilers: Add default search path stdlib_only_link_flags", 2021-09-25) Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-03-16coredata: be even more robust on unpickling errorsPaolo Bonzini1-1/+1
When reverting from 0.62 to 0.59, one can see an error like this: line 1003, in load obj = pickle.load(f) File "/Users/pm215/src/qemu-for-merges/meson/mesonbuild/mesonlib/universal.py", line 2076, in __setstate__ self.__init__(**state) # type: ignore TypeError: __init__() got an unexpected keyword argument 'module' FAILED: build.ninja Raise a MesonException for TypeError as well, so that reconfiguration proceeds using cmd_line.txt.
2022-03-16python: Remove warning about invalid install pathXavier Claessens1-9/+0
It was originally added because proper detection was not working on Debian, but that has been fixed since. It was causing annoying warning by default when prefix is /usr/local that can only be avoided by setting options.
2022-03-15Bump version number for rc2.0.62.0rc2Jussi Pakkanen1-1/+1
2022-03-15Revert "devenv: Set PYTHONPATH where we install python modules"Eli Schwartz1-43/+6
This reverts commit 79c6075b560dbf1c3e4e0b30f1c472dc2086421e. # Conflicts: # docs/markdown/snippets/devenv.md # mesonbuild/modules/python.py # test cases/unit/91 devenv/test-devenv.py PYTHONPATH cannot be reliably determined. The standard use case for installing python modules with Meson is mixed pure sources (at least `__init__.py`) and compiled extension_modules or configured files. Unfortunately that doesn't actually work because python will not load the same package hierarchy from two different directories, one a source directory and one a (mandatory) out of tree build directory. (It kind of can, but you need to do what this test case accidentally stumbled upon, which is namespace packages. Namespace packages are a very specific use case and you are NOT SUPPOSED to use them outside that use case, so people are not going to use them just to circumvent Meson devenv stuff as that would have negative install-time effects.) Adding PYTHONPATH anyway will just lead to documentation commitments which we cannot actually uphold, and confusing issues at time of use because some imports *will* work... and some will *not*. The end result will be a half-created tree of modules which just doesn't work together at all, but because it partially works, users attempting to debug it will spend time wondering why parts of it do import. For any case where the automatic devenv would work correctly, it will also work correctly to use `meson.add_devenv()` a single time, which is very easy to manually get correct and doesn't provide any significant value to automate. In the long run, an uninstalled python package environment will require "editable installs" support.
2022-03-14sourceset: reorder fields in SourceSetRulePaolo Bonzini1-10/+10
Keep conditions first, then "if true" fields, and the if_false sources last. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-03-14sourceset: document fields of SourceSetRulePaolo Bonzini1-0/+12
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-03-14sourceset: improve typing of SourceSetRulePaolo Bonzini1-2/+2
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-03-14sourceset: reinstate extra_depsPaolo Bonzini1-2/+4
Dependencies in the "if_true" keyword argument do not prevent the sources from being used; in other words, they work just like dependencies with "disabler: false". However, this was broken in commit ab0ffc6a2 ("modules/sourceset: Fix remaining typing issues", 2022-02-23) which changed logic instead of just fixing typing issues. This was likely an attempt to avoid using "dependencies.Dependency" after the "dependencies" field was declared, but it also broke QEMU. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-03-14sourceset: rename "dependencies" fields to depsPaolo Bonzini1-6/+6
The dependencies field clashes with the dependencies module, so that mypy interprets "dependencies.Dependency" as a "Dependency" attribute of the "dependencies" field. Rename the field to something else, so that it does not clash. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-03-13gnome module: fix crash due to misused function while generating gir commandEli Schwartz1-3/+3
In commit 68e684d51f1e469e0d9f4b499ffda15146cad98a the _get_link_args function was modified from returning a list[str] of arguments, to a tuple of both that and a modified copy of the entire target's current/enhanced dependencies (why not just the new ones? I don't know). However, the existing use of the function was not adapted to this change, and tried to turn this entire tuple into a node of the command line. Tuples cannot flatten to lists, and mesonlib.File or HoldableObjects don't make good command line arguments. As a result we errored out with: ERROR: Argument (['-L/path/to/builddir/', '--extra-library=foo'], [<SharedLibrary 25a6634@@foo@sha: foo>, <SharedLibrary 25a6634@@foo@sha: foo>, <SharedLibrary 25a6634@@foo@sha: foo>]) in "command" is invalid Split out the flags and the dependencies and update the former while replacing the latter.