Commit Graph

10144 Commits

Author SHA1 Message Date
Jussi Pakkanen aae23dfff3
Merge pull request #7740 from bonzini/fallback-false
Allow blocking/forcing automatic subproject search
2020-10-12 17:50:14 +03:00
Camilo Celis Guzman ba71fde186 mtest: collect failures regardless of colorized console 2020-10-12 00:51:21 +03:00
Daniel Mensinger 96c31d9dbc typing: fix mypy typing error 2020-10-12 00:23:59 +03:00
Jussi Pakkanen 7b1cc95c7f Update wrap maintenance documentation. [skip ci] 2020-10-10 22:14:34 +02:00
Sahnvour f80dcb4f33 add test case for #6365 2020-10-10 04:28:16 +00:00
Sahnvour 206e9e5097 Properly handle the case of linking static library with custom targets 2020-10-10 04:28:16 +00:00
Paolo Bonzini 726b822054 dependency: support boolean argument "allow_fallback"
Sometimes, distros want to configure a project so that it does not
use any bundled library.  In this case, meson.build might want
to do something like this, where slirp is a combo option
with values auto/system/internal:

  slirp = dependency('', required: false)
  if get_option('slirp') != 'internal'
    slirp = dependency('slirp',
                       required: get_option('slirp') == 'system')
  endif
  if not slirp.found()
    slirp = subproject('libslirp', ...) .variable('...')
  endif

and we cannot use "fallback" because the "system" value should never
look for a subproject.

This worked until 0.54.x, but in 0.55.x this breaks because of the
automatic subproject search.  Note that the desired effect here is
backwards compared to the policy of doing an automatic search on
"required: true"; we only want to do the search if "required" is false!

It would be possible to look for the dependency with  `required: false`
and issue the error manually, but it's ugly and it may produce an error
message that looks "different" from Meson's.

Instead, with this change it is possible to achieve this effect in an
even simpler way:

  slirp = dependency('slirp',
                     required: get_option('slirp') != 'auto',
                     allow_fallback: get_option('slirp') == 'system' ? false : ['slirp', 'libslirp_dep'])

The patch also adds support for "allow_fallback: true", which is
simple and enables automatic fallback to a wrap even for non-required
dependencies.
2020-10-08 12:24:07 +02:00
Paolo Bonzini 1eec5cf41f interpreter: clean up handling of force_fallback
Force_fallback is not an interpreter keyword argument, and there
is no reason to handle it as one since it is not used anywhere
else (and in fact is explicitly ignored by get_dep_identifier).
Use a Python keyword argument instead, which makes the code
simpler.
2020-10-08 12:23:46 +02:00
Paolo Bonzini 862bc146a8 interpreter: refactor handling of dependency(fallback: ...) 2020-10-08 11:12:36 +02:00
Paolo Bonzini a4f1caa405 docs: improve documentation of subproject fallback
Automatic fallback to subprojects is complicated and should be
pointed out outside the "fallback" keyword argument.  It is also
surprising that fallback to a subproject will not happen if
override_dependency has already been used with the request
dependency.  Document all this.
2020-10-08 11:11:15 +02:00
Xavier Claessens 9295aedb8d Tests: py.dependency() now has required:true by default
It used to ignore the required argument and got fixed to be consistent
with dependency() function.
2020-10-07 19:08:17 +02:00
Jussi Pakkanen 1a0603835e Add win_subsystem kwarg. Closes #7765. 2020-10-07 18:55:25 +03:00
Xavier Claessens 8b20852b0f python.dependency() is not respecting 'required' kwarg 2020-10-06 19:15:59 -04:00
Dylan Baker 88fecedc77 environment: provide a more detailed explanation of linker detection failures
Just saying "it failed" is accurate, but not useful to helping someone
figure out why it failed. Giving them the stdout and stderr (like we
might with compilers) should help people resolve the issue.

Fixes: #7173
2020-10-06 23:06:28 +03:00
Vinson Lee 5d7069664b compilers: Enable C++20 for Intel C++ Compiler.
Intel C++ Compiler 19.1 has C++20 features.

https://software.intel.com/content/www/us/en/develop/articles/intel-c-compiler-191-for-linux-release-notes-for-intel-parallel-studio-xe-2020.html

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2020-10-06 22:11:34 +03:00
Dylan Baker 94ac51fdda options: Handle updates to choices in options
Currently if you change the `choices` field in the meson_options.txt
file, no update will be done until `meson setup --wipe` is called. Now
if the choices change then the options will be properly merged.

If the currently select value is still valid it is guaranteed to be
kept, if it is now invalid the new default value will be used and a
warning will be printed.

Fixes #7386
2020-10-05 23:10:35 +03:00
Bernd Busse c4fa876925 Never run clang-format / clang-tidy against directories
`pathlib.Path.glob()` also returns directories that match source
filenames (i.e. a directory named `test.h/`), but `clang-format` and
`clang-tidy` fail when handed a directory. We manually skip calling
`clang-format` and `clang-tidy` on those directories.
2020-10-05 23:07:20 +03:00
Dylan Baker 4b1c1d83c8 machinefiles: Allow keys to be stored case insensitive
This is required to make the various keys in the [user options] section
work the same as they do in the meson_options.txt file, where we don't
have any rules about case sensitivity.

There is some risk here. Someone may be relying on this lower by default
behavior, and this could break their machine files.

Fixes #7731
2020-10-05 08:59:45 -04:00
Roman Bolshakov 30a102d9a3 linkers: Drop -pie on macOS
Projects that specify b_pie=true clutter build logs with the warning:

  clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument]

