Commit Graph

140 Commits

Author SHA1 Message Date
Paolo Bonzini 8581a2b122 interpreter: extract_objects provides a valid source
This ensures that there is no warnings when running meson on
test cases/common/22 object extraction.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-11-23 18:10:15 +05:30
Eli Schwartz 8dbb0ee476
Feature kwargs decorator: automatically report the nodes which trigger an issue 2021-11-20 20:48:30 -05:00
Xavier Claessens 3902bd4ef1 Fix add_install_script() ignoring install_tag
Fixes: #9454
2021-10-27 20:49:28 -04:00
Xavier Claessens ef255db73a test_clang_format: Do not assume meson source is in git
Fixes: #9437
2021-10-27 15:32:57 -04:00
Eli Schwartz 739de7b088
unittests: use better assert methods
assertTrue and assertFalse are recommended against, if you can get a
more specific assertion. And sometimes it is considerably shorter, for
example we have a custom assertPathExists which we can take advantage
of.
2021-10-26 20:53:43 -04:00
Eli Schwartz 67792fc223
do not save unused variable
Constructing a PackageDefinition is enough to assert that it raises an
error.
2021-10-26 20:53:43 -04:00
Eli Schwartz e0b86a8d38
remove unused variable
It never made sense here to save self.init() which returns a string
containing a log or stdout or something, and which was never actually
used.

Also we then overwrote the variable with a pathname...
2021-10-26 20:53:42 -04:00
Eli Schwartz 7b53c26501
remove dead code that is immediately overridden
In commit d932cd9fb4, we migrated to
meson's own static linker definition, and the old code that hardcoded
two of the possible exelists should have been removed in the process.
2021-10-26 20:53:42 -04:00
Eli Schwartz 1979132a9d
do not save variable when all we want is the side effect of popping it
It's redefined on every loop iteration, and as the comment says, we just
want to make sure the next loop skips a value.
2021-10-26 20:53:41 -04:00
Paolo Bonzini 5e96730d7d introspect: include choices for array options
There was even a test covering this, but it did not fail due to a typo.
2021-10-14 09:04:25 -04:00
Christian Clauss a5020857f3 Fix typos discovered by codespell 2021-10-10 16:12:25 -04:00
Xavier Claessens 32b7cbd4a7 clangformat: Only format files tracked by git by default 2021-10-10 14:13:35 -04:00
Eli Schwartz 0a3a9fa0c3
ar linker: generate thin archives for uninstalled static libraries
Since they will never be used outside of the build directory, they do
not need to literally contain the .o files, and references will be
sufficient.

This covers a major use of object libraries, which is that the static
library would potentially take up a lot of space by including another
copy of every .o file.

Fixes #9292
Fixes #8057
Fixes #2129
2021-10-10 13:32:22 -04:00
Eli Schwartz e8a85fa8a2
various python neatness cleanups
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.
2021-10-04 16:29:30 -04:00
Dylan Baker 73dd21036c rust: dependencies need to cause a rebuild/relink not just reorder
Otherwise changes to a dependency don't propogate
2021-10-01 12:21:31 -07:00
Xavier Claessens d2fa6d5080 Make custom_target() name argument optional 2021-09-30 12:26:19 -04:00
Jussi Pakkanen fa47d8dab0
Merge pull request #9014 from bonzini/mixed-language-link
Use appropriate compiler for the source file for "links" tests with file argument
2021-09-28 17:32:44 +03:00
Eli Schwartz 5fa0fd3b47
fix test case instances where undefined message(true) occurred 2021-09-27 01:34:08 -04:00
Dylan Baker 30202a2402 compilers/rust: Add support for clippy
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
2021-09-24 18:48:48 -07:00
Xavier Claessens ca866bcfc7 coredata: 0.59.1 -> 0.59.99 is a major version difference
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
2021-09-21 18:09:12 +02:00
Xavier Claessens e006e2ee99 Fix ignored install_tag kwarg in install_subdir()
Fixes: #9263
2021-09-16 07:53:18 -04:00
Andres Freund fddf88ba08 backends/vs: Do not emit dummy command for alias_command().
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
2021-09-14 13:38:04 -04:00
Paolo Bonzini 0fcd696b1e unittests: test external dependency in summary
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>
2021-09-07 14:18:58 -04:00
Paolo Bonzini bb70277e96 add test case for mixed language link tests 2021-09-07 14:18:37 +02:00
Filipe Laíns af8b55d49b mintro: add installed_plan
Signed-off-by: Filipe Laíns <lains@riseup.net>
2021-09-06 18:10:55 +02:00
Eli Schwartz 5166a47acb tests: when generating git repositories, make sure that pgpsign is off
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".
2021-09-03 14:14:15 -04:00
Xavier Claessens 5e55a0bb2b interpreter: Add summary of all user defined options
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.
2021-09-02 19:38:29 -04:00
Eli Schwartz 0b63dff3ba
run_target: do not yield broken names with subdirs
A run_target object created in a subdir/meson.build always has a ninja
rule name of "name", not "subdir/name".

Fixes #9175
2021-09-01 15:42:39 -04:00
Dylan Baker 4d7031437c pylint: turn on superflous-parens
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.
2021-08-31 16:28:54 -04:00
Xavier Claessens 88a1bed81b decorators: Make unknown kwarg fatal 2021-08-30 14:00:54 -04:00
Xavier Claessens e646130ef1 interpreter: Fix dependency(..., static: true) fallback
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.
2021-08-23 10:52:18 -04:00
Xavier Claessens 8c5aa031b5 Add install tags
Fixes: #7007.
2021-08-17 15:19:18 -04:00
Dylan Baker b30dddd4e5 interpreter/compiler: Add type checking for the Compiler object
This adds a full set of `typed_pos_args` and `typed_kwarg` decorations,
as well as fixing all of the typing errors reported by mypy.
2021-08-16 16:21:51 -07:00
Eli Schwartz 59d4f771d2
editorconfig: add setting to trim trailing whitespace
and clean up all outstanding issues

Skip 'test cases/common/141 special characters/meson.build' since it
intentionally uses trailing newlines.
2021-08-15 09:36:18 -04:00
Eli Schwartz ead4ba7777
run_unittests: fix unused variable warnings
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.
2021-08-15 09:36:18 -04:00
Xavier Claessens 5462ea921f interpreter: Fix missing subsubproject summary when subproject fails
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.
2021-08-09 14:11:42 -04:00
Xavier Claessens 943596abbb Fix --force-fallack-for with --wrap-mode=nofallback
Fixes: #9065
2021-08-07 11:20:57 +02:00
Alois Wohlschlager 40d5a38d1b Escape path in exclude filter passed to gcovr
Gcovr interprets exclude filters, as passed to the -e option, as
regexes. Since we want to exclude a raw path, the argument must be
escaped.
2021-08-04 20:31:35 +02:00
Xavier Claessens 9da99e7a59 destdir: Allow relative to build directory
Meson already works like that, except in do_copydir() that requires
absolute destdir. Better explicitly support that instead of leaving it
undefined and unconsistent.
2021-08-04 09:43:41 -04:00
Xavier Claessens 7eb4c23156 Split run_unittests.py file 2021-07-26 15:19:13 -04:00