aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-12-19Bump versions to 1.3.1 for stable release1.3Nirbheek Chauhan2-2/+2
2023-12-19macos: Fix test_pkgconfig_parse_libs() test on armAndres Freund1-1/+2
The unit test infrastructure hardcodes the architecture as x86_64. On macos, the test_pkgconfig_parse_libs() test creates a few libraries for testing using clang. This leads to the test failing on arm based macs, as darwin_get_object_archs() will skip over these libraries, which then leads to the test failing because of using -l instead of referencing the libraries by their full path. I am not at all sure this is the best approach. I am also somewhat confused why nobody else has encountered this? CI apparently just runs on x86_64 macs? CC: @tristan957
2023-12-19vs: Manually link generated .o filesarch1t3cht4-17/+20
Fixes #12550 . VS automatically links CustomBuild outputs ending in .obj or .res, but others need to be included explicitly.
2023-12-19Always use posix paths when retrieving link nameErwin Jansen1-4/+4
This commit modifies the get_target_filename_for_linking function to always return POSIX-style paths, even on Windows systems. This is necessary because the Ninja generator can have issues with Windows-style paths when using the `/WHOLEARCHIVE:` flag. This is consistent with the syntax accepted by the cl and clang-cl compilers, as documented in the Microsoft documentation: https: //learn.microsoft.com/en-us/cpp/build/reference/cl-filename-syntax?view=msvc-170 Fixes: 12534
2023-12-19Fix coverage with lcov 2.0 and uncovered subprojectsDavid Robillard1-0/+1
Version 2.0 of lcov triggers an error when an exclude pattern is unused. This can happen when the project has subprojects, but no code in them ends up covered: lcov: ERROR: 'exclude' pattern '/[...]/subprojects/*' is unused. (use "lcov --ignore-errors unused ..." to bypass this error) So, simply do as it says. Unused patterns doesn't seem problematic (or even interesting) here, so I don't think there's any risk in simply turning this off, which matches what happened with earlier versions of lcov anyway.
2023-12-19macos: Do not emit -undefined,error for Sonoma compatibilityAndres Freund1-1/+9
Emitting -undefined,error was correct,, but starting with Xcode 15 / Sonoma, doing so triggers "ld: warning: -undefined error is deprecated". Given that "-undefined error" is documented to be the linker's default behaviour, this warning seems ill advised. However, it does create a lot of noise. As "-undefined error" is the default behaviour, the least bad way to deal with this seems to be to just not emit anything. Of course that only works as long as nothing else injects -undefined dynamic_lookup, or such. Complain to Apple. Fixes: https://github.com/mesonbuild/meson/issues/12450
2023-12-19Fix test failure on Darwin on a case-sensitive fsRandy Eckenrode1-1/+1
This was encountered while looking into an issue with https://github.com/NixOS/nixpkgs/pull/268583. I run my Nix store on case-sensitive APFS, so the test fails due to trying to link `-framework ldap` instead of `-framework LDAP`.
2023-12-19python: fix mingw python detection code in case pkg-config isn't availableChristoph Reiter1-6/+7
The code assumed that sysconfig.get_platform() returns "mingw" for mingw Python, but that's no longer the case for 2.5 years now, as it now only starts with "mingw" and contains further information like the arch and other ABI relevant things to avoid conflicts. This updates the detection code to the current status quo. mingw Python only documents right now that it starts with "mingw", and none of that arch stuff, but it's unlikely that this will change, and this looks less error prone than looking at CC. Fixes #12547
2023-12-19macos: Fix test case for constructor_priority when using gccAndres Freund1-0/+5
GCC does not support constructor_priority on macos. It's possibly not the only platform for which that is the case, but...
2023-12-19macos: Fix path in test to be Sonoma compatibleAndres Freund1-1/+1
The path tested prior does not exist anymore in Sonoma. It seems less likely that 'cat' will be removed, so use that.
2023-12-19Handle macos linker reporting error message in pluring during detectionAndres Freund1-2/+3
Previously macos reported "ld: unknown option: --version" when being passed --version, but now sometimes it reports in plural, albeit without an obvious pattern when. To handle that, simply just check for the prefix without the : Fixes: https://github.com/mesonbuild/meson/issues/12552
2023-12-19Only convert boolean values for cmake formatsJan2001011-1/+1
This caused a regression with mesondefine where `conf_data.set("FOO", true)` turned into `#define FOO 1` instead of `#define FOO`
2023-12-19cmake: Handle compiler.find_library returning NoneDylan Baker1-1/+5
I'm not 100% sure that warning is the appropriate action, but it's better than failing with a backtrace. Fixes: #12555
2023-12-19dependencies/base: Make MissingCompiler inherit Compiler for mypyDylan Baker1-1/+20
This allows mypy and pyright to correctly determine the return types from methods, but makes 0 changes at runtime.
2023-12-19mlog: Catch OSError when closing pagerXavier Claessens1-1/+1
For some reasons, with msys2 it sometimes raises OSError instead of BrokenPipeError. Fixes: #12541
2023-12-19clike: Deduplicate rpath linker flagsFini Jastrow1-2/+2
[why] On Apple clang 15.0.0 linker (i.e. ld64 1015.7) giving the same rpath multiple times raises a warning: ld: warning: duplicate -rpath '/local/lib' ignored This can frequently happen when linking several dependencies that all have that rpath in e.g. pkgconfig. [how] Deduplicate all rpath arguments. [note] I'm not sure how the code handles --start/end-group, but for rpath that should not make any difference as that is not bound to a group. Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2023-12-19Make the Requires.private line in generated .pkgconfig files reproducibleChris Lamb1-1/+1
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-19Generate release notes for 1.3.0.1.3.0Jussi Pakkanen34-298/+339
2023-11-19Bump version number for release.Jussi Pakkanen1-1/+1
2023-11-18Fix unity builds (#12452)David Seifert6-1/+31
* unity builds: correct integer ceiling division * edge case failure with unity builds: - static archive bar that gets installed, that links with another static archive foo that does not get installed - the number of files in static archive foo is divisible by unity_size would yield an error with ninja: ninja: error: 'subprojects/foo/src/libfoo.a.p/meson-generated_foo-unity1.cpp.o', needed by 'src/libbar.a', missing and no known rule to make it * unity builds: test for build failure when #files is divisible by unity_size
2023-11-17note on glib libraryalbert1-0/+2
2023-11-16Remove shebang from rewriter.pyMarcel Telka1-1/+0
2023-11-14dependencies: allow get_variable to define multiple pkgconfig definesEli Schwartz8-9/+48
It was previously impossible to do this: ``` dep.get_pkgconfig_variable( 'foo', define_variable: ['prefix', '/usr', 'datadir', '/usr/share'], ) ``` since get_pkgconfig_variable mandated exactly two (if any) arguments. However, you could do this: ``` dep.get_variable( 'foo', pkgconfig_define: ['prefix', '/usr', 'datadir', '/usr/share'], ) ``` It would silently do the wrong thing, by defining "prefix" as `/usr=datadir=/usr/share`, which might not "matter" if only datadir was used in the "foo" variable as the unmodified value might be adequate. The actual intention of anyone writing such a meson.build is that they aren't sure whether the .pc file uses ${prefix} or ${datadir} (or which one gets used, might have changed between versions of that .pc file, even). A recent refactor made this into a hard error, which broke some projects that were doing this and inadvertently depending on some .pc file that only used the second variable. (This was "fine" since the result was essentially meaningful, and even resulted in behavior identical to the intended behavior if both projects were installed into the same prefix -- in which case there's nothing to remap.) Re-allow this. There are two ways we could re-allow this: - ignore it with a warning - add a new feature to allow actually doing this Since the use case which triggered this bug actually has a pretty good reason to want to do this, it makes sense to add the new feature. Fixes https://bugs.gentoo.org/916576 Fixes https://github.com/containers/bubblewrap/issues/609
2023-11-14Bump version number for rc3.1.3.0rc3Jussi Pakkanen1-1/+1
2023-11-14type_checking: simplify error message for object validationDylan Baker1-1/+1
2023-11-14type_checking: fix typoDylan Baker1-1/+1
2023-11-13fix another regression in converting build_target kwargs to typed_kwargsEli Schwartz2-4/+7
This time we have a case where people are passing non-objects by using them as str | File, which we never warned about and silently accepted. If it was passed via custom_target outputs we *would* error out, interestingly enough. At the backend layer, we just pass them directly to the linker... which is valid, if we misdetected what's a valid linker input or people just used funny names. In particular, the mingw toolchain allows passing a *.def file directly, and some people are doing that. If we do want to allow this, we should do it consistently. For now, just follow the current theme of what's expected, but do so by warning instead of fatally erroring, for cases where users were able to do it in the past.
2023-11-13rust: Add transitive dependencies to ninja rulesXavier Claessens5-4/+31
In the case r1 -> s1 -> s2 where s1 and s2 are uninstalled C static libraries, the libs1.a rule does not depend on libs2.a. That means that r1 rule must depend on both s1 and s2.
2023-11-12CI: adapt to renamed fedora package when building updated imagesEli Schwartz1-1/+1
2023-11-12fix regression in converting build_target kwargs to typed_kwargsEli Schwartz2-1/+9
We haven't actually verified that these kwargs are equal to what we had before, and should probably revert the entire series. But I have multiple reports in the wild of projects that no longer build because of `install: [true, false, get_option('foobar')]` which was always incorrect and always equal to just dropping values all over the floor and treating it the same as "bool(value) == True". Special case this particular typed kwarg and allow it with a sternly worded warning that it was always wrong and should never ever ever be done. Fixes: https://bugs.gentoo.org/917118 Fixes: http://qa-logs.debian.net/2023/11/11/rhythmbox_3.4.7-1_unstable_meson-exp.log Thanks to the Gentoo Tinderbox project, and Lucas Nussbaum of the Debian project.
2023-11-12Renumber test dirs for rc3.Jussi Pakkanen100-17/+17
2023-11-12Handle dupe number in test renumberer.Jussi Pakkanen1-0/+2
2023-11-12Merge pull request #12485 from xclaesse/rust-link-regressJussi Pakkanen16-107/+204
rust: Fix linking with C libraries in subdir
2023-11-10mtest: -C argument does not need type convertorXavier Claessens1-3/+0
It is already done by RealPathAction and mypy started complaining about it.
2023-11-10msvc: Do not include pch obj when b_pch=falseXavier Claessens1-1/+1
Fixes: #12494
2023-11-09rust: Make sure -l and -L are a single argXavier Claessens1-4/+3
CompilerArgs would otherwise dedup and reorder them.
2023-11-09rust: Fix linking with C libraries (again)Xavier Claessens16-83/+163
Pass link arguments directly down to linker by using `-C link-args=` instead of letting rustc/linker resolve `-l` arguments. This solves problems with e.g. +verbatim not being portable. Note that we also pass `-l` args as `-Clink-args=-l` because rustc would otherwise reorder arguments and put `-lstdc++` before `-Clink-args=libfoo++.a`. However, when building a rlib/staticlib we should still use `-l` arguments because that allows rustc to bundle static libraries we link-whole. In that case, since there is no platform specific dynamic linker, +verbatim works. This also fix installed staticlib that now bundle uninstalled static libraries it links to (recursively). This is done by putting them all into self.link_whole_targets instead of putting their objects into self.objects, and let rustc do the bundling. This has the extra advantage that rustc can bundle static libries built with CustomTarget. Disable bundling in all other cases, otherwise we could end up with duplicated objects in static libraries, in diamond dependency graph case. Fixes: #12484
2023-11-09build: Add dummy base class for CustomTarget and CustomTargetIndexXavier Claessens1-3/+22
CustomTarget and CustomTargetIndex often have to be special cased because they are not subclass of BuildTarget. It's easier to introduce a dummy base class. This fix recursive functions over link targets that might encouters libraries built as CustomTarget.
2023-11-09build: Simplify recursive function that extracts objects in link_wholeXavier Claessens1-19/+18
2023-11-07Prohibit symlinks in test data dir because they get mangled by setup.py.Jussi Pakkanen8-3/+30
2023-11-06ci: Add arm rust toolchain in ubuntu-rolling imageXavier Claessens1-0/+1
2023-11-06tests: skip llvm modules test more thoroughlyEli Schwartz1-1/+1
The bug that is referenced in the SKIP message was merged in time for the most recent llvm 16.x release. However, due to the graciousness of the LLVM developers, a very reasonable response was taken: LLVM will not merge ("the average"?) bugfixes during the final point release of a release series, as judged by their willingness to continue maintaining a major release of LLVM (????????) because merging a bugfix could theoretically cause a new bug instead and that Simply Is Not Doneâ„¢. It could result in truly tragic outcomes, like having to release another bugfix. This innovative approach to bug solving has advanced the science of computing forward by decades. Sadly, it comes at a downside: software doesn't work. At this point it becomes obvious that llvm 16 in general will simply not work with Meson, and this is "expected", so bump the version checking for our SKIP to match reality.
2023-11-06rust: Add unique metadata idXavier Claessens1-0/+1
This solves StableCrateId collision when using multiple versions of the same crate.
2023-11-06msubprojects: Fix --sourcedir argument not workingXavier Claessens1-1/+1
This is a regression caused by https://github.com/mesonbuild/meson/pull/11951. Fixes: #12466
2023-11-06Increment version number for rc2.1.3.0rc2Jussi Pakkanen2-2/+2
2023-11-05gnome module: fix invalid find_tool variable contents causing crashEli Schwartz1-1/+6
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-11-05Update Users.mdMichael Gene Brockus (Dreamer)1-0/+1
2023-11-05Adding Trilobite Data to Users.mdMichael Gene Brockus (Dreamer)1-0/+1
2023-11-04Fix visibility attribute support check for GCC on WindowsChristoph Reiter2-21/+36
has_function_attribute() depends on -Wattributes being emitted when an attribute is not supported by the compiler. In case of GCC on Window (at least) there is no warning in case the attribute is used on a declaration. Only once there is also a function definition does it emit a warning like: a.c: In function ‘foo’: a.c:8:1: warning: visibility attribute not supported in this configuration; ignored [-Wattributes] 8 | } To fix this add a dummy function definition to all visibility compiler checks in meson. The tests in "197 function attributes" only checked for positive return result on on-msvc compilers, except one special case for dllexport/dllimport. Refactor the tests a bit so one can specify also a negative expected result, and add tests for all visibility attribute variants.
2023-11-04Fine-tune the error message when trying to build outside the project rootEli Schwartz2-9/+27
We try to backtrack through the filesystem to find the correct directory to build in, and suggest this as a possible diagnostic. However, our current heuristic relies on parsing the raw file with string matching to see if it starts with `project(`, and this may or may not actually work. Instead, do a bit of recursion and parse each candidate with mparser, then check if the first node of *that* file is a project() function. This makes us resilient to a common case: where the root meson.build is entirely valid, but, the first line is a comment containing e.g. SPDX license headers and a simple string comparison simply does not cut it. Fixes the bad error message from #12441, which was supposed to provide more guidance but did not.