aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2024-03-29Update Pip install documentation.quickfixJussi Pakkanen1-9/+10
2024-03-28compilers: cpp: reduce macro pollution for stdlib macrosSam James1-15/+20
Now that we have access to Environment in get_assert_args, we can check what the actual C++ stdlib provider is and only set relevant macros rather than all possibly-relevant ones based on the compiler. Also, while we're here, now that's sorted, wire up the GCC experimental libc++ support in the macro emission given it doesn't uglify anything for libstdc++ users now. Bug: https://github.com/mesonbuild/meson/issues/12962 Signed-off-by: Sam James <sam@gentoo.org> Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
2024-03-28compilers: cpp: factor out C++ stdlib detectionSam James1-5/+8
We're going to use it in some more places in a minute (for controlling assertions). Bug: https://github.com/mesonbuild/meson/issues/12962 Signed-off-by: Sam James <sam@gentoo.org> Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
2024-03-28Pass Environment down from BackendSam James8-16/+16
We'll need it in a moment for get_base_compile_args -> get_assert_args. Bug: https://github.com/mesonbuild/meson/issues/12962 Signed-off-by: Sam James <sam@gentoo.org> Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
2024-03-28compilers: cpp: don't set stdlib assertion macros if already setSam James1-0/+11
Followup to 90098473d51e6f059e775f1833b0a2ea91c8f8f9. If the compiler already has one of these assertion macros [0] set, then don't interfere. e.g. a Linux distribution might be setting a stricter default than usual. This is a pitfall many fell into with _FORTIFY_SOURCE and it's why AX_ADD_FORTIFY_SOURCE [1] was contributed to autoconf-archive. [0] _GLIBCXX_ASSERTIONS, _LIBCPP_HARDENING_MODE, or _LIBCPP_ENABLE_ASSERTIONS. [1] https://www.gnu.org/software/autoconf-archive/ax_add_fortify_source.html Bug: https://github.com/mesonbuild/meson/issues/12962 Signed-off-by: Sam James <sam@gentoo.org> Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
2024-03-28compilers: cpp: relax assertion level for libc++Sam James1-1/+1
Followup to 90098473d51e6f059e775f1833b0a2ea91c8f8f9. I changed my mind on this a few times. libcxx's documentation describes [0] the hardening modes as: """ 1) Unchecked mode/none, which disables all hardening checks. 2) Fast mode, which contains a set of security-critical checks that can be done with relatively little overhead in constant time and are intended to be used in production. We recommend most projects adopt this. 3) Extensive mode, which contains all the checks from fast mode and some additional checks for undefined behavior that incur relatively little overhead but aren’t security-critical. Production builds requiring a broader set of checks than fast mode should consider enabling extensive mode. The additional rigour impacts performance more than fast mode: we recommend benchmarking to determine if that is acceptable for your program. 4) Debug mode, which enables all the available checks in the library, including internal assertions, some of which might be very expensive. This mode is intended to be used for testing, not in production. """ We chose 3) before because it felt like a better fit for what we're trying to do and the most equivalent option to libstdc++'s _GLIBCXX_ASSERTIONS, but on reflection, maybe we're better off picking a default with less overhead and more importantly guarantees constant time checks. [0] https://libcxx.llvm.org/Hardening.html#using-hardening-modes Bug: https://github.com/mesonbuild/meson/issues/12962 Signed-off-by: Sam James <sam@gentoo.org> Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
2024-03-28tests: don't expect msys2 llvm cmake tests to skip with llvm 18Christoph Reiter1-2/+2
They were skipped with llvm 17 based on the version, and they are now no longer skipped with v18 and also pass now. This depends on #12964 for llvm 18 support in meson.
2024-03-27interpreter/type_checking: remove stale TODO commentDylan Baker1-1/+0
2024-03-27interpreter: fix return type annotation of helperDylan Baker1-1/+1
2024-03-20fix: set `MSAN_OPTIONS` when not set, rather than `UBSAN_OPTIONS`Christopher Dilks1-1/+1
2024-03-20mesonlib: Fix bug in relpath return values found by mypyNirbheek Chauhan1-2/+2
2024-03-20devenv: Don't use Path.relative_to() to resolve relative pathsNirbheek Chauhan1-2/+2
It's utterly broken, and only works when one path is inside the other: Traceback (most recent call last): File "/usr/lib/python3.12/site-packages/mesonbuild/mesonmain.py", line 194, in run return options.run_func(options) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/site-packages/mesonbuild/mdevenv.py", line 188, in run write_gdb_script(privatedir, install_data, workdir) File "/usr/lib/python3.12/site-packages/mesonbuild/mdevenv.py", line 142, in write_gdb_script rel_path = gdbinit_path.relative_to(workdir_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib64/python3.12/pathlib.py", line 682, in relative_to raise ValueError(f"{str(self)!r} is not in the subpath of {str(other)!r}") ValueError: '/path/to/builddir/.gdbinit' is not in the subpath of '/path/to/workdir' ERROR: Unhandled python exception This is a Meson bug and should be reported!
2024-03-18mconf: Reload the options files if they have changedDylan Baker4-12/+45
This fixes issues where a new option is added, an option is removed, the constraints of an option are changed, an option file is added where one didn't previously exist, an option file is deleted, or it is renamed between meson_options.txt and meson.options There is one case that is known to not work, but it's probably a less common case, which is setting options for an unconfigured subproject. We could probably make that work in some cases, but I don't think it makes sense to download a wrap during meson configure.
2024-03-18coredata: add tracking of the options filesDylan Baker2-0/+13
When we load the option file in the interpreter record which file it was, and what the hash of that file was. This will let `meson configure` know that the options have changed since the last re-configure.
2024-03-18coredata: remove extraneous keys when updating project_optionsDylan Baker3-6/+16
This can happen when a project's meson.options file is updated, and an old option is removed.
2024-03-18tests: Add tests for configure on changed optionsDylan Baker1-1/+102
This demonstrates a limitation of Meson that can happen in the following situation: `meson setup builddir` <update to meson.options> (such as git pull) `meson configure -Dnew_option=value builddir` <Error> Since Meson is unaware of the updates to the meson.options file. The purposes of these tests is to fix this behavior.
2024-03-18unittests: annotate BasePlatformTests.setconfDylan Baker1-2/+4
2024-03-18cmake: fix incorrect decorator for append_link_argsStephan Lachnit1-1/+1
Signed-off-by: Stephan Lachnit <stephanlachnit@debian.org>
2024-03-17environment: update Debian development version in get_llvm_tool_names()Sam James1-1/+1
As far as we can ascertain, the idea here was supposed to be that this version at the bottom gets updated as a last-resort for development LLVMs on Debian. Signed-off-by: Sam James <sam@gentoo.org> Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
2024-03-17environment: fix LLVM 18 support in get_llvm_tool_names()Sam James1-0/+1
In 67afddbf431140c1ee064bf79a2fa5a95575488e, we added LLVM 18, but LLVM >= 18 uses a new version scheme of X.Y, not X.0.Y (where using "X" was enough). See https://discourse.llvm.org/t/rfc-name-the-first-release-from-a-branch-n-1-0-instead-of-n-0-0/75384. Without this, I get a test failure: ``` mesonbuild.interpreterbase.exceptions.InterpreterException: Assert failed: config-tool and cmake returns different major versions -> frameworks: 15 llvm (method=combination link-static=False) ``` Fixes: https://github.com/mesonbuild/meson/issues/12961 Signed-off-by: Sam James <sam@gentoo.org> Signed-off-by: Eli Schwartz <eschwartz93@gmail.com>
2024-03-17tests: rename skip_on_jobname to expect_skip_on_jobname and skip_on_os to ↵Christoph Reiter36-62/+64
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-15tests: Fix unit tests with high parallelismJan Alexander Steffens (heftig)1-12/+9
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-15unittests: Add a helper for copying source treesDylan Baker1-0/+23
This is a useful thing to do when a test needs to modify the source tree, as it prevents races between tests.
2024-03-15Improve error messages for invalid option valuesCharles Brunet16-249/+325
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-15move UserArrayOption.listify_value to mesonlibCharles Brunet3-27/+27
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-15interpreter: when overriding a dependency make its name matchDylan Baker2-2/+29
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-15dependency: define equality and hash operators for DependencyDylan Baker1-0/+12
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-15rust: Get native-static-libs even when it cannot run host binariesXavier Claessens1-9/+14
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-15compilers: No need to pass exe_wrapper everywhereXavier Claessens13-213/+163
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-15compilers: Allow setting env and workdir for run checksXavier Claessens2-4/+8
This is not exposed in API, but will be used internally.
2024-03-15compilers: Do not dump File content in log for compiler checks.Xavier Claessens1-7/+3
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-15compilers: Every compiler can run codeXavier Claessens6-52/+35
Compiling and linking code is part of the Compiler base class, there is no reason it cannot also run executables.
2024-03-15wayland: Stable protocols can have a versionXavier Claessens2-8/+21
Fixes: #12968
2024-03-15cargo: Add API version into dependency nameXavier Claessens14-22/+82
2024-03-15cargo: Ensure Dependency.package always has a valueXavier Claessens1-19/+20
2024-03-14interpreterobjects.py: fix a typoYegor Yefremov1-1/+1
Use a capital letter at the beginning of a sentence.
2024-03-13Generate relnotes for 1.4.0.Jussi Pakkanen16-88/+112
2024-03-13compilers: cpp: improve libc++ vs libstdc++ detection (again)Sam James1-11/+8
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-12Added support for Texas Instruments C6000 compiler.Petr Machacek10-16/+72
2024-03-12Bump version number for new development.Jussi Pakkanen1-1/+1
2024-03-12Bump version number for release.1.4.0Jussi Pakkanen1-1/+1
2024-03-11Only link to generated pch object when using msvc. (#12957)Elliot3-1/+11
backend: Only link to generated pch object when using msvc
2024-03-11CI: pin mypy to version 1.8Dylan Baker1-1/+2
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-10fix reconfigure subproject base optionsCharles Brunet8-29/+51
2024-03-10Fix detection of unknown base options in subprojCharles Brunet4-2/+9
cc4cfbcad92945a1629c80664e1eb755c68905dd added detection for unknown base options, but it was not working for subproject base options. This should fix it.
2024-03-06cuda: respect host compiler `-Werror`David Seifert1-1/+3
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-05rust: Link with rlib external dependenciesXavier Claessens4-3/+25
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-04test cases/common/103 has header symbol: fix for musl 1.2.5Alyssa Ross1-4/+2
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-04doc/Users: Add asteria and mcfgthreadLIU Hao1-0/+2
2024-03-03Bump version number for rc2.1.4.0rc2Jussi Pakkanen2-2/+2