aboutsummaryrefslogtreecommitdiff
path: root/test cases
AgeCommit message (Collapse)AuthorFilesLines
2023-07-26Fix install_data() default install pathDaniele Nicolodi5-1/+11
This fixes two issues in constructing the default installation path when install_dir is not specified: - inside a subproject, install_data() would construct the destination path using the parent project name instead than the current project name, - when specifying preserve_path, install_data() would construct the destination path omitting the project name. Fixes #11910.
2023-07-25modules/pkgconfig: Don't insert None into devenv listDylan Baker1-0/+3
When the pkgconfig module is imported, but not used, it will insert None on the end of the devenv list. This list is not expected to contain None, and causes Meson to crash. This can happen in complex build setups (reported from mesa), where pkgconfig is only used in some configurations Fixes: #12032
2023-07-23hdf5 tests: make cpp test actually use cpp HDF5George Sedov1-19/+9
the previous version didn't even link to libhdf5_cpp.so
2023-07-18tests: bump the C++ std for protobuf testsEli Schwartz1-1/+1
Based on https://opensource.google/documentation/policies/cplusplus-support Google no longer supports C++11, and protobuf spawns an `#error` if you don't have at least 14. So, perform our currently scheduled automatic bump.
2023-07-18tests: mark gpgme test skippable on Ubuntu rollingEli Schwartz1-1/+1
It has been rebuilt to no longer provide the deprecated gpgme-config tool.
2023-07-18ci: Skip test_generate_gir_with_address_sanitizerXavier Claessens1-0/+9
It fails with glib >= 2.76 and gobject-introspection <= 1.76.1. Fixes: #11754
2023-07-16Fix build using GDC 13Jussi Pakkanen2-32/+47
Do not run tests that use integers in versions with compiler that do not support them. Old versions of GDC supported plain integers in version and debug strings but they are deprecated and GDC 13 hard errors on them.
2023-07-15rust: disable overflow-checks by defaultDylan Baker4-6/+42
These result in very large binaries when linked, and are not generally useful. A user can turn them back on by passing `-C overflow-checks=yes` manually via `-Drust_args` or the `RUSTFLAGS` environment variable fixes: #11785
2023-07-14compiler.compiles/links: fix failure when compiling a built File objectEli Schwartz1-5/+12
In order to pass a File object down into the compiler impl and compile it, we cannot pass a string with the filename, and we cannot either pass the File object as-is, since it relies on being given Environment attributes to calculate the relative location. So we build a fresh File object as an absolute path. But the code to do this was totally broken. Instead of using the File method to get an absolute path, we used one that expected to create builddir-relative paths... and then gave it the absolute source dir as the "relative path portion" prefix. This worked by accident as long as it wasn't a built File, but if it was a built file then we intentionally didn't include that prefix -- which was wrong anyway, since we need the build directory! Use the correct method to get an absolute path in all cases, and emit a warning if it was a built file. This never worked. Sometimes it crashed, sometimes it silently returned false. Fixes #11983
2023-07-13cmake: fix directory separators in generated packageConfig.cmake filesMatthieu Rogez3-0/+25
On windows, meson would mix posix and windows dir separators in the computed PACKAGE_RELATIVE_PATH. Here we force posix directory separator even on Windows. This matches the CMake behavior and fixes interpretation of the resulting path. Fixes #6955 Fixes #9702
2023-07-13Silence some encoding warningsTristan Partin2-4/+4
By specifiying explicit encodings, we can silence warnings like: /__w/meson/meson/test cases/common/100 postconf with args/postconf.py:15: EncodingWarning: 'encoding' argument not specified with open(input_file) as f: in CI.
2023-07-13mtest: fix unencodable XML charsNazir Bilal Yavuz2-0/+41
Replace unencodable XML chars with their printable representation, so that, xmllint can parse test outputs without error. Closes #9894 Co-authored-by: Tristan Partin <tristan@partin.io>
2023-07-10build: dependencies should come after link_with on link commandXavier Claessens1-0/+11
This fixes regression caused by https://github.com/mesonbuild/meson/commit/3162b901cab46d66a30c66a4406195523714ecdc that changes the order in which libraries are put on the link command. In addition, that commit was wrong because libraries from dependencies were processed before process_compiler() is called, which that commit wanted to avoid.
2023-07-10build: Fix linking multiple libraries and some are promotedXavier Claessens1-0/+9
When a link() is promoted to link_whole() we still have to handle the rest of the list. Fixes: #11956
2023-07-10Revert "backends: Cache creation of install data"Eli Schwartz2-0/+2
This reverts commit 904b47085fdd985175b4b2c3224f65b9d33f04d7. This is not a real bottleneck, and we want to create it thrice -- once before the backend is generated. The final install data needs to be created fresh. Update unittest to demonstrate the issue. Fixes https://bugs.gentoo.org/910050
2023-07-05Renumber test dirs for rc2.Jussi Pakkanen4-0/+0
2023-07-05comp.preprocess(): Do not treat every file as assemblyXavier Claessens2-1/+4
Fixes: #11940
2023-07-05Merge pull request #11742 from xclaesse/link-whole-casesJussi Pakkanen7-3/+72
Fix niche cases when linking static libs
2023-07-04tests: add standard option to get_define() testKacper Michajłow1-0/+10
This properly tests MSVC case which produce different preprocessed output depending on language version.
2023-06-28Experimental 'genvslite' WIP. (#11049)GertyP2-0/+15
* Capture all compile args from the first round of ninja backend generation for all languages used in building the targets so that these args, defines, and include paths can be applied to the .vcxproj's intellisense fields for all buildtypes/configurations. Solution generation is now set up for mutiple build configurations (buildtypes) when using '--genvslite'. All generated vcxprojs invoke the same high-level meson compile to build all targets; there's no selective target building (could add this later). Related to this, we skip pointlessly generating vcxprojs for targets that aren't buildable (BuildTarget-derived), which aren't of interest to the user anyway. When using --genvslite, no longer inject '<ProjectReference ...>' dependencies on which a generated .vcxproj depends because that imposes a forced visual studio build dependency, which we don't want, since we're essentially bypassing VS's build in favour of running 'meson compile ...'. When populating the vcxproj's shared intellisense defines, include paths, and compiler options fields, we choose the most frequent src file language, since this means more project src files can simply reference the project shared fields and fewer files of non-primary language types need to populate their full set of intellisense fields. This makes for smaller .vcxproj files. Paths for generated source/header/etc files, left alone, would be added to solution projects relative to the '..._vs' build directory, where they're never generated; they're generated under the respective '..._[debug/opt/release]' ninja build directories that correspond to the solution build configuration. Although VS doesn't allow conditional src/header listings in vcxprojs (at least not in a simple way that I'm aware of), we can ensure these generated sources get adjusted to at least reference locations under one of the concrete build directories (I've chosen '..._debug') under which they will be generated. Testing with --genvslite has revealed that, in some cases, the presence of 'c:\windows\system32;c:\windows' on the 'Path' environment variable (via the make-style project's ExecutablePath element) is critical to getting the 'meson compile ...' build to succeed. Not sure whether this is some 'find and guess' implicit defaults behaviour within meson or within the MSVC compiler that some projects may rely on. Feels weird but not sure of a better solution than forcibly adding these to the Path environment variable (the Executable Path property of the project). Added a new windows-only test to windowstests.py ('test_genvslite') to exercise the --genvslite option along with checking that the 'msbuild' command invokes the 'meson compile ...' of the build-type-appropriate-suffixed temporary build dir and checks expected program output. Check and report error if user specifies a non-ninja backend with a 'genvslite' setup, since that conflicts with the stated behaviour of genvslite. Also added this test case to 'WindowsTests.test_genvslite' I had problems tracking down some problematic environment variable behaviour, which appears to need a work-around. See further notes on VSINSTALLDIR, in windowstests.py, test_genvslite. 'meson setup --help' clearly states that positional arguments are ... [builddir] [sourcedir]. However, BasePlatformTests.init(...) was passing these in the order [sourcedir] [builddir]. This was producing failures, saying, "ERROR: Neither directory contains a build file meson.build." but when using the correct ordering, setup now succeeds. Changed regen, run_tests, and run_install utility projects to be simpler makefile projects instead, with commands to invoke the appropriate '...meson.py --internal regencheck ...' (or install/test) on the '[builddir]_[buildtype]' as appropriate for the curent VS configuration. Also, since the 'regen.vcxproj' utility didn't work correctly with '--genvslite' setup build dirs, and getting it to fully work would require more non-trivial intrusion into new parts of meson (i.e. '--internal regencheck', '--internal regenerate', and perhaps also 'setup --reconfigure'), for now, the REGEN project is replaced with a simpler, lighter-weight RECONFIGURE utility proj, which is unlinked from any solution build dependencies and which simply runs 'meson setup --reconfigure [builddir]_[buildtype] [srcdir]' on each of the ninja-backend build dirs for each buildtype. Yes, although this will enable the building/compiling to be correctly configured, it can leave the solution/vcxprojs stale and out-of-date, it's simple for the user to 'meson setup --genvslite ...' to fully regenerate an updated, correct solution again. However, I've noted this down as a 'fixme' to consider implementing the full regen behaviour for the genvslite case. * Review feedback changes - - Avoid use of 'captured_compile_args_per_buildtype_and_target' as an 'out' param. - Factored a little msetup.py, 'run(...)' macro/looping setup steps, for genvslite, out into a 'run_genvslite_setup' func. * Review feedback: Fixed missing spaces between multi-line strings. * 'backend_name' assignment gets immediately overwritten in 'genvslite' case so moved it into else/non-genvslite block. * Had to bump up 'test cases/unit/113 genvslites/...' up to 114; it collided with a newly added test dir again. * Changed validation of 'capture' and 'captured_compile_args_...' to use MesonBugException instead of MesonException. * Changed some function param and closing brace indentation.
2023-06-28Condense test directory names for release.Jussi Pakkanen5-0/+0
2023-06-27rust: Override the default MSVCRT when linking Rust and !rust togetherDylan Baker1-0/+15
Rust by default links with the default MSVCRT, (dynamic, release). MSVCRT's cannot be mixed, so if Meson compiles a C or C++ library and links it with the debug MSVCRT, then tries to link that with the Rust library there will be failures. There is no built-in way to fix this for rustc, so as a workaround we inject the correct arguments early in the linker line (before any libs at least) to change the runtime. This seems to work and is recommended as workaround in the upstream rust bug report: https://github.com/rust-lang/rust/issues/39016. Given that this bug report has been opened since 2017, it seems unlikely to be fixed anytime soon, and affects all (currently) released versions of Rust.
2023-06-27rust: get stdlib arguments for non-rust languages when linkingDylan Baker4-0/+59
Otherwise we might not get things like libstdc++, which we need.
2023-06-27modules/rust: Add a keyword argument to pass extra args to the rust compilerDylan Baker2-5/+12
This may be necessary to, for example, stop rustc complaining about unused functions
2023-06-27modules/rust: Add a `link_with` kwarg to the test methodDylan Baker3-0/+23
This was requested by Mesa, where a bunch of `declare_dependency` objects are being created as a workaround for the lack of this keyword
2023-06-26mintro: record subproject in install_planDaniele Nicolodi4-0/+9
2023-06-26Revert "modules: move gnome targets into gnome module"Eli Schwartz1-4/+1
This reverts commit a2def550c586aeba4269588e79a1a308467f2582. This results in a 2k line file being unconditionally imported at startup, and transitively loading two more (for a total cost of 2759 lines of code), and it's not clear it was ever needed to begin with...
2023-06-26linkers: delay implementations import until detect is runEli Schwartz1-1/+1
This saves on a 1500-line import at startup and may be skipped entirely if no compiled languages are used. In exchange, we move the implementation to a new file that is imported instead. Followup to commit ab20eb5bbc21ae855bcd211131132d2778602bcf.
2023-06-26stop importing cmake when it isn't usedEli Schwartz1-17/+2
We don't need a CMakeInterpreter until and unless we actually attempt to use a cmake subproject via the cmake module. Minus 10 files and 3679 lines of code imported at startup.
2023-06-26dependencies: defer importing a custom dependency until it is usedEli Schwartz1-17/+1
This lessens the amount of code imported at Meson startup by mapping each dependency to a dictionary entry and using a programmable import to dynamically return it. Minus 16 files and 6399 lines of code imported at startup.
2023-06-26dependencies: delay often-unused importsEli Schwartz1-2/+1
We expose detect.py as the mesonbuild.dependencies entrypoint and import it upfront everywhere. But unless the `dependency()` function is actually invoked, we don't need *any* of the private implementations for this. Avoid doing so until, as part of actual dependency lookup, we attempt that specific dependency method. This avoids importing big modules if `method:` is specified, and in most cases hopefully pkg-config works and we can avoid importing the cmake implementation particularly. Actually avoiding most of these imports requires more refactoring. But even so, the garden path no longer needs to import the dub dependency impl.
2023-06-26add profiling startup import check and testcase to count itEli Schwartz2-0/+278
2023-06-21rust: fix -C prefer-dynamic behaviorAlyssa Ross1-1/+2
I noticed when building a project that uses a proc macro that Meson passed -C prefer-dynamic for the executable, and not the proc macro, while cargo passed -C prefer-dynamic for the proc macro, but not for the executable. Meson's behavior broke setting -C panic=abort on the executable. As far as we can tell, because we explicitly pass each library path to rustc, the only thing -C prefer-dynamic affects in Meson is how the standard libraries are linked. Generally, one does not want the standard libraries to be dynamically linked, because if the Rust compiler is ever updated, anything linked against the old standard libraries will likely break, due to the lack of a stable Rust ABI. Therefore, I've reorganised Meson's behavior around the principle that the standard libraries should only be dynamically linked when Rust dynamic linking has already been opted into in some other way. The details of how this manifests are now explained in the documentation.
2023-06-20interpreter: Accept more types in default_options dict valuesXavier Claessens3-0/+27
2023-06-20add str.splitlines methodMartin Dørum1-0/+12
The new splitlines method on str is intended to replace usage of fs.read('whatever').strip().split('\n'). The problem with the .strip().split() approach is that it doesn't have a way to represent empty lists (an empty string becomes a list with one empty string, not an empty list), and it doesn't handle Windows-style line endings.
2023-06-07tests: remove unnecessary non-meson syntax from meson.buildEli Schwartz1-2/+2
We don't use parentheses for the if function, because it's not a function.
2023-06-07tests: update llvm version exclusions for hopefully the last timeEli Schwartz1-6/+4
This is now fixed upstream and expected to be backported to the next point release.
2023-06-07tests: be DRY in llvm framework testEli Schwartz1-14/+15
It's a lot more readable to not repeat big arrays.
2023-06-07tests: avoid hard to debug error when llvm is found with only one methodEli Schwartz1-1/+1
In commit 89146e84c9eab649d3847af101d61047cac45765 we added some complicated code to verify the llvm framework's "combination" matrix lookup. It expects to find llvm with both cmake and config-tool, with the same version. But the sanity check is wonky -- it checks that both have the same found status, instead, so if both are not found then we proceed to try to convert the string "unknown" to a mapping of semver integers, and this is guaranteed to fail. This can happen for example if the system llvm exists in the general case, but actual modules cannot be found because the system llvm does not distribute static modules. For example, this is the case on Gentoo. Abort more obviously by just insisting that both be found. If they aren't both found, then investigative efforts know to look at why they weren't found.
2023-06-01pkgconfig: Add include directories from internal deps in -uninstalled.pcXavier Claessens6-0/+29
Fixes: #8651
2023-05-31preprocess: Allow preprocessing any file extensionsXavier Claessens1-3/+3
2023-05-28tests: bump java compat level up to 8Eli Schwartz1-2/+2
Fedora's java package no longer supports 7.
2023-05-28Fix test failures on Darwin on a case-sensitive fsRandy Eckenrode3-3/+3
This issue was encounetered while working on a contribution to nixpkgs. Nix allows the store to be installed on a separate, case-sensitive APFS volume. When the store is on a case-sensitive volume, these tests fail because they try to use `foundation` instead of `Foundation`.
2023-05-23llvm: Bump broken micro version for CINirbheek Chauhan1-2/+2
16.0.4 didn't fix the LLVM breakage.
2023-05-23qt: Allow specifying separate tools for qt4/5/6Nirbheek Chauhan1-1/+2
Currently you can only use one of qt4, qt5, qt6 in a single project when using a machine file because the config-tool lookup for qt only looks at `qmake` in the machine files, instead of looking up the binary names directly. Allow specifying `qmake` `qmake4` `qmake5` and `qmake6`. This is necessary for gstreamer, which can build separate qt5 and qt6 plugins that are distributed as static libraries, so the user can pick which one to use.
2023-05-21Allow generator.process(generator.process(...))Volker Weißmann4-0/+32
Fixes #1141
2023-05-20rust: Add system libs used by rust std to staticlib external depsXavier Claessens1-10/+0
2023-05-18Check dub version (#11794)Remi Thebault2-0/+4
* DubDependency._check_dub returns the version * check for compatible Dub version Dub versions starting at 1.32 have a new cache structure into which Meson doesn't know where to find compatible artifacts * skipping D tests involving Dub * refactor _check_dub makes mypy happier * make linters happy * localize some logic
2023-05-13Make `dependency('foo', static: true, method: 'cmake') link staticallyVolker Weißmann1-1/+2
Fixes #1709
2023-05-13Fix paths of Fortran order dependenciesVolker Weißmann4-0/+17
Fixes #11047