Commit Graph

14558 Commits

Author SHA1 Message Date
Christoph Reiter 0762b86e59 tests: rename skip_on_jobname to expect_skip_on_jobname and skip_on_os to expect_skip_on_os
The test.json format currently has three keys related to skipping tests:

* `skip_on_jobname`
* `skip_on_os`
* `skip_on_env`

While `skip_on_env` marks the test itself as skipped, i.e. they don't get run when the
conditions are met, the other two skip options are just marking the test as "expected to be skipped"
if the conditions apply, i.e. they want to see `MESON_SKIP_TEST` in the output and things will
fail if that doesn't happen. They don't actually skip the tests as the names imply.

To make this clearer rename the keys:

* `skip_on_jobname` -> `expect_skip_on_jobname`
* `skip_on_os` -> `expect_skip_on_os`

`skip_on_env` stays the same, since that actually skips.

The docs were also confused about this, so adjust that too.
2024-03-17 04:46:26 -04:00
Jan Alexander Steffens (heftig) 05bbe45cc2 tests: Fix unit tests with high parallelism
On Arch's shiny new 48-core/96-thread build server, the
`test_install_log_content` test fails because of an unexpected
`invalid-symlink.txt` file. Apparently the test runs in parallel with
`test_install_subdir_symlinks`, which modifies the `59 install subdir`
source directory.

To fix this, make `install_subdir_invalid_symlinks` copy the entire test
into a tmpdir before modifying it.
2024-03-15 09:24:06 -07:00
Dylan Baker 6db1d2bca5 unittests: Add a helper for copying source trees
This is a useful thing to do when a test needs to modify the source
tree, as it prevents races between tests.
2024-03-15 09:24:06 -07:00
Charles Brunet dacb25db10 Improve error messages for invalid option values
By adding the option name to UserOption object, it is now possible to
display the name of the affected option when the given option value is
not valid.

Fixes #12635
2024-03-15 09:23:46 -07:00
Charles Brunet d08ef2c08b move UserArrayOption.listify_value to mesonlib
This function is used at 3 different places and it does not justify it
as being a staticmethod instead of being a free function.
2024-03-15 09:23:46 -07:00
Dylan Baker b1340e9bb1 interpreter: when overriding a dependency make its name match
Otherwise internal dependencies have auto-generated names that are not
human readable. Instead, use the name that the dependency overrides. For
example:

```meson
meson.override_dependency('zlib', declare_dependency())
dep_zlib = dependency('zlib')
assert(dep_zlib.name() == 'zlib')
```

Fixes: #12967
2024-03-15 09:15:48 -07:00
Dylan Baker 6d713e40f8 dependency: define equality and hash operators for Dependency
When a dependency is copied and its name is changed, we still need a way
to say "this is the same dependency", which we now have.
2024-03-15 09:15:48 -07:00
Xavier Claessens 18f8aeda8b rust: Get native-static-libs even when it cannot run host binaries
When rustc cannot run host binaries it does an early return which
skipped getting native-static-libs. Move that code earlier to always run
it.

While at it, failing to determine those libs is a fatal error. We would
crash later when trying to access rustc.native_static_libs attribute
otherwise.
2024-03-15 11:38:54 -04:00
Xavier Claessens c1076241af compilers: No need to pass exe_wrapper everywhere
Places where compiler needs it already have access to Environment object
and can use it directly.

