aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2022-11-30docs: clarify that prog.full_path has potentially valid usesEli Schwartz1-4/+10
Claiming that "it should literally never be used ever no matter what" is confusing and wrong -- it's definitely useful sometimes, but does result in downsides, like not tracking inter-target dependencies correctly. Ref: #10901
2022-11-30pylint: enable the set_membership pluginDylan Baker34-63/+63
Which adds the `use-set-for-membership` check. It's generally faster in python to use a set with the `in` keyword, because it's a hash check instead of a linear walk, this is especially true with strings, where it's actually O(n^2), one loop over the container, and an inner loop of the strings (as string comparison works by checking that `a[n] == b[n]`, in a loop). Also, I'm tired of complaining about this in reviews, let the tools do it for me :)
2022-11-30devenv: avoid overwriting internal variables of the global argparseEli Schwartz1-3/+3
We already use options.command for the subcommand in use, in this case devenv. We cannot reuse that variable name for the list of words to execute inside the devenv.
2022-11-30tests: Write out LD_LIBRARY_PATH for built shared librariesDaniel Stone1-1/+14
When a test executable references a local shared library, make sure that we apply the appropriate $LD_LIBRARY_PATH so that the linker can find it at runtime. The DT_RUNPATH entry does ensure that the binary references the path to the shared library build, however the RUNPATH list is only searched after $LD_LIBRARY_PATH. So if the user has a shared library of the same name in their $LD_LIBRARY_PATH, this will be the version found and used for running the test. This is bad if you're trying to use Meson to test a shared library you're developing and have installed in a local prefix which is under $LD_LIBRARY_PATH. Fixes #1635
2022-11-30pylint: enable simplifiable-if-statementDylan Baker3-10/+2
2022-11-30pylint: enable use-implicit-booleaness-not-comparisonDylan Baker2-2/+1
2022-11-29pylint: enable the bad_builtin checkerDylan Baker12-17/+17
This finds uses of deny-listed functions, which defaults to map and filter. These functions should be replaced by comprehensions in idiomatic python because: 1. comprehensions are more heavily optimized and are often faster 2. They avoid the need for lambdas in some cases, which make them faster 3. you can do the equivalent in one statement rather than two, which is faster 4. They're easier to read 5. if you need a concrete instance (ie, a list) then you don't have to convert the iterator to a list afterwards
2022-11-29pylint: enable useless-returnDylan Baker3-3/+0
2022-11-29pylint: enable used-before-assignmentDylan Baker2-2/+3
The one case of this was a false-positive, but what we were doing (checking locals()) is not idiomatic. I've replaced the call to `locals()` with the obvious `var: T.Optional[str] = None` with check instead.
2022-11-29pylint: enable implicit-str-concatDylan Baker2-2/+1
Which catches a very real bug. The zlib system dependency failed to work on MSVC since initial implementation in commit c1a3b37ab7e4ccf3a946ee4ba6da81a4c230ecc4 -- it looked for the wrong name.
2022-11-29CUDA: Update minimum driver version table to include CUDA 11.8Olexa Bilaniuk1-0/+2
Agrees with Release Notes, Section 1.1, Table 3. https://docs.nvidia.com/cuda/cuda-toolkit-release-notes/index.html
2022-11-29CUDA: Bugfix to architectural limit checks.Olexa Bilaniuk1-2/+2
The upper bound on the CUDA Compute Capability is not always known. Avoid checking cuda_hi_limit_gpu_architecture if it remains undefined.
2022-11-29CUDA: Add Orin, Lovelace and Hopper architecture names for CUDA 11.8Olexa Bilaniuk1-3/+15
Co-authored-by: David Seifert <soap@gentoo.org>
2022-11-28github workflows: upgrade actions/upload-artifact to version 3Eli Schwartz3-4/+4
This is a no-op change from v2 to v3, but github complains that nodejs is outdated if you don't. It's not obvious why this required a major version bump... However, half of our uses are on v1, which has a decent fix: failure to upload artifacts constitutes a step failure.
2022-11-28github workflows: upgrade actions/checkout to version 3Eli Schwartz10-16/+16
This is a no-op change, but github complains that nodejs is outdated if you don't. It's not obvious why this required a major version bump...
2022-11-28github workflows: upgrade setup-python to version 4Eli Schwartz4-8/+8
Not much changes, really, other than it now sets PKG_CONFIG_PATH to point to the python it just installed. This should generally not be a problem (Meson's python module sets that anyway based on the executable's introspection data).
2022-11-29Fix crash when toolchain is missingSmallWood-D8-15/+26
Add a MissingCompiler class returned by compiler detecting methods intead of None - accessing such an object raises a DependencyException Fixes #10586 Co-authored-by: duckflyer <duckflyer@gmail.com>
2022-11-29Don't ignore documentation-related flags for D compilersAxel Ricard1-1/+3
Fixes #11085
2022-11-28utils: Popen_safe: Handle ENOEXEC to fail with an error messageMarvin Scholz1-6/+14
This is much cleaner than to show a stack trace, where it is hard to figure out what is going wrong.
2022-11-28Add github's CodeQL scanner to CI.Eli Schwartz3-0/+40
lgtm.com was acquired by github. It is deprecated and on its way out, because they've integrated the functionality itself into github. Take a look at what its official replacement can do. This does run as yet another Actions slot, which is already fairly excessive, but the average runtime seems about 5 minutes so that's not too bad...
2022-11-27Add warning_level=everythingDavid Robillard20-43/+335
Adds a new maximum warning level that is roughly equivalent to "all warnings". This adds a way to use `/Wall` with MSVC (without the previous broken warning), `-Weverything` with clang, and almost all general warnings in GCC with strictness roughly equivalent to clang's `-Weverything`. The GCC case must be implemented by meson since GCC doesn't provide a similar option. To avoid maintenance headaches for meson, this warning level is defined objectively: all warnings are included except those that require specific values or are specific to particular language revisions. This warning level is mainly intended for new code, and it is expected (nearly guaranteed) that projects will need to add some suppressions to build cleanly with it. More commonly, it's just a handy way to occasionally take a look at what warnings are present with some compiler, in case anything interesting shows up you might want to enable in general. Since the warnings enabled at this level are inherently unstable with respect to compiler versions, it is intended for use by developers and not to be set as the default.
2022-11-26add missing documentation for python installation default pure kwargEli Schwartz1-1/+8
2022-11-24Ignore unused compiler options for "meson configure"Loïc Yhuel1-1/+1
"meson setup" ignores unused compiler options, like "cpp_args" on a project without C++. "meson configure" doesn't have the filtering from "set_default_options", so it fails with : ERROR: Unknown options: "cpp_args" So now unused compiler options (ie not in coredata.options) are no longer marked unknown. Fixes: #11060
2022-11-24Fix various spelling errorsDavid Robillard16-19/+19
Found with codespell.
2022-11-24migrate some type comments to modern type annotationsEli Schwartz1-54/+54
flake8 6 upgrades to pyflakes 3, and in turn this means that support for parsing `# type: ` style annotations has been removed. https://github.com/PyCQA/pyflakes/pull/684 This caused one file to fail linting, because it had a typing import which was only used by a type comment. ``` mesonbuild/cmake/interpreter.py:55:5: F401 '.common.CMakeConfiguration' imported but unused ``` Updating it to actual annotations allows pyflakes to detect its usage again, and flake8 passes. Do the whole file while we are here.
2022-11-24remove a couple of unneeded type annotationsEli Schwartz1-8/+8
These are trivially inferred based on their initialized values.
2022-11-24python module: fix broken non-embed dependencyEli Schwartz1-11/+13
The `py.dependency(embed: false)` method is supposed to consistently provide a distutils-like `python.pc` / `python-embed.pc` interface regardless of Python version. It handles both pkg-config and sysconfig scraping. For the latter, we respect the value of self.link_libpython as determined by distutils, and construct a fully custom dependency. For the former, we blindly assume pkg-config is correct. It isn't correct, not until Python 3.8 when embed was added. Before then, we need to process the pkg-config dependency based on link_libpython. We did this, but only inside the extension_module method, which is obviously wrong. Delete the special casing from extension_module, and handle it inside the dependency. Fixes #11097
2022-11-24Fix broken link in release notesDavid Robillard1-1/+1
2022-11-23python: Use correct extension filename suffix on Python < 3.8.7Daniele Nicolodi2-6/+20
On Windows, in Python version prior to 3.8.7, the `sysconfig` modules provides an extension filename suffix that disagrees the one returned by `distutils.sysconfig`. Get the more awesome suffix from the latter when building for a Python version known to present this issue. Simplify the extension module filename suffix lookup to use the same method used by `setuptools`. Adjust project tests accordingly. Fixes #10960.
2022-11-22compilers: remove opinionated c++ warning flagEli Schwartz3-6/+9
-Wnon-virtual-dtor is not what people think of as a standard warning flag. It was previously removed from -Wall in https://gcc.gnu.org/bugzilla/show_bug.cgi?id=16190 on the grounds that people didn't like it and were refusing to use -Wall at all because it forced this warning. Instead, it is enabled by -Weffc++ which is typically not enabled and even comes with GCC documentation warnings stating that the standard library doesn't obey it, and you might need to `grep -v` and filter out warnings. (!!!) It doesn't fit into the typical semantics of Meson's warning_level option, which usually aligns with compiler standard warning levels rather than a niche ideological warning level. It was originally added in commit 22af56e05aa9cba4740d2ff303d876bb0c3cfb2b, but without any specific rationale included, and has gone unquestioned since then -- except by the Meson users who see it, assume there is a finely crafted design behind it, and quietly opt out by rolling their own warning options with `add_project_arguments('-Wall', ...)`. Furthermore a GCC component maintainer for the C++ standard library opened a Meson bug report specially to tell us that this warning flag is a "dumb option" and "broken by design" and "doesn't warn about the right thing anyway", thus it should not be used. This is a reasonably authoritative source that maybe, just maybe, this flag... is too opinionated to force upon Meson users without recourse. It's gone beyond opinionated and into the realm of compiler vendors seem to think that the state of the language would be better if the flag did not exist at all, whether default or not. Fixes #11096
2022-11-22unittests: add and use get_meson_log_raw functionMarvin Scholz3-10/+13
This is like get_meson_log but returns the whole contents not split into individual lines.
2022-11-22unittests: add and use _open_meson_log functionMarvin Scholz1-12/+17
Factors out opening the meson log into its own function so that it can be used in the places where with was done before. Additionally instead of checking if the file exists before opening it, try to open it and handle the exception when it is not found.
2022-11-22test runner: fix excluding null optionsMarvin Scholz1-12/+12
It was impossible to specify null arguments in the exclude array, while they were passed properly in the code, they were stringified while the entries in the options array were just completely removed. To fix this, do not early stringify the argument name and option together as that would make it impossible to properly match it to None without introducing a new special case for the string "None". So instead they are now kept as tuples and only stringified when its actually needed.
2022-11-22Fix writing single strings in env2mfile.Jussi Pakkanen1-1/+2
2022-11-21Handle freezing tests. Fixes #10752.Jussi Pakkanen4-3/+36
2022-11-20hotdoc module: fix broken include pathsEli Schwartz1-2/+1
Since commit 32b14b1bb533e10c7344c2e04125a226553c9b9f, hotdoc is run during configure as an external program. It turns out though, that in some cases we passed NoneType in the cmd array, previously to hotdoc.run_hotdoc.run() and now via subprocesses. The former "worked" due to ignoring unknown arguments (?) but the latter was broken because command line interfaces don't accept python NoneType objects, naturally. End result: when for example building Meson's own documentation, this fails with a python traceback. The reason this happens to begin with turns out to be, once again, because of the legacy debt of homebrewed kwargs parsing. We have a function for `process_known_args` that handles args and ignores them if they are NoneType, and then include_paths is handled via a custom processor that internally adds them, then returns a *list* of NoneType which then gets appended to the global cmd, because the logic ends up as `[None, None] is None` which is a failed check, so we go ahead and add it. It's odd that we ever attempted to process it twice to begin with, so let's simply not do that.
2022-11-20hotdoc module: remove homebrew function-proxied OrderedSetEli Schwartz1-10/+6
We are just using this dictionary to get keys, and we could also just set it ourselves but with None values. But we have a code abstraction for this already; use it.
2022-11-19modules/rust: stabilizeDylan Baker3-2/+6
Mesa is using the rust module in production, so we should stabilize it.
2022-11-17tests: fix potential failure to verify pkg-config generationEli Schwartz1-1/+1
We use a dummy project with a vague name and try to find flags for it based on the installable pkg-config files. This sort of works, generally, because it attempts to match `-lct` which doesn't exist because the test case isn't installed, and that link argument is passed directly through. Except, sometimes that library does exist. It is provided by the "freetds" project, which may be a dependency other tools. In that case, Meson finds a library, and the `dependency()` resolves to `/usr/lib/libct.so` and the test fails. Fortunately, we do have an API to say that we really want to get back the same flags pkg-config returned. Use this.
2022-11-17tests: make the command tests work when python is not the one in the shebangEli Schwartz1-1/+5
We test a couple ways of running the meson command, and double check that the debug logs record the meson command used (including python). But when running the meson command as an executable instead of as a python script, we see whichever version `env` in the shebang sees. Fix this by mocking the python command as well.
2022-11-17tests: fix qt project test when running with qt4Eli Schwartz1-1/+1
*.qrc files converted to C++ sources could make use of Qt headers, and in practice for qt4 they seem to. Since this is Qt code to begin with, it makes sense to depend on the Qt being targeted regardless of version.
2022-11-17fix deprecated use of meson builddir/ in testsuiteEli Schwartz1-1/+1
2022-11-17backend/ninja: replace ` ` with `_` in rust crate-namesDylan Baker1-2/+2
Because spaces aren't allowed and result in compilation failures
2022-11-17modules/rust: Also include generated sources for testsDylan Baker1-2/+5
When we create a test from a non-executable, we weren't copying the generated sources, just the static ones.
2022-11-17build: fix annotations of BuildTarget derived classesDylan Baker1-5/+5
Which thinks `sources` should be `List[File]`, but they should be `List[SourceOutputs]`
2022-11-17hotdoc module: run hotdoc as an external command during configureEli Schwartz1-5/+8
We need to run it as an external command at build time anyway, and we detect it by looking it up as an ExternalProgram. It seems odd to then import it into Meson's python interpreter and run the main function. Moreover, this errors out when you are running two different pythons, one for Meson and one for hotdoc. For example, when hotdoc is installed normally, but you're testing Meson against a nondefault newer version of python.
2022-11-17build: use the unified pickle loader to handle more edge casesEli Schwartz2-20/+12
We have divergent implementations of loading a pickled *.dat file. The Build class loader has a better error message. But the generic loader handles TypeError and ModuleNotFoundError. Merge the implementations, and use it for Build as well. Fixes #11051
2022-11-17Fix a typo in the CUDA templateZihua Wu1-1/+1
The original version will output something like `xtakes no arguments`, and the modified version will correctly output `x takes no arguments`.
2022-11-17mdist: fix error when running tests with a cross fileEli Schwartz1-2/+2
Since commit 1420d0daceb10cafb52a7405f157032a5cc811a5 we use coredata's cmd_line.txt handler to get the right setup arguments. But there's a bug in that -- it mishandles cross/native files, producing invalid descriptions of the command line. The only other place this was used, though, is when generating meson-log.txt. Fix it to produce correctly formatted arguments. Fixes #10980
2022-11-16fix confusing azure pipelines status for coverageEli Schwartz3-18/+20
The coverage report was always the final section of the main test run. This made it hard to scroll around and find exactly what went wrong -- particularly as not everyone realizes that coverage isn't part of the test run, but also because the output from coverage is... excessively long. This mirrors what we do in our other workflows.