aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-09-23mlog: disable usage of global for log_pagerXavier Claessens1-2/+2
2022-09-23CI: don't set BOOST_ROOT to an empty stringChristoph Reiter1-1/+0
This was initially added in eb76ba7031f053a3c1 to avoid picking it up from azure/gha images. Looks like it is no longer set for some time now though: https://github.com/actions/runner-images/pull/540 so should no longer be needed. The empty string makes some meson tests fail which expect a path. A recent msys2-runtime change now lets empty env vars through to child processes whereas before they would get filtered out, which is why this worked before.
2022-09-23Revert "CI: Add a temporary workaround for broken MSYS2 Python path ↵Christoph Reiter1-3/+0
separator behaviour" This reverts commit 3fd2459a748cc9eed4be73132b002400da81cb0a. The underlying issue has been fixed and deployed: https://github.com/msys2-contrib/cpython-mingw/pull/107
2022-09-22pylint: enable global-statementDylan Baker8-19/+13
This does force a number of uses of `# pylint: disable` comments, but it also finds a couple of useless global uses and one place (in the previous commit) that an easy refactor removes the use of global. Global is a code smell, so forcing adding a comment to disable helps force developers to really consider if what they're doing is a good idea.
2022-09-22pylint: enable global-variable-not-assignedDylan Baker4-4/+0
The `global` statement is only needed to assign to global variables, not read or mutate them. So calling `global.mutate()` is fine, but not `var = foo`, which would otherwise shadow `var`.
2022-09-22modules/gnome: make_native_glib_version an instance varDylan Baker2-14/+8
This removes the need for the use of the global statement. I've also updated the test that overrides this to use mock.patch instead of hand monkey patching.
2022-09-22compilers: unify fortran sanity check with its parent Clike handlingEli Schwartz2-40/+14
We *mostly* just need to do the same thing. Plug in one utility method to make sanity_check_impl find the right compile args, and plug in DEVNULL to the test run. It's that simple. This solves a few inconsistencies. The main one is that fortran never logged the sanity checks to the Meson debug log, making it hard to debug. There's also some interesting quirks we built up in the dedicated fortran handling. For example: - in commit 5b109c9ad27aea39ce49d1da8ef0c957ccaef3b9 we added cwd to building the fortran executable, with a wordy comment about how the compiler has defects. But the clike base has always done that on general principle anyway, so we would never have had that bug in the first place. - in commit d6be7822a0a7391c9d2a22c053cd4fc61b5a71e4 we added special deletion of an old "bad existing exe file" just for fortran. Looking at the PR discussion for this odd requirement, it turns out that the real problem is mixing WSL and native Windows without deleting the build directory. This is apparently fortran specific simply because "contemporary Windows 10 Fortran users" switch between the two? The actual problem is that this never used .exe as the output name, so Windows thinks you want to run something other than the thing you asked to run, because it's not even a Window executable. But... the common clike handling could have fixed that without needing special cases.
2022-09-22use simpler subprocess.run interface instead of manual PopenEli Schwartz1-2/+1
This code dates back to 2012 and probably has no specific reason...
2022-09-22compilers: make sanity checks log commands using join_argsEli Schwartz1-3/+3
It is more correct to join commands with a command joiner than a whitespace joiner.
2022-09-22clean up message for OSError errorhandlerEli Schwartz1-6/+2
Currently it repeats the text of the exception, which appeared immediately above. And strerror is already part of args, so that was then doubled. `str(e)` formats this much better anyway. While we are at it, point out that it is probably a build environment issue, rather than just saying "this is probably not a meson bug". The former comes across a bit more as constructive advice rather than just "idk but it's not our fault".
2022-09-22fix regression in logging runpython errorsEli Schwartz1-8/+9
In commit fa044e011d5d7a3525c9b3f2acfe1cbf4a0a96a1 we caught OSError and started emitting a special error message disclaiming that it probably isn't Meson's fault, and skipping the generic "This is a meson bug and should be reported" handler. But, we no longer did this after verifying that the command *isn't* runpython, so arbitrary scripts that raised OSError would start saying stuff about Meson, which was wrong. Start checking for runpython first.
2022-09-22refactor errorhandler for deduplication of logicEli Schwartz1-23/+21
Mostly just move a comment around back to where it's more relevant, and handle MESON_FORCE_TRACEBACK once instead of twice.
2022-09-22fix regression in handling errors during reconfigureEli Schwartz1-38/+45
In commit 9ed5cfda155c585f7aea896fe2f40d3a92eac43a we refactored startup to be a bit faster and import less. But this had the side effect of moving out of our errorhandler. Refactor this so it can be easily used elsewhere.
2022-09-22CI: Add a temporary workaround for broken MSYS2 Python path separator behaviourChristoph Reiter1-0/+3
"MSYSTEM= python ..." no longer works because of some changes in the MSYS2 runtime Until this is fixed in either MinGW Python or the MSYS2 runtime this should revert things to the previous behaviour to get the CI green again.
2022-09-22Add release notes snippet for new mconf behaviourXavier Claessens1-0/+6
2022-09-22mconf: Add --no-pager optionXavier Claessens1-1/+4
2022-09-22mconf: Print options with colorsXavier Claessens1-16/+30
2022-09-22mconf: Substract the 3 space separators between columnsXavier Claessens1-1/+1
2022-09-22mconf: Do not wrap choices manuallyXavier Claessens1-19/+3
We already use textwrap.wrap() for that and it will correctly split on spaces.
2022-09-22mconf: There is always 4 columnsXavier Claessens1-21/+8
2022-09-22mlog: Add support for pagerXavier Claessens2-1/+42
It is useful to redirect some outputs, such as "meson configure" to a pager (e.h. less). This is similar to most git commands.
2022-09-22mconf: Use mlog.log() instead of print()Xavier Claessens1-13/+13
This will allow using colors and redirect print into a pager.
2022-09-21mdevenv: powershell <7.0 is EOL, prefer using pwsh.exeXavier Claessens1-5/+14
If neither pwsh.exe nor powershell.exe works, fallback to cmd.exe. This script could be failing because of virus scanner.
2022-09-21Fix cmd_or_ps.ps1 script with pwsh7Xavier Claessens1-12/+7
gwmi command does not exist any more and is replaced by Get-CimInstance. See https://github.com/PowerShell/PowerShell/issues/4766. While at it, use a do..while loop to avoid duplicated lines. Fixes: #10820
2022-09-20Fix including headers from another drive on VS backendVili Väinölä1-2/+6
Include paths to different drives as absolute paths fixes #8329
2022-09-19python module: allow specifying the pure kwarg in the installation objectEli Schwartz4-5/+36
Fixes #10523
2022-09-19pylint: enable use-dict-literalDylan Baker2-5/+4
2022-09-19pylint: enable use-list-literalDylan Baker3-3/+2
2022-09-19pylint: enable consider-using-inDylan Baker11-14/+13
2022-09-19pylint: enable use-sequence-for-iterationDylan Baker3-3/+2
This found a couple of places where we *don't* want to use set(), and want to use list() instead.
2022-09-19pylint: enable use-maxsplit-argDylan Baker8-11/+10
This finds a bunch of places where we can do more efficient string splitting.
2022-09-19pylint: enable consider-using-dict-itemsDylan Baker3-10/+8
Which found a couple of places where we could write better code.
2022-09-19pylint: move from allow-list to deny-listDylan Baker1-25/+91
This makes it much easier to see what we're ignoring, as well as allowing pylint to enforce any lints that currently pass but aren't in the allow list automatically.
2022-09-19fix odd mypy issue in unreachable codeEli Schwartz1-0/+1
This used to be fine, until imports were removed from this file. Now a function annotated as T.NoReturn doesn't actually tell mypy that it cannot return, though, so we manually do it.
2022-09-19simplify type annotationEli Schwartz1-1/+1
2022-09-19compilers: avoid importing compilers upfront for detectEli Schwartz1-114/+2
We no longer need these upfront at all, since we now import the ones we need for the language we are detecting, at the time of actual detection. This avoids importing 28 files, consisting of just under 9,000 lines of code, at interpreter startup. Now, it is only imported depending on which languages are invoked by add_languages, which may not even be anything. And even if we do end up importing a fair chunk of it for C/C++ projects, spreading the import cost around the interpreter runtime helps responsiveness.
2022-09-19compilers: perform targeted imports for detectEli Schwartz4-90/+107
Only import the ones we need for the language we are detecting, once we actually detect that language. This will allow finally dropping the main imports of these files in a followup commit.
2022-09-19compilers: use more direct checks for what kind of compiler we haveEli Schwartz1-7/+7
Instead of comparing against specific compiler classes, check the logical compiler id or language etc. In a couple cases, we seem to be missing a couple things by being a bit too strict about the exact class type.
2022-09-19compilers/detect: rename potentially conflicting nameEli Schwartz1-12/+12
Preparation for future commit.
2022-09-19compilers: use consistent function signature for objcEli Schwartz1-7/+7
e.g. for detect_c_or_cpp we just take the language itself as an argument.
2022-09-19compilers: remove dead codeEli Schwartz1-1/+1
It doesn't matter whether the language is c or cpp, xc16 only has a C compiler so that's what this has to be.
2022-09-19compilers: single-source compiler class as cls, consistentlyEli Schwartz1-18/+26
It's the style for most, but not all, of this file.
2022-09-19avoid importing the entire codebase at first startupEli Schwartz2-7/+12
We want to optimize out some internal codepaths used at build time by avoiding work such as argparse. This doesn't work particularly well when the argparse arguments are imported before then. Between them, they indirectly import pretty much all code anywhere, and msetup alone imports most of it. Also make sure the regenerate internal script goes directly to msetup.
2022-09-19compilers: don't export every compiler as a top-level propertyEli Schwartz4-171/+16
This is wasteful and generally unneeded, since code can just use the compiler they detected instead of manually poking at the internals of this subpackage. It also avoids importing an absolute ton of code the instant one runs `from . import compilers`
2022-09-19compilers: directly import from subpackagesEli Schwartz5-12/+14
It turns out we don't generally need to proxy every compiler ever through the top-level package. The number of times we directly poke at one is negligible and direct imports are pretty clean.
2022-09-19compilers: don't use instance checks to determine propertiesEli Schwartz4-24/+18
In various situations we want to figure out what type of compiler we have, because we want to know stuff like "is it the pgi one", or "does it use msvc style". The compiler object has this property already, via an API specifically designed to communicate this info, but instead we performed isinstance checks on a compiler class. This is confusing and indirect, and has the side effect of requiring more imports everywhere. We should do away with it.
2022-09-19declare_dependency: fix regression in printing the correct errorEli Schwartz1-1/+1
In commit 47426f3663f795ae9af59075297bf8215ae81f40 we migrated to typed_kwargs, but the validator accepted a list and checked to see if it was a single Dependency object. Fixes #10813
2022-09-18Warn if wrap file changesDaniel Carson3-7/+62
Save off the hash of the wrap file when first configuring a subproject. When reconfiguring a subproject, check the hash of the wrap file against the stored hash. If they don't match then warn the user.
2022-09-18Move up dangling commentDaniel Carson1-1/+1
The comment and some settings that appear to be related to the comment were introduced in f21685a83330a4bbe1e59c3641a0d24f1efe8825 and appears to be documenting some of the fields added in that commit. This commit moves the comment back to the field it appears to be documenting.
2022-09-18gnome: Add some missing install_tagXavier Claessens1-0/+6