Commit Graph

10478 Commits

Author SHA1 Message Date
Fini Jastrow 5dd1aac5c9 unittests: Remove double install for case 10
[why]
In test case 10 the project is installed twice. This has been introduced
with commit
  55abe16 unit tests: Test that relative install_rpath works correctly
where the cxx tests where added by copy and paste.

[how]
First test all build rpaths, then after install all install rpaths.

[note]
The aforementioned commit is a bit strange in that it adds a tests with
a relative rpath with cxx files but not with c files.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2021-01-20 19:01:47 +00:00
Fini Jastrow 49cde9653c ninjabackend: Correct RPATH order
[why]
If we build and test a library we need to make sure that we find the
currently build library object first, before an older system installed
one.
This can be broken if the library in question is installed in a custom
path, and another library we depend on also is installed there.

[how]
Just move the rpath to the current build artifacts to the front.

Solves #8030.

Signed-off-by: Fini Jastrow <ulf.fini.jastrow@desy.de>
2021-01-20 19:00:25 +00:00
Jussi Pakkanen 3c304bbb79
Merge pull request #8158 from dcbaker/submit/rust-generated-main
rust: Accept generated sources for main.rs
2021-01-20 18:59:25 +00:00
Jonas Lundholm Bertelsen ea34a92632 When iterating link_targets, include link_whole_targets too (fortran)
This fixes fortran includes and fortran orderdeps for libraries that
were under link_whole_targets.
2021-01-20 18:18:54 +01:00
Jonas Lundholm Bertelsen bd2394e872 Use case-insensitive suffix check for fortran
In Fortran it is common to use capital F in the suffix (eg. '.F90') if
the source file makes use of preprocessor statements. Such files should
probably be treated like all other fortran files by meson.

Case insensitivity for suffixes was already implemented several places
in meson before this. So most likely, the few places changed here were
oversights anyway.
2021-01-20 18:11:02 +01:00
Paolo Bonzini 2e982a3864 mtest: collect stdout/stderr even in verbose mode
Using verbose mode dropped stdout/stderr from the logs, because
it was not captured.

Now that we can easily stick code in the middle of the reading of
stdout/stderr, use that to print stdout and stderr on the fly
while also capturing them for the logs.  The output is line-buffered.

As a side effect, this also fixes a possible deadlock due to
not using ensure_future around stdo_task and stde_task.  In
particular:

- the stdo_task coroutine would not terminate until the test closed
stdo_task

- the stde_task coroutine would not start until the stdo_task
coroutine finished

Therefore, the test could get stuck waiting for its parent to
read the contents of stderr, but that would not happen because
Meson was still in the stdo_task coroutine.
2021-01-20 15:06:59 +01:00
Jussi Pakkanen 8133a7b9a4 Keep buildtype the same even if user changes debug and/or optimization. 2021-01-19 20:25:55 +00:00
Dylan Baker caa6d5e16b backend/ninja: Add order dependencies for generated sources in rust 2021-01-19 10:14:12 -08:00
Dylan Baker bff0b41525 rust: Accept generated sources for main.rs
There are still caveats here. Rust/cargo handles generated sources by
writing out all targets of a single repo into a single output directory,
setting a path to that via a build-time environment variable, and then
include those files via a set of functions and macros. Meson's build
layout is naturally different, and ninja makes working with environment
variables at compile time difficult.

Fixes #8157
2021-01-19 10:14:10 -08:00
Dylan Baker 3ae115b57a Replace NinjaBackend is_rust_target with build.uses_rust
we have two functions to do the exact same thing, and they're basically
implemented the same way. Instead, let's just use the BuildTarget one,
as it's more generally available.
2021-01-19 10:12:38 -08:00
Jussi Pakkanen c64d407076 Fix cases where text leaks to stdout in unit tests. 2021-01-18 19:55:42 +00:00
Jussi Pakkanen efe7270429 Do not store config parser object in Wrap object. Closes: #7920. 2021-01-17 21:04:21 +00:00
Marios Staikopoulos a3d8dc546c Removal of /ZI on MSVC Debug
The /ZI flag adds in "Edit and Continue" debug information, which will
cause massive slowdown. It is not a flag that we should be adding by
default to debug builds.

/Zi will still be added.
2021-01-17 21:03:35 +00:00
Xavier Claessens 903c8716e3 external_project: Write output in log files when not verbose 2021-01-17 11:08:08 +00:00
Paolo Bonzini e7c8555575 mtest: move I/O handling to TestSubprocess
Move the logic to start the read/decode
tasks to TestSubprocess and keep SingleTestRunner simple.

