The code would create a dictionary that was of type `str : list[str] |
str | None`. Then would later try to call `len(' '.join(dict[key]))`.
This would result in two different bugs:
1. If the value is `None` it would except, since None isn't iterable
and cannot be converted to a string
2. If the value was a string, then it would double the length of the
actual string and return that, by adding a space between each
character
Fedora has switched to zlib-ng, which has a version of `1.3.0.zlib-ng`,
causing AllPlatformTests.test_summary to fail. dl is much less likely to
change format.
This allows tests to check whether stdin is a tty to figure out if they're
running in interactive mode or not.
It also makes sure that tests that are not running in interactive mode
don't inadvertendly try to read from stdin.
This is very similar to --gdb, except it doesn't spawn GDB, but
connects stdin/stdout/stderr directly to the test itself. This allows
interacting with integration tests that spawn a shell in a container
or virtual machine when the test fails.
In systemd we're migrating our integration tests to run using the
meson test runner. We want to allow interactive debugging of failed
tests directly in the virtual machine or container that is spawned
to run the test. To make this possible, we need meson test to connect
stdin/stdout/stderr of the test directly to the user's terminal, just
like is done with the --gdb option.
When getting debug file arguments we can sometimes pass None, where a
None is unexpected. This becomes a particular problem in the Cuda
compiler, where the output will unconditionally be concatenated with a
static string, resulting in an uncaught exception. This is really easy
to spot once we annotate the functions in question, where a static type
checker like mypy easily spots the issue.
This commit adds those annotations, and then fixes the resulting error.
Fixes: #12997
We have two copies of other.h, one of which is generated. If we don't
include the include/ directory then building fails unless the
custom_target which copies it over, happens to run early enough. On
parallel builds this may fall on its face.
Any code that needs to know mesonlib.python_command currently assumes
the PyInstaller bundle reference is added to the sys module, which means
that it assumes the only freeze tool used is PyInstaller. Really, all we
need to check is sys.frozen as it's never normally set, but always set
for a freeze. We don't care if it was PyInstaller specifically, and we
don't need its bundle directory.
See https://github.com/mesonbuild/meson/discussions/13007
Popen_safe_logged has a small inefficiency. It evaluates the stripped
version of stdout/stderr before checking if it exists, for logging
purposes. This would sometimes crash, if it was None instead of ''.
Fixes#12979
It is generally accepted practice to convert dict.keys() to a list
before iterating over it and e.g. deleting values, as keys returns a
live-action view. In this case, we use the difference of *two* dict
keys, which returns a regular non-view set and doesn't need protecting.
Iteration order doesn't matter (the set already randomizes it anyway).
Avoid the cost of converting to a list.
Only Environment and ConfigurationData are mutable. However, only
ConfigurationData becomes immutable after first use which is
inconsistent.
This deprecates modification after first use of Environment object and
clarify documentation.
Adds a howto section describing how to put files in a separate build
target and override the unity build setting, and why you might want to
do this.
Closes: #13031
We have seen a number of bugs from people confused by warning that the
need both a C and C++ compiler to use the CMake method. This attempts
to provide a more helpful error message.
When a user writes `import'foo')`, Meson checks the
`mesonbuild/modules/` directory for a package called `foo.py`, and
attempts to import it. We don't want to expose any implementation detail
packages like `_qt.py`, so if someone write `import('_qt')`, we should
immediately give a "doesn't exist" error.
Since it's an implementation detail, and shouldn't be exposed. This also
helps give better error messages when a user writes `import('qt')`,
since otherwise you get an error about `qt doesn't have an initialize
method`, and now you get `qt module doesn't exist`.
Some tests for `gnome.mkenums_simple` were only compiled, but not run.
Most bugs will be caught by compilation alone, but it's better to run
the generated binary too in case there are runtime issues in the
generated code.
The naming of all enum tests is now unified as well.
Commit 83facb3959 switched to using
`textwrap.dedent` for the code templates for `gnome.mkenums_simple`.
That changed indentation, however, making the generated code harder to
understand.
We improve this by properly indenting the multiline strings before
dedenting them. For optional parameters `decl_decorator` and
`header_prefix`, we add a newline if they are set to keep separation
between generated code blocks.