Commit Graph

10778 Commits

Author SHA1 Message Date
Dylan Baker adbfa12409 run_single_test: Handle MESON_SKIP_TEST correctly 2021-03-23 15:28:08 -07:00
Dylan Baker c86c18066e deprecated QMAKE dependency type
Instead of using qmake, use config-tool. This is no different than when
we deprecated the other per-dependency config-tool types (sdl2-config,
llvm-config, etc) for just config-tool
2021-03-23 15:28:08 -07:00
Dylan Baker c211fea513 Refactor Qt Dependency into proper split classes with factories
Currently the Qt Dependencies still use the old "combined" method for
dependencies with multiple ways to be found. This is problematic as it
means that `get_variable()` and friends don't work, as the dependency
can't implement any of those methods. The correct solution is to make
use of multiple Dependency instances, and a factory to tie them
together. This does that.

To handle QMake, I've leveraged the existing config-tool mechanism,
which allows us to save a good deal of code, and use well tested code
instead of rolling more of our own code.

The one thing this doesn't do, but we probably should, is expose the
macOS ExtraFrameworks directly, instead of forcing them to be found
through QMake. That is a problem for another series, and someone who
cares more about macOS than I do.
2021-03-23 15:28:08 -07:00
Dylan Baker 54c55f77a9 run_project_tests.py: Allow qt tests to skip on !macOS
We don't always have qmake installed (and it's good to test failure
paths too!) so we can't expect this to succeed in all cases. With the
following commit we'll use a test.json to test both pkg-config and
qmake, so we need to be able to skip.
2021-03-23 15:28:08 -07:00
Xavier Claessens 37d4c86e5b interpreter: Fix spurious warning in include_directories()
When doing include_directories('.') at the root of the subproject we
should not warn about sandboxing violation.
2021-03-23 18:07:18 -04:00
Xavier Claessens 66d62a224e test.json: Add support for not matching stdout lines
By default expected line must be matched in order. When an expected line
is matched it does not matter if it's matched again later or not.