No option is needed to produce PIE binaries because ld64 is making PIE
executables on 10.7 and above by default, as documented in ld(1).

Signed-off-by: Roman Bolshakov <r.bolshakov@yadro.com>
2020-10-04 20:16:49 +03:00
Oskar Sigvardsson 962ea8053b Added subdir files test 2020-10-04 14:52:28 +02:00
Oskar Sigvardsson 1d443f1bc6 Fixed using files object in subdir with xcode backend
Fixes bug #589. When generating string from file object, it didn't take subdir
into account.
2020-10-04 14:52:28 +02:00
Daniel Mensinger 1dfaccfd91 pathlib: Fix resolve() by overriding it in Python 3.5 2020-10-04 10:45:48 +02:00
Daniel Mensinger 77b5c82d07 cmake: switch to pathlib (fixes #7322) 2020-10-04 10:45:48 +02:00
Dylan Baker 10b44584ff
Merge pull request #7795 from dcbaker/submit/full-compiler-annotations
Full annotations for the Compiler package
2020-10-03 21:25:04 -07:00
Nirbheek Chauhan 264939963f docs: Fixup find_program search path documentation [skip ci]
It was slightly wrong, and also make it a bullet point for easier
parsing.
2020-10-02 09:38:35 +00:00
Vili Väinölä 32cf7a03d2 Fix meson compile for 32-bit MSVC build
- Remove platform from env so that msbuild does not try to compile
e.g. configuration debug|x86
2020-10-02 09:09:43 +00:00
Dylan Baker 2fe400c350 compilers/icl fix IntelClCPP argument checking
Unlike MSVC and ClangCl it needs to call into it's own compiler check
args
2020-10-01 15:06:10 -07:00
Dylan Baker f9316fbb46 compilers/icl: Fix pch usage 2020-10-01 15:06:10 -07:00
Dylan Baker be99d00e95 linkers: Fix Xilink constructor 2020-10-01 15:06:10 -07:00
Dylan Baker b309f4904b compilers/fortran: make ifort on windows signature match ICL's 2020-10-01 15:06:10 -07:00
Dylan Baker ff51e1c5aa compilers/clike: Store exe_wrapper as ExternalProgram
Which is what other languages do.
2020-10-01 15:06:10 -07:00
Dylan Baker 135f5d5838 compilers: make get_optimization_args abstract 2020-10-01 15:06:10 -07:00
Dylan Baker 577a2de7e8 compilers/fortran: fix has_multi_*_arguments
The implementation of the link variant was what should have been the
compiler variant, and there was no valid compiler variant, which meant
it was getting C code.
2020-10-01 15:06:10 -07:00
Dylan Baker 4cdc32114b run_mypy: mark the whole compilers package as type safe 2020-10-01 15:06:10 -07:00
Dylan Baker 6a9761a2c0 compilers/d: add type annotations 2020-10-01 15:06:10 -07:00
Dylan Baker 6eb981e0c0 compilers/gnu: Don't pretend to inherit CLike
We don't need it anymore, and it would be problematic for the D
compilers.
2020-10-01 15:05:01 -07:00
Dylan Baker 738e343860 compilers: move _build_wrapper out of clike into Compiler
This abstraction is really useful, and most compilers could use it
(including D). It also will allow the Gnu mixins to work properly
without the CLikeCompiler in their mro.
2020-10-01 15:05:01 -07:00
Dylan Baker cd59ce98dc compilers: clang: use get_compiler_check_args 2020-10-01 15:05:01 -07:00
Dylan Baker 1c20f187e8 compilers/intel: use get_compiler_check_args
Instead of trying to override the compiles() method, which gets skipped
in a bunch of cases.
2020-10-01 15:05:01 -07:00
Dylan Baker 8291e947f5 compilers: move get_compile_check_args() to Compiler
This is groundwork to put _build_wrapper in the base Compiler, which is
needed to make the D compilers truly type safe.
2020-10-01 15:05:01 -07:00
Dylan Baker e039727e63 compilers/fortran: add type annotations 2020-10-01 15:05:01 -07:00
Dylan Baker 3fc37fc13e compilers/java: Add type annotations 2020-10-01 15:05:01 -07:00
Dylan Baker 4430269d4e compilers/rust: add type annotations 2020-10-01 15:05:01 -07:00
Dylan Baker e437bdd0a9 compilers/swift: Add type annotations 2020-10-01 15:05:01 -07:00
Dylan Baker efceec9615 Compilers/vala: Add type annotations 2020-10-01 15:05:00 -07:00
Dylan Baker d3a059b55f compilers/cuda: make type safe 2020-10-01 15:05:00 -07:00
Dylan Baker 6d173f9678 mesonlib: make OptionOverrideProxy a true MutableMapping
So that we can actually use it anyplace that an OptionDictType could be
used. I've also done a bit optimizing/simplifying of the implementation.
This is needed for cuda, as it returns an OptionOverrideProxy where we
ask for an OptionDicType
2020-10-01 15:05:00 -07:00
Dylan Baker 224a752489 compilres: move depfile_for_object to compiler 2020-10-01 15:05:00 -07:00
Dylan Baker 413f4d87e9 compilers/cs: Add type annotations 2020-10-01 15:05:00 -07:00
Dylan Baker e7f0890cb9 compilers: move get_dependency_gen_args to base Compiler
So that every subclass doesn't have to reimplement it. Especially since
the Gnu implementation moved out of the CCompiler and into the
GnuLikeCompiler mixin
2020-10-01 15:05:00 -07:00