The lines() inner function is tweaked to produce stdout as a future.
This removes the nonlocal access (which is not possible anymore
when the code is moved out of _run_cmd), and also lets _run_cmd
use "await stdo_task" for both parsed and unparsed output.
2021-01-15 15:58:53 +01:00
Paolo Bonzini 401464c61a mtest: tweak the gathering of stdo_task/stde_task results
After the next patch, we will need to complete parse_task before
stdo_task (because parse_task will not set the "stdo" variable
anymore but it will still collect stdout just like now).  Do
the change now to isolate the more complicated changes.
2021-01-15 10:03:54 +01:00
Paolo Bonzini 90ea0dc583 mtest: disable the progress report in gdb mode
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-01-15 10:03:54 +01:00
Paolo Bonzini c1c1408fae mtest: introduce ConsoleUser
This new enum can be used by TestSubprocess and TestHarness to
understand (at a higher level) how SingleTestRunner sets up
stdout/stderr redirection.
2021-01-15 10:03:54 +01:00
Paolo Bonzini 1f52e2fa45 mtest: turn TestRun into a hierarchy
Make SimpleTestRunner oblivious of the various test protocols.  All
the different "complete_*" and "parse_*" methods move to the
subclasses of TestRun.
2021-01-15 10:03:54 +01:00
Paolo Bonzini 9e42048e3c mtest: pass command line to TestRun.start
The command line is already available when the test is started.  Pass it to
TestRun.start instead of TestRun.complete*.
2021-01-15 10:03:54 +01:00
Paolo Bonzini 1f5634f15d mtest: add complete_skip to TestRun 2021-01-15 10:03:54 +01:00
Paolo Bonzini c544529faa mtest: simplify complete_exitcode
There is no need anymore to pass the JUnit XML down to complete_exitcode.  Just
set self.junit in complete_gtest instead.
2021-01-15 10:03:54 +01:00
Paolo Bonzini 51e1f01c85 mtest: store the environment in the TestRun
The test_env was lost from the TestRun object in commit
30741a0f2 ("mtest: create TestRun object early on").  Fix
things.
2021-01-15 10:03:54 +01:00
Paolo Bonzini 458c3125e0 mtest: do not print time out message twice
Rebase mistake in "mtest: move timeout message to ConsoleLogger".
2021-01-15 10:03:54 +01:00
Paolo Bonzini ea2f34e286 mtest: allow quickly interrupting the test run
The new behavior of interrupting the longest running test with Ctrl-C is useful
when tests hang, but not when the run is completely broken for some reason.
Psychology tells us that the user will compulsively spam Ctrl-C in this case,
so exit if three Ctrl-C's are detected within a second.
2021-01-14 22:00:51 +00:00
Paolo Bonzini f13b2b4b1d mtest: fix flake8 2021-01-14 22:00:51 +00:00
Xavier Claessens 5db77fd103 coredata: Add missing nopromote wrap_mode choice 2021-01-14 18:29:28 +00:00
Jussi Pakkanen 4b3d48a8c9
Merge pull request #8192 from dcbaker/submit/minstall-type-annotations
Add type annotations to minstall (and some related cleanups)
2021-01-14 15:17:49 +00:00
gaal-dev e3bd45c7c3
Add qtcreator to IDE-integration.md 2021-01-14 08:40:07 -05:00
Dylan Baker 1849a9e9b7 run_mypy: add minstall 2021-01-13 13:32:48 -08:00
Dylan Baker caab4d3d92 minstall: Fix signature of monkeypatched os.chown
this also clears up the last of the mypy problems in minstall, yay!
2021-01-13 13:32:48 -08:00
Dylan Baker c49ad7ca48 minstall: Pass destdir and fullprefix instead of adding them to instance
Same idea as the last patch, just different data
2021-01-13 13:32:48 -08:00
Dylan Baker 2a30f0bd35 minstall: Pass DirMaker separately instead of adding to instance
Add a new attribute to an object outside of the initializer of
construtor is considered an antipattern for good reason, it's gross,
it's confusing, and it often leads to AttributeErrors down some paths.
Let's not do that.
2021-01-13 13:32:48 -08:00
Dylan Baker efe4547d80 minstall: Add type annotations
This adds annotations and fixes a couple of issues (passing Set[bytes]
where List[byte] is expected), however, there's some very gross addition
of attributes to types going on that I haven't fixed yet, and mypy is
very grump about.
2021-01-13 13:32:48 -08:00
Dylan Baker 96d7f6c7cd backends/backends: Add type annotations for InstallData
This adds enough type annotations for InstallData and friends to make
minstall happy. There is also a small change in that I've replaced the
List[List] with List[Tuple], as tuples are more appropraite data types
for the information (fixed length, position matters, different types at
different indexes)
2021-01-13 13:32:48 -08:00
Dylan Baker e36aca42d0 build/interpreter: Split InstallDir to fix layering violation
Currently InstallDir is part of the interpreter, and is an Interpreter
object, which is then put in the Build object. This is a layering
violation, the interperter should have a Holder for build data. This
patch fixes that.
2021-01-13 13:32:48 -08:00
Dylan Baker 59328aba29 build: Add some type annotations 2021-01-13 13:32:48 -08:00
Dylan Baker 022632c91b build/interperter: Add annotations and move input validation to interpreter
This moves the user input validation to the interpreter, instead of
being in the build module, and adds type annotations.
2021-01-13 13:32:48 -08:00
Dylan Baker 6180992d49 minstall: fix imports
This uses PEP8 style, one per from `import mod`, but with commas from
`from mod import a, b`. Also run sort, for niceness.
2021-01-13 13:31:29 -08:00
Dylan Baker a4e1be4e5b scripts/depfixer: make rpaths_dirs_to_remove a set
It's only used for doing an `if x in container` check, which will be
faster with a set, and the only caller already has a set, so avoid
we can avoid a type conversion as well.
2021-01-13 13:30:06 -08:00
Antonin Décimo 39ede12aa5 Fix misspells
Signed-off-by: Antonin Décimo <antonin.decimo@gmail.com>
2021-01-13 12:53:10 -05:00
Eli Schwartz ccb15bc0e9 gen_data.py: even more sorting
glob.glob() is not sorted, despite using shell-style wildcards, and the
documentation does not mention this: https://bugs.python.org/issue21748

