summaryrefslogtreecommitdiff
path: root/mesonbuild/modules
AgeCommit message (Collapse)Author
2024-05-19pylint: fix false positive for variable defined in different copies of ↵Eli Schwartz
conditional We do: ``` if is_thing: assignme = value if_is_thing: ... else: assignme = [] ``` It is always defined on both sides, but there was no particular reason we had to assign it in the later copy. pylint reported it as a false positive, and it may prove confusing in general, and it's harmless to move, so do so.
2024-05-19Pass wrapmode value around as a string. (#13229)Jussi Pakkanen
2024-04-23Pass --quiet to glib-genmarshalTristan Partin
No need to spam about reading the input file. Fixes: #13119
2024-04-22add an error message for targets that are not dependenciesMomtchil Momtchev
2024-04-09modules: rename qt.py -> _qt.pyDylan Baker
Since it's an implementation detail, and shouldn't be exposed. This also helps give better error messages when a user writes `import('qt')`, since otherwise you get an error about `qt doesn't have an initialize method`, and now you get `qt module doesn't exist`.
2024-04-08gnome: Fix indentation of mkenums_simple generated codeMatthijs Velsink
Commit 83facb39593fbfa4d9cd68e86f5f56f86f1fe1eb switched to using `textwrap.dedent` for the code templates for `gnome.mkenums_simple`. That changed indentation, however, making the generated code harder to understand. We improve this by properly indenting the multiline strings before dedenting them. For optional parameters `decl_decorator` and `header_prefix`, we add a newline if they are set to keep separation between generated code blocks.
2024-03-18cmake: fix incorrect decorator for append_link_argsStephan Lachnit
Signed-off-by: Stephan Lachnit <stephanlachnit@debian.org>
2024-03-15wayland: Stable protocols can have a versionXavier Claessens
Fixes: #12968
2024-03-10fix reconfigure subproject base optionsCharles Brunet
2024-02-26modules/rust: Fix New Version check that was not updatedDylan Baker
Should be 1.4.0 but was 1.3.0
2024-02-26interpreter: Dependency variables can be empty stringXavier Claessens
There is no reason to forbid empty variables, PkgConfigCLI.variable() even has code specifically for handling that case.
2024-02-24Add support for BuildTargetTypes to various fs module functionsTristan Partin
The new support was added to fs.name, fs.parent, fs.replace_suffix, and fs.stem.
2024-02-24Correct fs.read function name in exception messageTristan Partin
2024-02-24Fix fs module FeatureNew prefixes to match the function nameTristan Partin
They were appending _file to the function name when they were meant to suggest that the function now supports file objects.
2024-02-24Fix bad escape character in doc commentTristan Partin
2024-02-24meson/rust: wrap `bindgen`s `wrap-static-fns` functionalityKarol Herbst
This way the `rust.bindgen` can generate a second output being a C file, which contains wrapper functions for static inline ones. This output file can then be compiled via C targets.
2024-02-23Alphabetize the fs module methods dictTristan Partin
2024-02-23Add location nodes to FeatureNews in the fs moduleTristan Partin
2024-02-23modules/rust: allow setting a version constraint on bindgenDylan Baker
This allows us to ensure that the bindgen we're using is suitable for our purpose.
2024-02-23modules: fix find_program.wantedDylan Baker
Which should be `str | list[str]`, not `str | None`.
2024-02-23modules/rust: inject a C/C++ standard for bindgenDylan Baker
Especially for C++ this is very important.
2024-02-23modules/rust: Allow explicitly setting the language to bindDylan Baker
This may be of particular use when a header is .h but should be treated as a C++ header instead of a C header.
2024-02-23rust/bindgen: Use Meson rules for C++ headersDylan Baker
Bindgen natively only considers .hpp to be C++ headers, but Meson considers some additional extensions including .hh and .hxx to be C++.
2024-02-22modules/i18n: CustomTargets must have `install_dir` if installingDylan Baker
Since they do not implement a default install dir like BuildTargets do. Fixes: #12843
2024-02-19Fix KeyError in Python moduleCharles Brunet
0e7fb07 introduced a subtile bug in the Python module. If a python version is found, but is missing a required module, it is added to the list of python installations, but the `run_bytecompile` attribute for that version was not initialized. Therefore, if any other python version added something to install, it was raising a KeyError when trying to read the `run_bytecompile` attribute for the python version with missing module.
2024-02-12cuda module: fully type annotateEli Schwartz
Special notes: - _nvcc_arch_flags is always called with exact arguments, no need for default values - min_driver_version has its args annotation loosened because it has to fit the constraints of the module interface?
2024-02-12cuda module: use typed_pos_args for most methodsEli Schwartz
The min_driver_version function has an extensive, informative custom error message, so leave that in place. The other two functions didn't have much information there, and it's fairly evident that the cuda compiler itself is the best thing to have here. Moreover, there was some fairly gnarly code to validate the allowed values, which we can greatly simplify by uplifting the typechecking parts to the dedicated decorators that are both really good at it, and have nicely formatted error messages complete with reference to the problematic functions.
2024-02-12cuda module: inline single-shot function to get compiler versionEli Schwartz
It is pretty trivial and more confusing when standalone, especially the use of a sentinel "unknown" string as a standin for "this isn't one of the allowed object types". Much easier to directly raise an error in the fallthrough/else.
2024-02-12cuda module: fix type signature for oneshot functionEli Schwartz
It is only ever invoked once. It has a statically known signature based on how it's used, so there's no good reason to allow it to accept any defaults -- and defaulting to None messes with type safety. Saturate is always given, so don't claim it is only sometimes.
2024-02-12cuda module: use typed_kwargsEli Schwartz
This officially only ever accepted string or array of strings.
2024-02-12dlang module: simplify dependency handling with DRYEli Schwartz
It can be a list or a single dependency, but the same logic happens either way. Instead of manually expanding the logic for both cases, just convert it to a list as needed.
2024-02-12qt: add preserve_paths keyword to functionsCharles Brunet
This allow to generate ui and moc under subdirectories, as this is allowed with generic generators.
2024-02-08find_tool: fix error message interpolationOle André Vadla Ravnås
2024-01-30rust: Add `--extern proc_macro` in `rust.proc_macro() not in cargo translationDylan Baker
Cargo does this by default, so it's reasonable that we do the same. Fixes: #12758
2024-01-25modules/fs: use ModuleState object instead of Interpreter when possibleDylan Baker
2024-01-25modules/sourceset: remove unused attributes from SourceSetImplDylan Baker
2024-01-11Vala: fixes to gresource handling (#12418)Valeri
* Vala: depend on gresources Valac uses gresource at compile time to look up .ui files * Automatically pass `--gresourcesdir` to valac * gnome.compile_resources: clean up duplicate paths better * Add a test for improved gresouce handling
2023-12-22modules: get rid of the .*machine variablesDylan Baker
They're hardly used, and can be gotten directly from the Environment instead
2023-12-13Use SPDX-License-Identifier consistentlyDylan Baker
This replaces all of the Apache blurbs at the start of each file with an `# SPDX-License-Identifier: Apache-2.0` string. It also fixes existing uses to be consistent in capitalization, and to be placed above any copyright notices. This removes nearly 3000 lines of boilerplate from the project (only python files), which no developer cares to look at. SPDX is in common use, particularly in the Linux kernel, and is the recommended format for Meson's own `project(license: )` field
2023-12-08external_project.py: fix --host valueStas Sergeev
Currently in cross-compilation mode the --host is set to x86-linux-linux, which results in an error. Change the code so that for x86 and x86_64 the second part is 'pc', and 'unknown' for the rest. Use cpu model instead of cpu family for the first part, as suggested by @dcbaker As the result, we get: i386-pc-linux on my setup. Fixes #12608
2023-11-22Make the Requires.private line in generated .pkgconfig files reproducibleChris Lamb
Whilst working on the Reproducible Builds effort, we noticed that meson was generates .pkgconfig files that are not reproducible. For example, here is neatvnc's pkgconfig file when built with HEAD^1: Name: neatvnc Description: A Neat VNC server library Version: 0.7.0 -Requires.private: pixman-1, aml < 0.4.0, aml >= 0.3.0, zlib, libdrm, libturbojpeg, gnutls, nettle, hogweed, gmp, gbm, libavcodec, libavfilter, libavutil +Requires.private: pixman-1, aml >= 0.3.0, aml < 0.4.0, zlib, libdrm, libturbojpeg, gnutls, nettle, hogweed, gmp, gbm, libavcodec, libavfilter, libavutil Libs: -L${libdir} -lneatvnc Libs.private: -lm Cflags: -I${includedir} This is, ultimately, due to iterating over the contents of a set within a DefaultDict and can thus be fixed by sorting the output immediately prior to generating the Requires.private string. An alternative solution would be to place the sorted(…) call a few lines down: return ', '.join(sorted(result)) However, this changes the expected ordering of the entire line, and many users may be unhappy with that (alternative) change as a result. By contrast, this commit will only enforce an ordering when there are multiple version requirements (eg. a lower and a higher version requirement, ie. a version range). It will, additionally, order them with the lower part of the range first. This was originally filed (with a slightly different patch) by myself in the the Debian bug tracker <https://bugs.debian.org/1056117>. Signed-off-by: Chris Lamb <lamby@debian.org>
2023-11-05gnome module: fix invalid find_tool variable contents causing crashEli Schwartz
If a tool that is looked up in a .pc file is supposed to be there and has a pkg-config variable entry, but the value is incorrect, we can't actually use it. Since commit ab3d02066c91974922948f8b8b0fc944875d1a90 we actually do run the ExternalProgram search procedure on it though -- which caused it to go wonky and return a None if it doesn't exist, instead of containing a path to a program that does not exist and fails at build time. This is better in the case where searching helps resolve .exe file extensions -- and worse in the case where patches to the dependency means nothing we do is ever enough to actually find what is expected, since now we crash. Raise an explicit error in such a case, pointing out that the dependency itself is broken and needs a distributor-side resolution. Fixes #12412
2023-10-28simd module: fix regression that broke using only some simd variantsEli Schwartz
Regression in commit a3d287c553b9598f010fe0755c5528ef62055e44. When a given kwarg is not specified, we want to not generate it as a simd variant. Since the default for buildtarget sources is `[]` it resulted in building a static library with no sources, and a warning stating that this was buggy and will eventually be removed. Fix this by teaching buildtarget sources to allow None, and defaulting to it specifically for the simd module. We can check this and then skip processing entirely. Fixes #12438
2023-10-26i18n module: Invoke itstool with the full command lineChun-wei Fan
Certain envs may not support invoking itstool by itself directly as a script as shebang lines are not supported, such as under cmd.exe shells on Windows, that are normally used for Visual Studio (and the like, such as clang-cl) builds. This will call the corresponding interpreter to invoke itstool when needed, so that itstool can be properly run, even if shebang lines are not supported by the env. This will fix building appstream on Windows using clang-cl, for instance.
2023-10-20modules/rust: remove missed cargs.extend()Dylan Baker
2023-10-17interpreter: use typed_kwargs for build_target.gnu_symbol_visibilityDylan Baker
2023-10-17interpreter: use typed_kwargs for build_target.nativeDylan Baker
2023-10-17modules/rust: only use include and define args from global/project argsDylan Baker
2023-10-16modules/rust: remove rust_crate_type for test() methodDylan Baker
This is required to test non-executable targets when they set an explicit type.
2023-10-16compilers/d: use DFeatures for get_features_argsDylan Baker