aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
AgeCommit message (Collapse)AuthorFilesLines
2023-07-15rust: disable overflow-checks by defaultDylan Baker1-1/+1
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-2/+8
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-14c++: add support for c++23/c++26 standard and aliasesSteven Noonan1-2/+20
GCC 12.3 and Clang 16 support -std flags for c++23/c++2b. The unreleased GCC 14 and Clang 17 will support -std flags for c++26/c++2c. Signed-off-by: Steven Noonan <steven@uplinklabs.net> Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
2023-07-14c++: add fallback mappings for C++23 and C++26Steven Noonan1-0/+4
The c++23 mappings apply to current production compilers (GCC, Clang). None of the production c++ compilers support c++26 flags yet, but this mapping will be ready once they do. Signed-off-by: Steven Noonan <steven@uplinklabs.net> Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
2023-07-13cmake: fix directory separators in generated packageConfig.cmake filesMatthieu Rogez1-1/+2
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-13macos: map arm64e to aarch64, map "whole" architecture stringsAndres Freund1-6/+14
Some macos libraries use arm64e instead of arm64 as architecture. Due to the string replace approach taken so far, we'd end up with aarch64e as architecture, which the rest of meson doesn't know. Move architecture mapping to map whole architecture names and add arm64e -> aarch64 mapping. This change doesn't touch the case for armv7[s], where we add arm, rather than replace armv7[s], but it's certainly not in line with the other mappings. Fixes: #9493 Co-authored-by: Tristan Partin <tristan@partin.io>
2023-07-13Fix display of generatorCharles Brunet2-2/+8
2023-07-13mtest: fix unencodable XML charsNazir Bilal Yavuz1-2/+29
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-12Remove do_conf_str(encoding:)Tristan Partin1-2/+2
It wasn't being used.
2023-07-12Use underscore for variables that we don't referenceTristan Partin1-3/+3
This pleases pyright/pylance and is a pattern that we use in other portions of the code.
2023-07-12Fix return type of debugfile functionsTristan Partin4-6/+6
It was returning None in some cases while being marked as returning string.
2023-07-12Add typing to portions of machine file parsingTristan Partin1-7/+8
2023-07-12Add type annotations where they previously didn't existTristan Partin2-7/+7
2023-07-12Use more specific typesTristan Partin2-9/+10
Added type arguments where needed.
2023-07-12Remove Compiler._build_wrapper(temp_dir:)Tristan Partin2-5/+4
The function wasn't using the keyword argument and all the callers were using env.scratch_dir anyway.
2023-07-12Match the method signatures of parent classesTristan Partin10-28/+28
Names and types of some methods did not match their parent methods.
2023-07-12Make CPPCompiler.get_display_language() a classmethodTristan Partin1-2/+2
This matches the parent declaration.
2023-07-12Fix the typing around Compiler._get_compile_output()Tristan Partin2-7/+7
This function says it returns a string, but was returning None in some cases.
2023-07-12Annotate naked fundamental Python typesTristan Partin17-57/+57
Although mypy wasn't complaining, pyright was.
2023-07-12Replace some type comments with annotationsTristan Partin16-251/+275
2023-07-12Use CompileCheckMode enumTristan Partin10-47/+47
There were a ton of naked strings with TODOs telling us to use the enum.
2023-07-12compilers: detect cython version on stdout for newer cython versionsEli Schwartz1-3/+9
Cython historically, when asked to print the version and exit successfully, would do so on stderr, which is weird and inconsistent. Recently, it fixed this UX bug by printing on stdout instead: https://github.com/cython/cython/issues/5504 This then broke meson detection because we assumed it was on stderr due to historically being there: https://github.com/scipy/scipy/issues/18865 Cython is right, and shouldn't have to revert this reasonable change for backwards compatibility. Instead, check both.
2023-07-12Remove type comments from compilers.pyTristan Partin1-53/+59
2023-07-12string: Add missing FeatureNew tags to methodsMarco Trevisan (TreviƱo)1-0/+4
There are some new(er) methods that have not version reference, so add the missing ones in order to be properly notified when targetting older meson versions. Co-authored-by: Tristan Partin <tristan@partin.io>
2023-07-11compilers/cpp: check libc++ vs libstdc++ harderDylan Baker1-14/+11
Instead of hardcoding any values, hardcode what we think the most likely implementation is, and check that first. It was pointed out that while for example, Apple only provides libc++ and supports that for xcode, a user could install a custom environment (such as homebrew) which uses it's own copy of libstdc++, and we need to account for that. This means that a library search will be done, but only once and the result will be cached, on all systems.
2023-07-11Bump version number for rc3.1.2.0rc3Jussi Pakkanen1-1/+1
2023-07-10mtest: avoid stdout when printing warnings about the lack of things to printEli Schwartz1-4/+4
Since people may parse the output of `--list` as a list of tests, putting logging info in stderr is nicer.
2023-07-10mtest: redirect automatic reconfiguring to stderr when listing testsEli Schwartz1-1/+2
It is not the primary purpose of mtest, and it ends up mingled with a list of actual tests, which isn't nice if you're trying to capture and parse this.
2023-07-10mtest: try a bit harder to avoid weird non-parseable output at startupEli Schwartz1-3/+5
In commit 628effb3698e85e403351d2705d576cf4ee8c50c we started verifying the build.ninja file was up to date before even `--list`ing tests, because we could end up with incorrect information. This meant that ninja always runs at startup, and typically returns "no work to do", which ended up listed as "one of" the tests. Instead of unconditionally running ninja attached to the console, first check it in dry-run mode with stdout intercepted, to see if ninja considers itself up to date. If it is, continue. Only if an actual refresh is needed, do we run it while attached to the console. In the garden path, this avoids useless information. In cases where we'd already print a full meson reconfigure log, we continue to do so.
2023-07-10windows: Fix detection of the llvm-rc resource compilerMartin Storsjƶ1-0/+1
By default, clang-cl based environments use rc.exe as resource compiler. However, when cross compiling with clang-cl, one might want to use llvm-rc instead. Try to detect llvm-rc based on the output from "$CMD /?". This requires a very recent llvm-rc; previosly, the output of "/?" with llvm-rc was very generic and didn't explicitly indicate that it actually was llvm-rc. This was changed in https://github.com/llvm/llvm-project/commit/bab6902eba55026a829d232629f99ac276936ef0 which will be included in the upcoming LLVM 17.0.0 release. Contrary to the other regexes, don't include the preceding parts of the line in the log printout, as it includes an unhelpful "OVERVIEW:" prefix.
2023-07-10build: dependencies should come after link_with on link commandXavier Claessens1-4/+15
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-1/+2
When a link() is promoted to link_whole() we still have to handle the rest of the list. Fixes: #11956
2023-07-10Fix Xcode 15 beta linker detection. Closes #11958.Jussi Pakkanen1-1/+1
2023-07-10parse meson.build for subproject_dir in msubprojectsRafael Silva1-3/+10
we parse project from source meson.build with IntrospectionInterpreter
2023-07-10rename msubprojects src_dir to source_dirRafael Silva1-7/+6
source_dir seems to be the most common name across the code base with 400+ hits
2023-07-10wrap: detect network timeouts 20x fasterEli Schwartz1-1/+1
When downloading wrap content, we need to know at some point if the server is going to respond with "hello, yes, I'm here and I have data for you". The alternative is to sometimes infinitely hang. In commit 8f7781f1d6bf36c064b39e7d0794c686f1b78665 we added such a timeout, but using an extremely generously high number -- ten minutes. We don't need to wait this long just to find out if the other end exists, so decrease that time to 30 seconds, whch is still ludicrously generous but not quite as much so.
2023-07-10backends: Always take options from targetXavier Claessens4-30/+32
This fixes cases where override_options is not being used. Fixes: #11923
2023-07-10Revert "backends: Cache creation of install data"Eli Schwartz1-1/+0
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-05Bump version number for rc2.1.2.0rc2Jussi Pakkanen1-1/+1
2023-07-05comp.preprocess(): Do not treat every file as assemblyXavier Claessens1-9/+10
Fixes: #11940
2023-07-05build: use self.compilers instead of all_compilers for stdlib langsDylan Baker1-1/+4
We need a union of the compilers used by the target, and by those used by all dependencies, not all the compilers in all projects. We do, however, need to look compilers up from all possible compilers, as a dependency that is a subproject could use a language not present in the current project.
2023-07-05Merge pull request #11742 from xclaesse/link-whole-casesJussi Pakkanen7-79/+105
Fix niche cases when linking static libs
2023-07-04compilers: strip get_define outputKacper Michajłow1-1/+1
Fixes get_define() for MSVC. cl with /std:c11 and newer add a trailing space character when substituting, even if macro is empty. This breaks parsing preprocessed output to extract value. Since they cannot contain spaces it is safe to simply strip parsed value. Fixes: #10179
2023-07-04Merge pull request #11924 from dcbaker/submit/c++stdlib-fixesJussi Pakkanen1-31/+44
Do a better job of detecting libc++ vs libstdc++
2023-07-04environment: separate illumos and Solaris kernels in MachinesDylan Baker1-1/+12
While both kernels are derived from the OpenSolaris project of Sun, they have diverged and code that works with one may not work with the other. As such, we should provide different values for them. This was requested by both Oracle and the illumos upstreams. Fixes: #11922
2023-07-03fix the use of setup --profile-self in combination with --genvsliteDan Hawson1-2/+4
After the recent change to the backend `generate(...)` signature for '--genvslite', `profile.runctx('...')` needs to construct the correct cmd string and also extract the return result from `locals()`.
2023-07-02genvslite: greatly simplify the implementation of non-genvslite backendsEli Schwartz6-45/+30
By avoiding Java-style variable naming, the code becomes considerably more readable while simultaneously becoming *more* easy to understand. It's no longer necessary to ask questions like "what's a captured buildtype" when trying to read through the code for a backend, because it can be dismissed as not relevant to the current context by re-reading it as "context for vslite". The primary goal here has been to revert regressions in the developer experience for users of the ninja backend, so there may still be issues in vs2010backend.py Post-facto application of issues that were raised during review, ignored, and merged despite such.
2023-07-02genvslite: fix badly overflowing line lengthsEli Schwartz2-2/+6
Function comments that overflow the screen width by coming after code, instead of on their own line, are hard to read. Same applies to message strings that are all on one line. Fix by reflowing them. Post-facto application of issues that were caught during post-merge review, after the genvslite PR was merged without a full review.
2023-07-02genvslite: improve readability of the mconf help textEli Schwartz1-3/+2
The option description has a lot of data packed into it, which is squeezed into a small, hard to read column. Give a bit less information, focusing on essentials, to make it fit better. Post-facto application of issues that were caught during post-merge review, after the genvslite PR was merged without a full review.
2023-07-02genvslite: fix the core option being listed as one of the per-project optionsEli Schwartz1-0/+1
Post-facto application of issues that were caught during post-merge review, after the genvslite PR was merged without a full review.