aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-03-01mark a bunch of dependencies with the version they were introducedEli Schwartz2-0/+7
All these dependencies are impossible to find on versions of Meson older than the ones they got custom lookups in, because they don't provide pkg-config files. So they should not / cannot be reasonably used on older versions, and it is easy to say "yep, these should emit a FeatureNew for the versions they got added in".
2022-03-01allow dependency checks to bubble up feature warnings to the interpreterEli Schwartz2-0/+8
It would be too difficult and probably a layering violation to give an interpreter handle to the inner guts of every dependency. What we can do instead is let every dependency track: - the Feature checks it can produce, - the version attribute for when it was implemented while leaving the interpreter in charge of actually emitting them.
2022-03-01clean up FeatureCheck signature to move location to use timeEli Schwartz3-17/+15
The point of a .use() function is because we don't always have the information we need to use a feature check, so we allow creating the feature and then storing it for later use. When implementing location checks, although it is optional, actually using it violated that design. Move the location out of the init method for FeatureCheck itself. It remains compatible with all cases of .single_use(), but fix the rest up.
2022-03-01remove useless kwarg that was never usedEli Schwartz1-2/+1
I am not sure why it ever got added. It looks superficially similar to FeatureCheck itself, but doesn't need to.
2022-02-28Allow setting method/separator in environment() and meson.add_devenv()Xavier Claessens10-30/+131
2022-02-28devenv: Do not prepend empty list to PATH and LD_LIBRARY_PATHXavier Claessens1-7/+9
2022-02-28devenv: Add --dump optionXavier Claessens3-11/+33
It prints all envorinmente variables that have been modified. Can be used by shell scripts that wish to setup their environment themself.
2022-02-28devenv: Setup GDB auto-load scriptsXavier Claessens3-2/+65
When the project instals GDB helper scripts, copy them into meson-private directory with the right tree layout and write a .gdbinit script to load them automatically.
2022-02-28devenv: Source bash completion scriptsXavier Claessens4-15/+47
2022-02-28devenv: Set PYTHONPATH where we install python modulesXavier Claessens8-7/+94
2022-02-28Add API for modules that wants to define their devenvXavier Claessens3-2/+15
2022-02-28modules: Make ExtensionModule inherit from NewExtensionModuleXavier Claessens1-22/+7
It reduces duplicated code.
2022-02-28backends: Cache creation of install dataXavier Claessens1-0/+1
It is created twice for ninja and for introspection.
2022-02-28Cache the result of python.find_installation()Xavier Claessens1-29/+34
This avoids running sanity checks everytime find_installation() is called.
2022-02-28doc: Fix spelling developper->developerXavier Claessens1-1/+1
Mistaken from French développeur.
2022-02-28Add missing install_tag kwarg to install_emptydir()Christian Wendt1-2/+3
2022-02-28Change jar() default install dirTristan Partin3-0/+12
The previous install dir seemed incorrect when looking at various Linux distributions.
2022-02-28docs: correct the shaderc documentationDudemanguy1-5/+11
The documentation on how shaderc is checked in meson was quite behind. Update it to mention that pkg-config is the default and preferred method of checking. Also be specific about what order everything is checked in since shaderc is confusing.
2022-02-27wraptool: report name of wrap in status message for "not in wrapdb"Eli Schwartz1-1/+1
2022-02-27wraptool: be forgiving of local wrap filesEli Schwartz1-9/+22
Do not traceback when trying to update a wrap that isn't a [wrap-file], just report the problem. Do not traceback on perfectly valid WrapDB wraps that don't have a patch_url because they have upstream meson.build, instead try to parse the version from the source tarball filename.
2022-02-27sourceset module: fix minor regression in making sourcesets immutableEli Schwartz1-1/+1
In commit c0be7e05b070d85b38c79088df882970a5cd0279 the setting of merged sourcesets as immutable in a loop accidentally got dedented, and only applied to the last loop iteration.
2022-02-27Merge pull request #10004 from bonzini/mtest-tap-stderrJussi Pakkanen1-8/+9
mtest: print stderr of TAP/Rust tests in verbose/non-parallel mode
2022-02-27test cases/vala: Fix test 14Mark Bolhuis1-1/+1
2022-02-27modules/wayland: Add unstable_wayland moduleMark Bolhuis18-5/+283
2022-02-27cmake: configure_package_config_file can now take a dictAndrea Pappacoda4-5/+12
2022-02-27cmake: typed_kwargs for configure_package_config_fileAndrea Pappacoda1-24/+26
2022-02-23run_mypy: add sourceset moduleDylan Baker2-3/+4
2022-02-23modules/sourceset: Fix remaining typing issuesDylan Baker1-30/+45
2022-02-23mesonlib: allow check_dirent_issues to take an iterableDylan Baker1-2/+2
There's no reason it needs a concrete list, any iterable is fine. This does mean that we need to explicitly check for `str | bytes` in the listify pass, as `str` and `bytes` are both iterable.
2022-02-23modules/sourceset: use typed_kwargs for all functionsDylan Baker1-45/+97
removing permittedKwargs usage
2022-02-23modules/sourceset: Use typed_pos_argsDylan Baker1-13/+27
2022-02-23modules/sourceset: add a few super easy type annotationsDylan Baker1-13/+20
2022-02-23modules/sourceset: sort importsDylan Baker1-3/+4
2022-02-22python module: add option to specify a python environment to install toEli Schwartz4-4/+48
The default behavior of installing relative to prefix may be unexpected, and is definitely wrong in many cases. Give users control in order to specify that yes, they actually want to install to a venv. This is particularly useful for projects that use meson as a build system for a python module, where *all* files shall be installed into the python site-packages.
2022-02-22modules: add ModuleState API to check whether an option was user-specifiedEli Schwartz1-0/+7
Needed to check exclusivity of module options.
2022-02-20mtest: refactor common condition into a property of TestRunPaolo Bonzini1-6/+8
For a test to be displayed to stdout without buffering, it has to be 1) in verbose mode 2) not executed in parallel with others 3) not parsed, i.e. not TAP or Rust. Include these three conditions in a new property of stdout and use it in the three places where it matters: when printing the initial and final delimiters of the output, and when deciding the console mode to use. Suggested-by: Jussi Pakkanen <jpakkane@gmail.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2022-02-20devenv: support bash under MSYS2 by defaultChristoph Reiter1-4/+6
Currently it tries to run "cmd" by default in a MSYS2 bash. Passing "bash" doesn't work since that defaults to WSL and one has to pass an absolute path to bash instead, and even then one misses out on the PS1 override. In case $SHELL is set and the contained path exists prefer it even if we are on Windows. To make the PS1 override work we can't use Unix paths in Python since we might be on Windows, so move the .bashrc check into the temporary bash script itself. This makes "meson devenv" work the same under MSYS2 as on Linux.
2022-02-20add all supported arguments in docs for summary()Stone Tickle1-5/+28
2022-02-20mtest: raise informative error message when test program doesn't existEli Schwartz1-2/+5
If --no-rebuild is used, the test program might not exist, spawning a FileNotFoundError inside a long traceback rooted in subprocess.Popen trying to run that test program. Current versions of Meson even say it's an "unhandled python exception". But we can do one better and actually tell the user what is wrong, why, and what to do to fix it. And we can do so before getting waist deep in partially running tests. Fixes #10006
2022-02-20mtest: print stderr of TAP/Rust tests in verbose/non-parallel modePaolo Bonzini1-3/+2
Verbose, non-parallel tests generally print their output as they run, rather than after they finish. This however is not the case if stdout of the test is parsed as is the case for TAP and Rust tests. In this case, the output during the run is the list of the subtests, but stderr still has to be printed after the test finishes.
2022-02-17test cases: rename shared library('c') avoid libc collisionEli Schwartz5-5/+10
In a bunch of cases we create a series of sample libraries named "a", "b", "c" etc. This breaks on musl. Originally reported with muon via commit https://git.sr.ht/~lattis/muon/commit/ca5c37171423e9884047a85349e1b236d7449510 and also breaks the testsuite when packaging meson for alpine linux. libc.so is an existing library which is linked in by default for all the obvious reasons. You can get away with this on glibc, because that includes a soversion of "6", but it loads the wrong library on musl.
2022-02-17project tests: fine-tune the check for whether we are in CIEli Schwartz1-1/+1
Follow-up on commit 4274e0f42a9673df981dd7a7a456f4d4fcfe5452. We want to allow tests to be skipped freely in third-party environments, so this should check the jobname, not whether $CI exists. We will anyways raise an error when trying to run the project tests, if $CI is set but no jobname is set.
2022-02-17intl dependency: include header when checking for libc builtinEli Schwartz1-1/+2
This header is required anyway. And the compile test for linking to libc with the gettext symbol, can succeed when we try to use the literal symbol name without includes, but fail later during project build, because actually including libintl.h might redefine the function to match a forked symbol. This happens when GNU libintl is installed as a standalone library on systems that have a less fully-featured gettext implementation. So, by including the header in has_function, we can ensure that we test against the default resolved header. In the event that the symbol which is #define'd by the header is 'libintl_gettext', linking will fail against libc even when a builtin gettext does exist, and we will fall back to the intl dependency that provides -lintl (and which is needed to properly use the default header). Of course, even that probably won't work. has_function(prefix: '...') is useless to check the difference between builtins and external library functions. It has code to detect "builtins" that misfires in some cases (previously seen with iconv_open). Instead compile an open-coded test file that this intl dependency implementation fully controls, that doesn't get up to imaginative edge cases like trying to find `__builtin_gettext`. It's the only way to be sure. Fixes compiling against the intl dependency on e.g. Alpine Linux when the libintl package is installed.
2022-02-17tests: allow setting MESON_CI_JOBNAME=thirdpartyEli Schwartz2-4/+5
This is treated by the test harness as though unset, i.e. we do normal skipping and don't assume we are running in Meson's own project CI. However, it has one distinction which is that it isn't an error to set $CI without setting $MESON_CI_JOBNAME, if it is in fact set but to the ignored value. This lets automated workflows such as Linux distro testing, particularly alpine linux, set $CI or have it set for them by default, without messing things up. Also it has the advantage of $CI actually enabling useful benefits! We will still assume that this thirdparty environment wants to force verbose logging (printing testlogs, running ninja/samu with -v) and colorize the console.
2022-02-17tests: do not use a GNU bash script to check the minimum version of programsEli Schwartz2-10/+1
find_program() can check that for us already, there's no need to require GNU bash on systems that default to other POSIX shells. Even though this is the *linuxlike* tests and a POSIX shell is guaranteed, there is actually no need to require a shell at all. It's *easier* to use the meson builtin functionality here.
2022-02-17unittests: make ninja detection faster and more robustEli Schwartz1-8/+12
Instead of blindly assuming when $CI is set that `ninja` is always correct and always new enough, check for it the same way we do when $CI is not set. Instead of special casing when $CI is set and skipping ninja detection in subprocess tests (by assuming it is always `ninja`), skip detection in subprocess tests all the time, by passing this information around across processes after the first time it is looked up. This means that local (non-CI) tests are faster too! Fixes running unittests in alpine linux using samu. Although ninja is a symlink to samu, the exact output string on no-op builds is different, which we already handle, but what we don't handle is the fact that samu prints a third case when you invoke it as `ninja`. If $CI is exported, then the unittests ignored $NINJA entirely. Fixes running unittests when $CI is set, `samu` exists and `ninja` does not exist. This is not currently the case anywhere, but may be in the future; why not fix it now?
2022-02-16flake8: fix various whitespace errors with badly aligned codeEli Schwartz8-27/+28
2022-02-16flake8: do not use bare exceptionsEli Schwartz2-2/+2
In one case, we actually specifically want to catch IndexError only. In the other case, excepting Exception rather than BaseException is quite fine.
2022-02-16fix malformed warning to print the way it was meant to printEli Schwartz1-9/+5
Given a meson.build with the contents: ``` t = ' ' ``` We want to warn that this is bad. So we emitted this warning: ``` WARNING: Newline character in a string detected, use ''' (three single quotes) for multiline strings instead. This will become a hard error in a future Meson release. t = ' 4 4 ``` The line contents and the offset are printed as gibberish after a big whitespace run. These are elsewhere often passed to ParseException, which pretty-prints this, but newlines aren't an exception, merely a warning, and mlog.warning doesn't accept numeric strings as anything more meaningful than something to print as text. Fix this (by wrapping it in a ParseException) to properly print: ``` meson.build:4: WARNING: Newline character in a string detected, use ''' (three single quotes) for multiline strings instead. This will become a hard error in a future Meson release. t = ' ^ ```
2022-02-16fix a couple misuses of textwrap.dedentEli Schwartz2-4/+4
A backslash-escape of the last newline before a run of whitespace leading to the indented string ending and function termination `)` does not actually escape the entire line and make it do nothing. In fact what it does is cause all that whitespace to be part of the preceding line, and get printed. Meanwhile the textwrap.dedent documentation states that lines with only whitespace get normalized. When you *don't* mess with that final line, dedent actually does the right thing and makes the output message end with a single newline after the important text.