aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-06-08build: use a helper to process set install tagsDylan Baker1-4/+13
Which can be shared by BuildTarget
2022-06-07wrap: Add support for applying a list of patch filesPaweł Marczewski9-1/+172
Co-authored-by: Xavier Claessens <xavier.claessens@collabora.com>
2022-06-06compilers: Add support for stand-alone leak sanitizerMarco Trevisan (Treviño)3-3/+3
Leak sanitizer can be enabled without the whole AddressSanitizer, this can be done by passing -fsanitize=leak as documented at [1]. Meson doesn't support this, so add support for it. [1] https://clang.llvm.org/docs/LeakSanitizer.html
2022-06-03devenv: do not fatally error if pkg-config or bash-completion is not availableEli Schwartz1-1/+1
We might be using all fallbacks, or be super weird and not use bash-completion, or simply have a different PKG_CONFIG_LIBDIR set. And devenv already checks whether the dependency is found, but defaults to required anyway, which is wrong.
2022-06-01backends: work around some mypy limitations and fix spotted bugsDylan Baker1-15/+21
2022-06-01build: stop overwriting outputs, and replace the intended outputDylan Baker1-2/+4
Currently, the code puts a placeholder in for the first output, then replaces all of the outputs when it generates final value. Instead, let's only replace the placeholder value.
2022-06-01interpreter: add missing type annotationDylan Baker1-1/+1
2022-06-01interpreter: add location to a FeatureNew callDylan Baker1-2/+3
2022-06-01interpreter: use a shared KwargInfo for install_dirDylan Baker6-18/+21
CustomTarget allows multiple install dirs, while basically everything else allows only one. So this provides a shared instance for that.
2022-06-01dependencies: Fix d_module_version typesDylan Baker1-1/+1
It's a `List[str | int]`, just like in the build module. In fact, we should probably share the same type information between the two.
2022-06-01modules/gnome: fix gen_marshall annotationDylan Baker1-1/+1
2022-06-01targets: Fix annotations of get_install_dir to be accurateDylan Baker1-7/+7
2022-06-01ast: rename module constant to match PEP8 styleDylan Baker4-8/+13
2022-06-01ast/introspection: tidy up imports a bit more with __future__.annotationsDylan Baker1-3/+8
This lets us not import quite as much at runtime
2022-06-01ast/introspection: sort importsDylan Baker1-9/+10
2022-06-01modules: move gnome targets into gnome moduleDylan Baker3-18/+19
They're not used outside of the gnome module anyway, and they create some annoying potentials for dependency loops
2022-06-01compiler: Add missing needs_static_linker to base Compiler classDylan Baker1-0/+3
2022-06-01Add "in development" in release notes titleXavier Claessens1-3/+4
It was already written in the side menu, but better have it in the page title too.
2022-06-01Fix sandbox violation when using subproject as a symlinkVili Väinölä6-1/+35
Fix "Tried to grab file outside current (sub)project" error when subproject exists within a source tree but it is used through a symlink. Using subprojects as symlinks is very useful feature when migrating an existing codebase to meson that all sources do not need to be immediately moved to subprojects folder.
2022-05-31docs: fix incorrect linkEli Schwartz1-2/+2
When referring to the custom_target docs, we want to point to the docs on the function, not the docs on the returned method.
2022-05-31fix bug in i18n merge_file/itstool_join revealed by previous commitEli Schwartz2-19/+31
Logically, i18n.merge_file cannot ever take a MULTI_OUTPUT_KW, but it does take a CT_OUTPUT_KW-like interface. Actually trying to pass multiple merge_file outputs causes the msgfmthelper script to be entirely malformed in the arguments it accepts, and treat the broken one like a --flag, then exit with argparse errors. Even if we somehow assumed that somehow it was designed to actually allow this, msgfmt doesn't support conceptually passing multiple outputs so that would be a msgfmt error instead of an error inside the guts of `meson --internal msgfmthelper`. Same logic applies again for the itstool command and the itstool internal helper. Catch this error at configuration time by using the single-output kwarg form. Likewise, it's totally nonsense to accept multiple install_dir or install_tags, and ever since commit 11f96380351a88059ec55f1070fdebc1b1033117 the CustomTarget itself won't even check this.
2022-05-31rename a badly named KwargInfoEli Schwartz3-7/+7
CT_OUTPUT_KW is the same OUTPUT_KW we use in lots of places. The most distinctive thing about it is not that it's part of custom_target (basically any other function that uses such a kwarg follows the same rules due to using CustomTarget under the hood), but the fact that it takes multiple outputs.
2022-05-31fix regression that broke type checking of CustomTarget outputsEli Schwartz4-6/+12
We validate a few things here, such as the non-presence of '@INPUT' in an output name. These got moved out of the CustomTarget constructor in commit 11f96380351a88059ec55f1070fdebc1b1033117 and into KwargInfo, but only for kwargs that took multiple values. This caused configure_file() and unstable_rust.bindgen() to stop checking for this. Add a shared single-output KW and use it in both places. This now dispatches to _output_validator. configure_file now validates subdirectories in output names the same way we do elsewhere, directly in the typed_kwargs and by specifying the erroring kwarg.
2022-05-31make sure no custom_target outputs are named "all" or "meson-internal__*"Eli Schwartz1-9/+15
Or any other reserved names. We check in add_target that the primary name of any build target isn't on the forbidden list, but custom_target allows names that are distinct from the output filenames, so we need to check those too. We would eventually still error out all the way at the end, with: ``` ERROR: Multiple producers for Ninja target "all". Please rename your targets. ``` But, if we can check that early and provide the underlying reason (reserved name) alongside actually useful debugging info (a line number), then why not? Refactor the check into a small helper function in the process.
2022-05-31relax target name restrictions to cater to internal useEli Schwartz2-4/+7
We don't want to allow targets that conflict with: - our aliased meson-* targets for phony commands - any meson-*/ directories we create for internal purposes We do want to allow targets such as: - our own meson-*.X manpages There are a couple routes we could take. Using a better restriction, such as `meson-internal__*`, is trivially done for our aliased targets, but changing directory names is... awkward. We probably cannot do this, and doing the former but not the latter is not very useful. We could also carefully allow patterns we know we won't use, such as file extensions, but which the manpages need, which works for our directories and for many aliased targets, but run_target() is user-specified and can be anything. Use a hybrid approach to cover both use cases. We will now allow target names that fulfill *all* the following criteria: - it begins with "meson-" - it doesn't continue with "internal__" - it has a file extension
2022-05-31ninja backend: simplify generation of phony targetsEli Schwartz1-64/+33
Every phony target has a special indirection rule created because ninja is bad at deleting generated outputs and tries to delete phony outputs too. Instead of invoking this as a separate helper post-creation function to create the alias, wrap NinjaBuildElement and create it behind the scenes. This simplifies target naming and means one less line at every single use site.
2022-05-31Fix typo in documentation for add_*_argumentsKarl Linden2-2/+2
2022-05-31Fix that VS backend respects "console" keyword in custom_targetVili Väinölä1-1/+2
Previously the output of the custom target was always captured and it was not possible to see the output unless build failed.
2022-05-30Implement `preserve_path` for install_headersFlorian "sp1rit"​6-7/+78
The `install_headers` function now has an optional argument `preserve_path` that allows installing multi-directory headerfile structures that live alongside sourcecode with a single command. For example, the headerfile structure headers = [ 'one.h', 'two.h', 'alpha/one.h', 'alpha/two.h', 'alpha/three.h' 'beta/one.h' ] can now be passed to `install_headers(headers, subdir: 'mylib', preserve_path: true)` and the resulting directory tree will look like {prefix} └── include    └── mylib       ├── alpha       │   ├── one.h       │   ├── two.h       │   └── three.h       ├── beta       │   └── one.h       ├── one.h       └── two.h Fixes #3371
2022-05-30fix invalid type for default_optionsEli Schwartz1-1/+1
We have two checks for the type accepted here. One is the basic typed_kwargs type-checking, which declares it accepts: str | include_directories The other is the custom validator which further narrows it to strings with certain option-like properties (needs to be an = assignment). The former is obviously wrong, which doesn't really matter all that much but still isn't very nice... Introduced in commit f34013fb08b8d24d570c96084c5d58c5eaf4f5da.
2022-05-30fix incorrectly allowed kwarg for custom_targetEli Schwartz3-8/+2
override_options makes no sense for custom_target as we don't use it for anything. Also, this was added in commit c3c30d4b060239654c9b848092692ab346ebed9d despite not being allowed in permittedKwargsc3c30d4b0. For inexplicable reasons, we had a known_kwargs for custom_target that looped over kwargs and issued a warning, not an error, for unknown kwargs. It was impossible to ever hit that check to begin with, though, ever since commit e08d73510552fa4a3a087af1a9e5fded8f5749fd which added permittedKwargs and obsoleted those manual checks with real errors. So at one point override_options was specially permitted to be used without emitting a warning, and then for about half a decade it was an error, and then based on some dead code it was allowed again for a bit. But through all this it doesn't do anything and isn't documented.
2022-05-29i18n: be build-compatible (but not developer-compatible) with gettext-tinyEli Schwartz1-9/+12
For maintainer targets, we need some more tools that gettext-tiny doesn't implement. It's a shame to cause NLS to be completely disabled in such environments, so instead just issue a warning and continue. Before 0.62.0 these were never checked for, and would simply fail at runtime, probably. In theory, the user might install the tools in between configuring and building, and then the maintainer targets would begin to work. Return to that behavior -- we still create the targets, which will *probably* fail, but might not -- and for existing integrations, failing at `ninja foo-update-po` with "error, program msgmerge not found" is a bit more discoverable than ninja saying "what do you mean, there's no such target". We still have the 0.62.0 preferred behavior of trying to find the programs, succeeding in all cases other than gettext-tiny, and guaranteeing that their paths are set up in a machine-file-respecting manner.
2022-05-29i18n: fix bug where disabling gettext() broke merge_file()Eli Schwartz1-1/+1
In the former case, the presence of tools is optional, but triggers a warning and then no-ops the target. In the latter case, the presence of the tools is mandatory. But if it was already looked up and discovered to be missing, we did not actually check that it is found before trying to use it. In the case that it isn't found, check again, so that we explicitly error out with a relevant error message due to setting the required flag. Fixes #10320
2022-05-29gettext: explicitly pass source root / subdir as cli argsEli Schwartz2-8/+13
Because this is a wrapper script and we could/should do this, we even have half the infra for it.
2022-05-29linkers: try a bit harder to autodetect the correct linker idEli Schwartz1-2/+4
mingw GCC using ld.bfd emits diagnostics that include "-plugin-opt=-pass-through=-lmoldname" and this triggers a match for mold when it should not. Instead, always check the very beginning of the output for the linker id. This is pretty consistent: - it is always on stdout - GCC may put additional things on stderr we don't care about - swift is bizarre and on some OSes redirects the linker stdout to swiftc's stderr, but it will still be the only stderr; we didn't even check stderr at all until commit 712cbe056811ebdf0d7358ba07a874717a1c736f For gold/bfd linkers, the linker id is always the *second* word, after the legally mandated "GNU" we already check for.
2022-05-26remove repetition and stiff languageGuilherme Janczak1-2/+1
2022-05-26don't tell documentation contributors to skip CIGuilherme Janczak3-15/+1
The CI correctly handles documentation changes automatically, it's no longer necessary to do it by hand.
2022-05-26fix custom_target crash if boolean true is specified in install_dirEli Schwartz2-2/+3
We accept boolean false to indicate "do not install this one particular output", but the type checking simply checked if it is a bool. We do this correctly for configure_file, so copy the same validator from there.
2022-05-25Make a copy of auto_features options when changing its nameXavier Claessens1-1/+2
This fixes bogus messages "skipped: feature foo disabled" when auto_features=disabled. It was reporting the name of the latest get_option() call instead of the name of the current feature option. This is especially visible in GStreamer summary where it should show a different option name for every subproject but instead shows "tools" everywhere: ``` Subprojects gst-devtools : NO Feature 'tools' disabled gst-editing-services : NO Feature 'tools' disabled ... ```
2022-05-25build: replace hand rolled code with CustomTarget[Index].links_dynamically()Dylan Baker1-2/+2
Which also fixes builds on windows that might produce a .lib instead of a .a. The error message has been changed to reflect that as well
2022-05-25interpreter: add type restrictions to declare_dependency link_wholeDylan Baker1-2/+11
Including that we don't accept SharedLibraries or CustomTarget[Index]s that are a shared library
2022-05-25build: Add a `links_dynamically` method to CustomTarget[Index]Dylan Baker1-0/+20
This is useful for cases where we treat CustomTargets as linkable targets, and need to know whether they're going to link statically or dynamically.
2022-05-25dependencies: Don't allow as_link_whole to complete with SharedLibrariesDylan Baker1-1/+12
Since a SharedLibrary can't be statically linked in, we shouldn't allow the method to complete.
2022-05-25interpreter: add annotations to extract_variablesDylan Baker1-2/+4
2022-05-25dependencies: Fix several annotations issuesDylan Baker1-7/+11
- `BuildTarget` should be `SharedLibrary | StaticLibrary` - Needs to take `CustomTargetIndex` as well as `CustomTarget` - don't assign to self until values have been converted to the correct type
2022-05-25build: fix annotations for BuildTarget.link*targetDylan Baker1-2/+2
which do not hold BuildTargets, they are `SharedLibrary | StaticLibrary | CustomTarget | CustomTargetIndex` (whole doesn't accept `SharedLIbrary`)
2022-05-25modules/gnome: Fix missing type annotationDylan Baker1-1/+1
2022-05-25modules/gnome: fix some typing issuesDylan Baker1-3/+3
That come to light with some of the changes later in this series, particularly around dependencies.
2022-05-25Fix optimization level 's' for the TI compilerAndreas Obergschwandtner1-1/+1
2022-05-24cmake: Add test caseDaniel Mensinger2-0/+5