When defining "count", it means that line must be matched exactly that
many times before matching the next expected line. Once all occurences
have been matched for an expected line, it not must appear any more in
all next lines.
2021-03-23 18:07:18 -04:00
Xavier Claessens d0d81ab84e run_project_tests.py: Allow "--only common/240" syntax 2021-03-23 18:07:18 -04:00
Xavier Claessens a9e9b7c750
devenv: Set GI_TYPELIB_PATH and LD_LIBRARY_PATH (#8548) 2021-03-23 23:35:05 +02:00
Xavier Claessens 1be13710ad
environment(): Allow stacking append() and prepend() (#8547)
* environment(): Allow stacking append() and prepend()

* Update docs/markdown/Reference-manual.md

Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>

Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
2021-03-23 17:48:17 +02:00
Jussi Pakkanen de9df5128c
Merge pull request #7491 from xclaesse/callstack
RFC: logs: Prepend current subproject name to all messages
2021-03-23 17:28:26 +02:00
Jussi Pakkanen 9ab4dadef9 Remove -pipe from default list of args. Closes #8508. 2021-03-23 17:26:08 +02:00
Xavier Claessens 8cd4d0b283 mlog: Do not print 'subproject|' for the message 'Executing subproject'
It already contains the full callstack and it's more visible when it's
standing on its own line.
2021-03-22 21:29:14 -04:00
Xavier Claessens 7c3418204f interpreter: Do not print "method meson" 2021-03-22 21:29:14 -04:00
Xavier Claessens 60c2c25d5b mlog: Do not print 'subproject|' on empty lines 2021-03-22 21:29:14 -04:00
Xavier Claessens b33e7bca73 mlog: Add a space after 'subproject|' 2021-03-22 21:29:14 -04:00
Xavier Claessens 3c1ccb923f logs: Prepend current subproject name to all messages
Meson used to prepend '|' for each nested subproject to distinguish in
the logs where a subproject start and ends. It is more useful to print
the current subproject name.

Also print the call stack when starting a new subproject to better see
which subproject chain leads to to.
2021-03-22 21:29:14 -04:00
Dylan Baker d7ac2f1065 qt: move compilers_detect to the qt module
It's a method on the QtDependeny that exists purely for the consumption
of the qt module (in the form, return some stuff the module makes into
an instance variable). So put it where it actually belongs, and pass the
qt dependency into it.
2021-03-22 16:54:01 -07:00
Dylan Baker c1daa4e892 dependencies/qt: Split _get_modules_lib_suffix out of the class
As we break these classes up we're going to need this.
2021-03-22 16:53:51 -07:00
Dylan Baker 3e86aecab8 dependencies/base: Use FeatureDeprecated instead of mlog.warning
This code is really old, and it might be fine to delete this altogether,
but for now lets do this.
2021-03-22 16:53:51 -07:00
Dylan Baker e37b020cef dependencies/qt: split get_qmake_host_bins into a free function
It's static anyway, and never overwritten.
2021-03-22 16:53:51 -07:00
Dylan Baker d204654089 dependencies/base: Use Compiler instead of CompilerType
Since Compiler is actually useful now as a base class, unlike when this
code was written.
2021-03-22 16:53:51 -07:00
Dylan Baker 8771045d79 dependencies/qt: Add type annotations
And fix some style and correctness issues
2021-03-22 16:53:51 -07:00
Paolo Bonzini ea48edbb0f mtest: timeout if the write side of pipes does not close
If a test program forks a child, the pipes might remain open and
"await stdo_task"/"await stde_task" will never complete in
SingleTestRunner._run_cmd().

Instead, catch them in TestSubprocess.wait() so that the whole
process group is killed.

Fixes: #8533
Reported-by: Bastien Nocera <hadess@hadess.net>
2021-03-23 00:07:14 +02:00
Paolo Bonzini 13d3fbbf3e mtest: remove pointless try/except from try_wait_one
asyncio.wait does not return an asyncio.TimeoutError, so there is no
exception to catch.
2021-03-23 00:07:14 +02:00
Xavier Claessens 20a90cf709 cmd_line_file.txt: Use cross/native file path resolved by coredata
This fix issue when using --wipe and the machine file was passed as a
pipe and written locally, or when the file was resolved in XDG_DATA_HOME
or XDG_DATA_DIRS.

Fixes: #8560
2021-03-22 14:45:10 -04:00
Dylan Baker 73eb24432b dependencies: split qt out of the ui module
It's a big enough and complicated enough bit of code that it deserves
its own module.
2021-03-22 10:56:13 -07:00
HRXN 9dc7abe697 Docs: Fix small typo 2021-03-21 12:26:54 -04:00
Dylan Baker 9016e4596c Move OverrideProgram to programs 2021-03-19 08:47:10 -04:00
Dylan Baker 97c1283baa programs: add type annotations 2021-03-19 08:47:10 -04:00
Dylan Baker 40e3577a65 split program related classes and functions out of dependencies
Dependencies is already a large and complicated package without adding
programs to the list. This also allows us to untangle a bit of spaghetti
that we have.
2021-03-19 08:47:10 -04:00
Eli Schwartz f7b0238ed6
add test case for installed targets uninstalling a single directory 2021-03-18 21:50:38 -04:00
Eli Schwartz 0ad870f3dc
minstall: always track meson-created directories
If a custom_target output is a directory, we install it as a directory,
not as a file. And, we try to track subdirectories which are created so
uninstalling works. But one directory creation did not go through
DirMaker, in the case where the output directory does not have any
further subdirectories.

Consolidate on makedirs, since I don't see much point in using os.mkdir
right here.
2021-03-18 20:30:13 -04:00
Xavier Claessens 3990754bf5 Allow add_dist_script() in subprojects
Fixes: #8440.
2021-03-18 08:41:21 -04:00
Xavier Claessens 848e360450 interpreter: Add varname as positional arg in dep.get_variable() 2021-03-18 08:37:44 -04:00
Remi Thebault c756d97895 Fix D lib search path translation
This requires quite a complex and messy logic.
As @dcbaker suggested in #8491, this could be replaced by
an abstraction over linker flags instead of having GNU flags
translated.
2021-03-17 10:14:55 -07:00
Jussi Pakkanen fe4ddb5268 Warn when grabbing internals of subprojects with include_directories. 2021-03-17 15:10:30 +02:00
Jussi Pakkanen 639063db7f One more unixy fix. 2021-03-17 12:02:05 +02:00
Xavier Claessens 0638e38bfc clangformat: Add clang-format-check target 2021-03-16 21:01:54 -04:00
Xavier Claessens f558689277 clangformat: Add include and ignore files 2021-03-16 21:01:54 -04:00
Xavier Claessens a45f939092 Add range() function
Fixes: #5026.
2021-03-16 20:50:16 -04:00
Xavier Claessens 6415453f17 externalproject: Flatten configure_options kwarg 2021-03-16 18:17:58 -04:00
Xavier Claessens a0689647a9 externalproject: Do not add --includedir by default
Some projects (e.g. OpenSSL) does not support setting include directory
at all.
2021-03-16 18:17:58 -04:00
Xavier Claessens f6d5e8aa47 externalproject: Fix error when used from main project 2021-03-16 18:17:58 -04:00
Jussi Pakkanen cb96e79c15 Remove mention of Meson manual. [skip ci] 2021-03-16 20:54:54 +00:00
Jussi Pakkanen ecd8c7e4af Update VS module version check. 2021-03-16 21:06:51 +02:00
Jussi Pakkanen a0c16f94fc Replace Unix shell commands with scripts. 2021-03-16 20:57:25 +02:00
Jussi Pakkanen 3ac3e125e4 Delete leftover files from some tests. 2021-03-16 16:37:02 +02:00
Paolo Bonzini 5cd7f5f8c5 msetup: do not print bogus "Option ... is:" messages
get_non_matching_default_options is checking a string from
project_default_options against a validated value from
coredata.options.

Passing the string to validate_value ensures that the comparison
is sound; otherwise, "false" might be compared against False
and a bogus difference is printed.
2021-03-16 09:35:48 -04:00
Paolo Bonzini 32e49b5ff2 coredata: be more robust on unpickling errors
When reverting from 0.57 to 0.56, one can see an error like this:

  File /Users/pm215/src/qemu-for-merges/meson/mesonbuild/coredata.py,
line 1016, in load
    obj = pickle.load(f)
ModuleNotFoundError: No module named 'mesonbuild.mesonlib.universal';
'mesonbuild.mesonlib' is not a package
FAILED: build.ninja

The reason is that the old version fails to resolve mesonbuild.mesonlib,
which is a similar situation to the existing AttributeError check.  Raise
a MesonException for ModuleNotFoundError as well, so that reconfiguration
proceeds using cmd_line.txt.
2021-03-16 09:32:57 -04:00
Xavier Claessens 598e968993 Add `meson devenv` command and meson.add_devenv() 2021-03-16 09:00:50 -04:00