This fixes mypy complaining that not all compilers have self.exe_wrapper
in run() method that got moved to base class.
2024-03-15 11:38:54 -04:00
Xavier Claessens 6b569527bc compilers: Allow setting env and workdir for run checks
This is not exposed in API, but will be used internally.
2024-03-15 11:38:54 -04:00
Xavier Claessens b1358ef61f compilers: Do not dump File content in log for compiler checks.
When doing a compiler check with a File object, there is no need to dump
the file into logs, we can just print the path. The file could
potentially be big.
2024-03-15 11:38:54 -04:00
Xavier Claessens f41a95ddf2 compilers: Every compiler can run code
Compiling and linking code is part of the Compiler base class, there is
no reason it cannot also run executables.
2024-03-15 11:38:54 -04:00
Xavier Claessens 3afbe042af wayland: Stable protocols can have a version
Fixes: #12968
2024-03-15 09:24:46 -04:00
Xavier Claessens 4d3fb88753 cargo: Add API version into dependency name 2024-03-15 09:21:58 -04:00
Xavier Claessens 3f73aaed2d cargo: Ensure Dependency.package always has a value 2024-03-15 09:21:58 -04:00
Yegor Yefremov bc91eb5814 interpreterobjects.py: fix a typo
Use a capital letter at the beginning of a sentence.
2024-03-14 06:27:53 -04:00
Jussi Pakkanen 0b7b4a3d9e Generate relnotes for 1.4.0. 2024-03-13 21:44:41 +02:00
Sam James 675b47b069
compilers: cpp: improve libc++ vs libstdc++ detection (again)
The previous approach wasn't great because you couldn't control what the
detected C++ stdlib impl was. We just had a preference list we tweaked the
searched order for per OS. That doesn't work great for e.g. Gentoo with libc++
or Gentoo Prefix on macOS where we might be using libstdc++ even though the host
is libc++.

Jonathan Wakely, the libstdc++ maintainer, gave a helpful answer on how
to best detect libc++ vs libstdc++ via macros on SO [0]. Implement it.

TL;DR: Use <version> from C++20 if we can, use <ciso646> otherwise. Check for
_LIBCPP_VERSION as libstdc++ doesn't always define a macro.

[0] https://stackoverflow.com/a/31658120

