All changes were created by running
"pyupgrade --py3-only"
and committing the results. Although this has been performed in the
past, newer versions of pyupgrade can automatically catch more
opportunities, notably list comprehensions can use generators instead,
in the following cases:
- unpacking into function arguments as function(*generator)
- unpacking into assignments of the form x, y = generator
- as the argument to some builtin functions such as min/max/sorted
Also catch a few creeping cases of new code added using older styles.
Clippy is a compiler wrapper for rust that provides an extra layer of
linting. It's quite popular, but unfortunately doesn't provide the
output of the compiler that it's wrapping in it's output, so we don't
detect that clippy is rustc. This small patch adds a new compiler class
(that is the Rustc class with a different id) and the necessary logic to
detect that clippy is in fact rustc)
Fixes: #8767
Remove test_minor_version_does_not_reconfigure_wipe() because when run
during dev cycle that test reconfigure with .99 -> .100 which is
considered a major version change now. It is covered by a more efficient
internal test now anyway.
While at it, remove no-op `with Path(self.builddir):` statement, the
intention was clearly to set workdir.
Fixes: #9260
This adds a new category of tests that does not need to run on all
platforms during CI. For now only run them on Linux runners because they
are not the bottleneck.
Alias commands did not work with the vs backend, due to trying to access
target.command[0] with an empty command. Fix this by just not emitting a
CustomBuild node for alias targets - the project references are enough to
trigger the necessary actions.
Fixes: #9247
This requires a bit of extra code because the version might change, but
otherwise it fits in the existing AllPlatformTests.test_summary testcase
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
I have a local configuration
tag.forcesignannotated=true
commit.gpgsign=true
This causes the tests to fail with e.g.
error: gpg failed to sign the data
fatal: failed to write commit object
Since this is a unittest, it is never wrong to tell git "just ignore
prior configuration, and disable all PGP signing".
It is a commonly needed information to help debugging build issues. We
already were printing options with non-default value at the end of the
configure but outside of the summary.
Keeping the list of user defined options in the interpreter will also in
the future be useful to use new default value on reconfigure.
This simplifies things for us, as we don't have to have threading
imported for no other reason, and we can remove the
`an_unpicklable_object` from the Interpreter and mesonlib, since there
was only one user of this.
We have a lot of these. Some of them are harmless, if unidiomatic, such
as `if (condition)`, others are potentially dangerous `assert(...)`, as
`assert(condtion)` works as expected, but `assert(condition, message)`
will result in an assertion that never triggers, as what you're actually
asserting is `bool(tuple[2])`, which will always be true.
It should build the fallback subprject with default_library=static and
override the dependency for both static=True and static kwarg not given.
Fixes: #8050.
This adds a new keyword argument to the init method, `allow_fail`. When
set to True (default is False) then a failure to configure is not an
error, and output is still returned. This can be useful for cases where
we expect initialization to fail, and want to check the output.
There are two problems with having this in the try/except block. The
first is that both of the if statements will raise, and the except
statement cathces `Exception`, so it catches these two cases, prints a
message that we either don't want or already printed, then re-raises.
We don't actually want to do anything with the open()ed file, just
immediately close it.
The CalledProcessError doesn't have its return returncode checked
here, even though other code with the same type of context manager does.
In the case main->subp->subsubp, if subsubp succeed to configure but
subp subsequentially fails, subsubp is still being built but its summary
was missing.
Meson already works like that, except in do_copydir() that requires
absolute destdir. Better explicitly support that instead of leaving it
undefined and unconsistent.