Recently, it does start mentioning "Whether or not the results are
sorted depends on the file system." which does not really get to the
heart of the matter...

This is causing fuzz too.
2021-01-13 15:57:06 +00:00
Eli Schwartz adfcf77109
summary: align left, not align middle
aligning along the left is, I think, what most projects want to do.
Aligning along the middle looks subjectively ugly, and objectively
prevents me from further indenting an element, e.g.

  Build information:
    prefix                : /usr
    sysconfdir            : /etc
        conf file         : /etc/myprogram.conf
2021-01-12 19:19:00 -05:00
Eli Schwartz 0063bd35d7
gen_data.py: sort files when generating mesondata
The current way this works is chaos since the tool might return files in
any order and thus shuffle around the order of embedded files. This
results in big diffs that cannot be easily reviewed.

Also regenerate the data according to the, going forward, canonical
ordering algorithm.
2021-01-12 19:19:00 -05:00
Dylan Baker e6a167ce09 dependencies: use env.machines for is_$os methods
Currently we use the mesonlib ones, but these are always the build
machine definitions, rather than being available for either the build or
host machine. We already have an `Environment` instance, and the correct
`MachineChoice`, so lets use that.

Fixes #8165
2021-01-12 19:07:04 +00:00
Luke Elliott 9efcdba0d5 Allow '//' as project function id due to git bash path conversion.
See https://stackoverflow.com/questions/54258996/git-bash-string-parameter-with-at-start-is-being-expanded-to-a-file-path
2021-01-12 17:42:57 +00:00
Jussi Pakkanen 5ff1a3ab25
Merge pull request #8159 from dcbaker/submit/all-env-variables-up-front
Read and store all environment variables up front
2021-01-12 16:19:58 +00:00
Xavier Claessens c659be6928 Interpreter: Fix nested subsubproject detection
A sub-subproject can be configured directly from
`subprojects/foo/subprojects/bar/` in the case `bar` is in the same git
repository as `foo` and not downloaded separately into the main
project's `subprojects/`. In that case the nested subproject violation
code was wrong because it is allowed to have more than one "subprojects"
in path (was not possible before Meson 0.56.0).

Example:
- self.environment.source_dir = '/home/user/myproject'
- self.root_subdir = 'subprojects/foo/subprojects/bar'
- project_root = '/home/user/myproject/subprojects/foo/subprojects/bar'
- norm = '/home/user/myproject/subprojects/foo/subprojects/bar/file.c'

We want `norm` path to have `project_root` in its parents and not have
`project_root / 'subprojects'` in its parents. In that case we are sure
`file.c` is within `bar` subproject.
2021-01-12 15:51:28 +00:00
Eli Schwartz 4ff020759a
CI: fix arch linux tests failing to install wxgtk
There hasn't been any such package since the original addition of a
gtk3 version of wxgtk... back in 2017. The "new" wxgtk2 package provided
a virtual provides ever since, so people still depending on "wxgtk"
would get the old gtk2 version. This virtual provides got dropped today,
resulting in the package being uninstallable.

Resolve the provides to its canonical name, thus making it installable
again.
2021-01-11 19:07:12 -05:00
Dylan Baker ff40ca25b7 make some Environment methods protected
they're really not public methods, they'r only meant to be called from
the initializer. Let's mark them as such.
2021-01-11 11:15:07 -08:00