Signed-off-by: Sam James <sam@gentoo.org>
Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
2024-03-13 00:56:33 -04:00
Petr Machacek eb74bb8dbf Added support for Texas Instruments C6000 compiler. 2024-03-12 20:38:30 +02:00
Jussi Pakkanen 7399be4ab2 Bump version number for new development. 2024-03-12 20:33:47 +02:00
Jussi Pakkanen eaefe29463 Bump version number for release. 2024-03-12 19:57:31 +02:00
Elliot e4622ff1ee
Only link to generated pch object when using msvc. (#12957)
backend: Only link to generated pch object when using msvc
2024-03-11 11:23:33 -07:00
Dylan Baker 675c323b19 CI: pin mypy to version 1.8
Version 1.9 removes support for python 3.7, so we either need to pin the
version to 1.8 as long as we're support Python 3.7, or we need to drop
linting for 3.7
2024-03-11 07:40:27 -07:00
Charles Brunet f9479787a0 fix reconfigure subproject base options 2024-03-10 13:09:32 -07:00
Charles Brunet 9e270f030f Fix detection of unknown base options in subproj
cc4cfbcad9 added detection for unknown
base options, but it was not working for subproject base options. This
should fix it.
2024-03-10 13:09:32 -07:00
David Seifert 0cd74c96f1
cuda: respect host compiler `-Werror`
The cuda compiler also executes the host compiler and generally needs to know
the host compiler flags. We did this for regular args but not for error args.
We use `-Xcompiler=` since that's how nvcc tells the difference between args
it uses itself for device code and args it passes to the host compiler.

Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
[eli: fix quoting style]
2024-03-06 14:13:07 -05:00
Xavier Claessens 5e0a3073da rust: Link with rlib external dependencies
When linking with a Rust rlib, we should also link with its external
system dependencies. This was currently done only for C ABI crates, do
it for both rlib and staticlib now.
2024-03-05 09:18:32 -05:00
Alyssa Ross a9d42a7c1e test cases/common/103 has header symbol: fix for musl 1.2.5
musl 1.2.5 exposes this symbol in the default profile, and in future
will expose it unconditionally, as it is on track to becoming part of
POSIX.

So rather than maintaining a list of systems to run this on, let's
just skip testing the feature test macro if we find ppoll in the
default profile.
2024-03-04 09:51:57 -08:00
LIU Hao 8357548ca0 doc/Users: Add asteria and mcfgthread 2024-03-04 10:51:48 -05:00
Jussi Pakkanen d532c79d9c Bump version number for rc2. 2024-03-03 23:34:21 +02:00
Jussi Pakkanen ac1d0aea58 Condense test dirs for rc2. 2024-03-03 23:33:15 +02:00
Eli Schwartz 4d1bfd0939
compilers: only wrap multiple input libraries with start/end group
When only a single input file shows up in an arglist, it makes no sense
to inject `-W,--start-group -lone -Wl,--end-group`, since there is
nothing being grouped together. It's just longer command lines for
nothing.
2024-03-03 13:42:58 -05:00
Eli Schwartz 46f3cff5b2
compilers: avoid catching -Wl,-soname and wrapping with start/end group
This is just a bad regex match, because it matches *.so as a prospective
filename input even though it is actually not an input but a linker
flag. --start-group is only relevant to input files...
2024-03-03 13:42:58 -05:00
Jussi Pakkanen 54996132af
Merge pull request #12804 from joukewitteveen/dist-rewriter
Support `meson dist` when getting project versions from VCS
2024-03-02 00:59:32 +02:00
Charles Brunet cc4cfbcad9 Fix unknown base options not detected in commandline arguments 2024-03-01 12:09:22 -08:00
Charles Brunet 76f6874e48 Fix base and compiler options not reconfigurable.
Fixes #12920.
2024-03-01 12:09:22 -08:00
Charles Brunet 4ed6d75d96 Set PYTHONIOENCODING when running tests
For instance, on Windows, if the terminal is in cp65001, the subprocess
output is not encoded correctly and it results in error when running
unit test.
2024-03-01 12:09:22 -08:00
Charles Brunet c67a6e1d7c Revert "Fix base options not reconfigurable"
This reverts commit 98db3e7a2e498a6d96ec50b39ef51ef312d6f0a3.
2024-03-01 12:09:22 -08:00
Xavier Claessens aee941559c rust: recursively pull proc-macro dependencies as well
When the proc-macro rlib is in a different subdir, it would miss the
needed -L argument and rustc would not find it. Meson was assuming that
proc-macros are only needed when building libraries that uses it, but it
turns out that was wrong, as show by the unit test.
2024-02-29 11:35:28 -05:00
David Seifert 937d1c639a nvcc: avoid adding `-Wpedantic` to compile lines
* `-Wpedantic` creates useless churn due to its use of gcc-line directives:
  ../foo.cu:1:3: warning: style of line directive is a GCC extension
      1 | namespace Foo {
        |   ^~
  https://stackoverflow.com/a/31001220
2024-02-28 19:34:39 -05:00
Eli Schwartz 95e31b756f
remove junk file from the repository root
Sider has not been used by meson for a long time. Also it appears to no
longer exist.
2024-02-28 00:20:49 -05:00
Alyssa Ross e9ee63ed03 cargo: support lib.path in Cargo.toml
Cargo implements this configuration option to override the entry point
of the library.

To get test coverage, I've modified one of the two Cargo subprojects
in the test to use a non-default library entrypoint.  The other still
uses the default.
2024-02-27 18:49:37 -05:00
Jussi Pakkanen 0dc2499b2a Bump version number for rc1. 2024-02-26 23:31:35 +02:00
Jouke Witteveen f013a68898 rewriter: allow setting values regardless of the previous type
Alterations to kwargs come in two flavors:
1. Remove/replace values (delete/set)
2. Modify values (add/remove)

Only for the second flavor do we care about the type of any existing
value.
2024-02-26 23:30:39 +02:00
Dylan Baker fb72a8ecdb docs: fix typo in snippet: "hueristic" -> "heuristic" 2024-02-26 10:15:14 -08:00
Dylan Baker 2b5c8cc6a7 modules/rust: Fix New Version check that was not updated
Should be 1.4.0 but was 1.3.0
2024-02-26 09:59:39 -08:00
Jussi Pakkanen fa2ab69e0f
Merge pull request #11867 from xclaesse/cargo-features
Cargo features
2024-02-26 19:57:16 +02:00
Jussi Pakkanen 9afe62232c Fix lint warning. 2024-02-26 19:53:16 +02:00
Jussi Pakkanen 0cd2a8dc00 Condense directory names for RC1. 2024-02-26 19:53:16 +02:00
Xavier Claessens 435e881c18 cargo: Call into meson subdir if it exists
This allows projects to manually add extra rust args and deps. This is
intended to replace build.rs logic.
2024-02-26 10:03:52 -05:00