aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-07-16Do not run tests that use integers in versions with compiler that do not ↵removednumbersJussi Pakkanen2-32/+46
support them.
2023-07-15rust: disable overflow-checks by defaultDylan Baker5-7/+43
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 Schwartz2-7/+20
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 Rogez4-1/+27
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 Freund2-6/+19
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-13Silence some encoding warningsTristan Partin7-20/+20
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 Yavuz4-2/+121
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-13Add import instructions for filesystem moduleMiroPalmu1-0/+8
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-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 Claessens3-4/+27
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 Claessens3-1/+12
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 Schwartz3-1/+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-06CI: gracefully handle jsonschema update requiring rust to buildEli Schwartz2-2/+4
This has issues on Windows with msys2/cygwin, where we need to build it ourselves since binary wheels aren't supported on PyPI. And we don't have a rust compiler available for either one -- we may not be *able* to do so for cygwin? For msys2, the solution is pretty easy, just rely on the official msys2 packages for jsonschema, which handle both it and its dependencies for us and don't require us to compile anything. Currently they still have an older jsonschema that doesn't use rust deps at all, but that's because the new jsonschema was released today. We'll automatically catch up at some point. For cygwin, there is no rust compiler in the cygwin repository, and jsonschema there is old as the hills. I do not know if there's a good answer here, but an adequate answer is to cap jsonschema at the version we were testing with yesterday.
2023-07-06Fix typo in Disabler.mdmeator1-1/+1
2023-07-05Bump version number for rc2.1.2.0rc2Jussi Pakkanen2-2/+2
2023-07-05Renumber test dirs for rc2.Jussi Pakkanen6-2/+2
2023-07-05comp.preprocess(): Do not treat every file as assemblyXavier Claessens3-10/+14
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 Pakkanen16-84/+195
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-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 Baker2-2/+14
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-02remove CI workaround for clang+msys2Eli Schwartz1-1/+0
Reverts part of commit 4e17d60d47357b7e3a4fd772ce031cd7cd7bc57e. msys2 is now fixed, so clang works well with the python headers.
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.
2023-06-29compilers/cpp: remove special libc++ handling from the AppleClangCPPCompilerDylan Baker1-7/+1
The base implementation handles this already, with the added bonuses of caching, and having one less code path to test.
2023-06-29compilers/cpp: try to do a better job of detecting libc++ vs libstdc++Dylan Baker1-3/+31
Currently, we hardcode libc++ for MacOS (and derivatives), and libstdc++ for all other cases. Clang had some hackery to make this work in many cases. However, this doesn't always work, namely if you try to to use Rust as the linker when libc++ is required. This implementation does, as an optimization, provide a hardcoded list of OSes we know always use libc++, and otherwise will attempt to detect it. As a second optimization, the detected values are cached, so the lookup is only done once fixes: #11921
2023-06-29compilers/cpp: use a Mixin to share the stdlib flags between clang++ and g++Dylan Baker1-18/+15
Which will make subsequent work easier
2023-06-29compilers/cpp: use a list comprehension instead of a for loopDylan Baker1-9/+3
It's slightly faster, and less code
2023-06-29compilers/cpp: Actually add the search dirs to for gccDylan Baker1-1/+1
We calculate them, but then don't use them. Clang does use them, so this looks like a simple oversight
2023-06-28Bump version number for rc1.1.2.0rc1Jussi Pakkanen2-3/+3
2023-06-28Experimental 'genvslite' WIP. (#11049)GertyP16-354/+1112
* 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