Commit Graph

10512 Commits

Author SHA1 Message Date
Eli Schwartz 9d602e6531
do not require git installed in order to use wraps
It doesn't make sense to check for the presence of git every time we use
it, but short-circuit any attempt to use a wrap right from the get-go
because we are trying to be fancy with submodules.

If git is not installed, simply do not try to figure out whether the
wrap is a submodule that can potentially be checked out/updated for the
user. Just take it on faith that it isn't one.

Fixes #2623
2021-01-26 08:09:53 -05:00
Florian Schmaus 0f5a136c40
docs: Fix sentence in Machine-files.md [skip ci]
Fixes: 1ca17dc853 ("docs/machine-files: Add a section on data types")
2021-01-26 08:09:53 -05:00
Volker-Weissmann 9e3bb9eea3
Warn about .C and .H files (#8249) 2021-01-26 00:06:31 +02:00
Jussi Pakkanen bb6385111a
Merge pull request #8236 from dcbaker/submit/rust-fix-generated-sources-in-subdir
Submit/rust fix generated sources in subdir
2021-01-25 18:24:28 +00:00
Ben Niu f0881cf365 Add ARM64EC as a new conceptual cpu type of arm64
ARM64EC is a new ARM64 ABI made by Microsoft. The ARM64EC binaries can be loaded in x64 processes on the latest Windows Insider Preview on ARM64, and they don't need to be emulated for the sake of performance.

To support the ARM64EC build target, a new conceptual arm64 cpu type 'arm64ec' is added. The cpu can be specified in cross files like below to generate msbuild solution/vcxproj files with platform set to ARM64EC.

[target_machine]
system = 'windows'
cpu_family = 'aarch64'
cpu = 'arm64ec'
endian = 'little'
2021-01-25 18:20:13 +00:00
Jussi Pakkanen 99b9433bea
Merge pull request #8226 from jonaslb/fortranstatic
Fixes for fortran: Include dirs for link_whole_targets and capital file suffix
2021-01-23 17:33:38 +00:00
Evgeny Ermakov a24546d7da docs: Fix typo in Syntax.md [skip ci] 2021-01-23 17:25:51 +00:00
Dylan Baker 23d3b98fc1 split mesonlib into a package
Currently mesonlib does some import tricks to figure out whether it
needs to use windows or posix specific functions. This is a little
hacky, but works fine. However, the way the typing stubs are implemented
for the msvcrt and fnctl modules will cause mypy to fail on the other
platform, since the functions are not implemented.

To aleviate this (and for slightly cleaner design), I've split mesonlib
into a pacakge with three modules. A universal module contains all of
the platform agnositc code, a win32 module contains window specific
code, a posix module contains the posix specific code, and a platform
module contains no-op implementations. Then the package's __init__ file
imports all of the universal functions and all of the functions from the
approriate platform module, or the no-op versions as fallbacks. This
makes mypy happy, and avoids `if`ing all over the code to switch between
the platform specific code.
2021-01-23 12:48:29 +01:00
Paolo Bonzini ec02753fbf docs: add documentation snippet for meson test console output changes 2021-01-22 12:18:59 +01:00
Paolo Bonzini 12b3d05d1e mtest: log individual TAP subtests 2021-01-22 12:18:59 +01:00
Paolo Bonzini 7b02abeac6 mtest: infrastructure to print subtest results 2021-01-22 12:18:59 +01:00
Paolo Bonzini bb9d8b5b80 mtest: move --print-errorlogs output during the test run
Print the (shortened) output of the failed tests as they happen.
If neither --verbose nor --print-errorlogs was specified, omit the
summary of failures, because it is pretty much the same as the earlier
output of "meson test".
2021-01-22 12:18:59 +01:00
Paolo Bonzini 4d6a0cc174 mtest: log test start in verbose mode
In non-parallel verbose mode the output of the test/benchmark
is not buffered, therefore the command line is only printed by
ConsoleLogger for failing tests and only after the test has run.

Verbose mode is designed mostly for CI systems, where output must
be human readable but is generally consumed from a browser with "Find"
commands rather than from a terminal.  With this usecase in mind, it
is better to provide as much detail as possible, so add more output
and just tell the user which tests have started.  Do so, using the
recently introduced TestResult.RUNNING state.
2021-01-22 12:18:59 +01:00
Paolo Bonzini 959e4b3a5e mtest: call TestLogger.start_test when TestRun is in the RUNNING state 2021-01-22 12:18:59 +01:00
Paolo Bonzini 289cc2e2c5 mtest: use buffered stdout/stderr in parallel mode
Similar to ninja, buffer stdout/stderr even in verbose mode if more than one test is
being run in parallel.
2021-01-22 12:18:59 +01:00
Paolo Bonzini a0da710172 mtest: quote environment variable values and command line arguments 2021-01-22 12:18:59 +01:00
Paolo Bonzini 04bab9d595 mtest: include full environment in the TestRun object
Ensure that all the required modifications are included in the logs.
This makes it possible for users to cut-and-paste from the logs when
trying to reproduce failures outside Meson.
2021-01-22 12:18:59 +01:00
Paolo Bonzini 111f22a4f8 mtest: make log output more suitable for console
Right now the same code is used to print the logs for both the console
and the text log.  Differentiating them lets the important bits of
the console output stand out, and makes the console output a bit more
readable.
2021-01-22 12:18:59 +01:00
Paolo Bonzini a118cae9d2 mtest: small refactoring of log printing
Start moving console-specific code to ConsoleLogger, as well
as moving code out of get_log().
2021-01-22 12:18:59 +01:00
Paolo Bonzini 2386f336f1 mtest: log in verbose mode, but not in gdb mode
This is now possible because all stdout/stderr goes through asyncio pipes.
However, logs make little sense in gdb mode.
2021-01-22 12:18:59 +01:00
Paolo Bonzini 52a2f46af1 unittests: use utf-8 encoding for child processes
Ensure that unit tests will be able to parse UTF-8 output of "meson test".
2021-01-22 12:18:59 +01:00
Dylan Baker d02149ad90 tests/rust: Add a generated library to generated main test
Which is broken, of course.
2021-01-21 10:59:15 -08:00
Dylan Baker 4550cf9500 ninjabackend: Correctly reference custom_target outputs in subdirs with rust
This was missed in the last iteration of fixing things.
2021-01-21 10:59:15 -08:00
Dylan Baker 27ca7ed67a tests/rust: Add subdir to generated sources test 2021-01-21 10:59:15 -08:00
Paolo Bonzini adb1b2f3f6 interpreter: accept external programs and dependencies for summary 2021-01-21 08:54:35 -05:00
Paolo Bonzini 021068a8b7 mlog: add __len__ to AnsiDecorator 2021-01-21 08:54:35 -05:00
Paolo Bonzini 9ba7b0ebd0 mlog: add __str__ method to AnsiDecorator
Automatically colorize the text when printing the AnsiDecorator, based
on the result of mlog.colorize_console().  This is how AnsiDecorator
is used most of the time anyway.
2021-01-21 08:54:35 -05:00
Jonas Lundholm Bertelsen d3ae808742 Add fortran test with an install:yes static library
This adds a test which makes use of an install:yes static library that
depends on another static library. This triggers a promotion to
link_whole_target inside meson which takes different code paths in
certain places.

Also makes use of .F90 source (capital F) to test for case
(in)sensitivity.
2021-01-21 14:46:20 +01:00
Jonas Lundholm Bertelsen 2636eebd64 Unity build reverts to normal for fortran fix
The `determine_ext_objs` function did not take into account that fortran
(and d) does not support unity builds. This caused failures in some
cases.
2021-01-21 14:46:20 +01:00
Xavier Claessens 05ab792d58 external_project: Log configure command 2021-01-20 19:11:50 +00:00
Marios Staikopoulos f8681b12e1 MSVC and Clang-Cl Compiler Argument Cleanup
This commit performs some cleanup for the msvc and clang-cl arguments.

* "Disable Debug" (`/Od`) is no longer manually specified for optimization levels {`0`,`g`} (it is already the default for MSVC).
* "Run Time Checking" (`/RTC1`) removed from `debug` buildtype by default
* Clang-CL `debug` buildtype arguments now match MSVC arguments
* There is now no difference between `buildtype` flags and `debug` + `optimization` flags
2021-01-20 14:11:16 -05:00
Brion Vibber d808429a48 Avoid accidental use of STANDALONE_WASM mode on compiler tests
Compiler tests, such as checking for atomics support, could fail
when compiling to WebAssembly multithreaded targets because the
compiler tests got compiled to 'output.wasm'.

Using the '.wasm' suffix in recent versions of emscripten engages
STANDALONE_WASM mode, which disables features that require a JS
runtime like shared memory.

This created false negatives on support of those features when
building a library to be linked into an executable that is not
in STANDALONE_WASM mode.

Changing these to 'output.o' will continue to produce WebAssembly
object files, but they will no longer be configured for standalone
runtime mode.
2021-01-20 19:10:21 +00:00
Volker Weißmann 2e48d13fa2 Added "How do I use a library before declaring it?" in the FAQ. 2021-01-20 19:07:04 +00:00
Jussi Pakkanen 4d5f6876f9
Merge pull request #8225 from bonzini/mtest-asyncio-cleanups
mtest: cleanups and bugfixes
2021-01-20 19:02:25 +00:00
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