Commit Graph

6898 Commits

Author SHA1 Message Date
Jussi Pakkanen f64e5cee6b Bump version number for release. 2021-10-24 18:12:07 +03:00
Moroz Oleg 012ec7d5b3 Add stdc++20 support for Visual Studio 2019 v16.11
fix #9242
2021-10-24 17:08:13 +03:00
Daniel Mensinger 2d8da3cb11 interpreter: Fix missing featuer check (fixes #9425) 2021-10-24 09:58:20 -04:00
Daniel Mensinger ffc8721465 cmake: Add support for the Linux CMake registry (fixes #9418) 2021-10-24 09:57:06 -04:00
Dylan Baker 034b3a92d9 compilers/rust: fix typo in standard description 2021-10-21 13:48:01 -04:00
Dylan Baker 841dc2a4e7 compilers/rust: add support for the 2021 edition 2021-10-21 13:48:01 -04:00
Olexa Bilaniuk 8fa5b90bf1 Add entries for new CUDA Toolkit versions. 2021-10-21 10:20:17 +05:30
Gabor Kertesz 60c8fedb95 Add support for win-arm64 to MSVC
For Windows on Arm win-arm64 platform, the corresponding vcvars
is called now.
2021-10-20 12:34:58 -04:00
Jussi Pakkanen cf587f39ea Update version number for rc2. 2021-10-19 17:00:45 +03:00
Gabor Kertesz 747982e6cb Fix NamedTemporaryFile file reopen issue on Win #9412
NamedTemporaryFile can't be opened by name on Windows.
For Windows the created temporary bat file is now closed before
passing to a subprocess, prevented from removal automatically upon
close and deleted explicitly upon finish.
2021-10-19 09:41:17 -04:00
Paolo Bonzini 492cc9bf95 linkers: detect LLD when built with PACKAGE_VENDOR
e7c972b606
added PACKAGE_VENDOR to lld, causing the -v output to start with "Homebrew LLD"
rather than just "LLD".  Meson no longer detects it and fails the
test_ld_environment_variable_lld unit test.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-10-18 14:43:42 -07:00
Paolo Bonzini 8945c53711 mtest: limit "magic" CTRL+C behavior to process group leaders
If meson is not a process group leader, a SIGINT will be delivered also to
its parent process (and possibly other processes).  The parent process then
will probably exit and mtest will continue running in the background, without
any way to interrupt the run completely.

To fix this, treat SIGINT and SIGTERM the same way unless mtest is a
process group leader.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-10-18 15:16:10 -04:00
Matthew Brett 6718556571 Add missing but expected as exception clause
The `except` line was missing its `as e` clause.

As a result, when erroring out, after not finding a compiler, Meson
gives an error ending:

```
File "C:\Users\Matthew\AppData\Roaming\Python\Python39\site-packages\mesonbuild\mesonlib\vsenv.py",
  line 100, in setup_vsenv
      mlog.warning('Failed to activate VS environment:', str(e))
```
2021-10-16 12:41:02 -04:00
Eli Schwartz f52a5a7cd3
wrap: move FeatureNew checks to a more natural place
Now, warnings are unconditionally raised when parsing the wrap file,
whether they are used or not. That being said, these warnings literally
just check for a couple of keys used in the .wrap ini file.

Moving these checks from the time of use to the time of loading, means
that we no longer report warnings only when originally downloading or
extracting the file or VCS repo.

It also means we no longer report warnings in one subproject, when a
wrap file is picked up from a different subproject because the first
subproject actually does a dependency lookup. This caused issues for the
WrapDB tooling, which uses patch_directory everywhere and the
superproject requires a suitable minimum version of meson for this...
but individual wraps might use a much lower version, and would then
raise a warning (in strict mode, converted to an error) when it resolved
a dependency from another WrapDB project.

Fixes #9118
2021-10-15 14:38:44 -04:00
Xavier Claessens a3f3ddf581 cuda: Override std=none to avoid host_compiler to emit -std argument 2021-10-14 14:17:50 -04:00
Xavier Claessens 8a0d12ec29 optinterpreter: Fix builtin option names not being reserved anymore 2021-10-14 14:17:50 -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
Xavier Claessens 4f7c0d0b62 optinterpreter: Downgrade error to deprecation 2021-10-13 08:07:25 -04:00
Daniel Mensinger 220d5aa7ba interpreter: Fix missing holder entry (fixes #9389) 2021-10-12 12:44:33 -04:00
Jussi Pakkanen a331ba1b8b Bump version number for rc1. 2021-10-11 19:52:04 +03:00
Eli Schwartz 88d9646288
pkg-config: do not ever successfully detect Strawberry Perl.
This is broken and terrible and thus completely unusable. Don't torture
users by finding pkg-config on Windows, thus permitting the pkg-config
lookup of several dependencies that do not actually work -- which then
fails at build time.

This also breaks CI for the wrapdb, because Strawberry Perl is provided
as part of the base image for the OS (yes, even though it is terribly
broken!!!) and anything that depends on e.g. zlib will "find" zlib
because of this broken disaster, even though it should use the wrapdb
subproject of zlib.

It is assumed no one actually wants to mix Strawberry Perl and meson. In
fact, some projects, such as gst-build, already unconditionally error
out if Strawberry Perl is detected in PATH:

    error('You have Strawberry Perl in PATH which is known to cause build issues with gst-build. Please remove it from PATH or uninstall it.')

Other projects (postgresql) actually do want to build perl extensions,
and link to the perl dlls, but absolutely under no circumstances ever
want to use its pkg-config implementation. ;)

Let's solve this problem by just considering this to not be a valid
pkg-config, let the user find another or not have one at all.

This change "solves"
https://github.com/StrawberryPerl/Perl-Dist-Strawberry/issues/11
2021-10-10 20:48:42 -04:00
Eli Schwartz dfa19af0ae
simplify some log formatting by splitting out a commonly used format string
There are a bunch of cases in a single function where we would want to
log the detected path of pkg-config. Formatting this is awkward. Define
it once, then use f-strings everywhere. :D
2021-10-10 18:20:45 -04:00
Xavier Claessens 928078982c Add --vsenv command line option and active VS only when needed 2021-10-10 23:15:18 +03:00
Daniel Jacobs 31bea202c9 improve wraptool search 2021-10-10 16:12:57 -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 253ff71e6b
linkers: reorganize Ar linker into a base class
The `init__()` method basically existed solely to be overridden by every
derivative class. Better to use it only in the class that needs it.

This fixes several warnings, including missing calls to init because we
skipped ArLinker due to not wanting it... also get rid of a pointless
popen return code saved as pc, which we never checked.
2021-10-10 11:31:44 -04:00
Eli Schwartz ba432c87a4 Revert "interpreter: Add FeatureNew check"
This reverts commit c0efa7ab22.

This was a nice idea, or a beautiful hack depending on your perspective.
Unfortunately, it turns out to be a lot harder than we originally
thought. By operating on bare nodes, we end up triggering a FeatureNew
on anything that isn't a string literal, rather than anything that
isn't a string.

Since no one else has come up with a better idea for implementing a
FeatureNew, let's just revert it. Better to not have a warning, than
have it trigger way too often.
2021-10-10 16:59:18 +02:00
Eli Schwartz e72da5ff5a msubprojects: implement "packagefiles --save"
Copies packagefiles from the subproject back to the patch_directory for
safe storage and to check into git etc.
2021-10-10 10:17:55 -04:00
Eli Schwartz 8e50ba732e msubprojects: add new subcommand "packagefiles"
This will re-apply the meson.build patch overlay, ensuring it is up to
date. Also take the opportunity offered by this infrastructure to
repatch when performing `update --reset` since internally this will run
`git stash` and thus cause the (possibly locally modified) meson.build
files to disappear.
2021-10-10 10:17:55 -04:00
Eli Schwartz 352380f659 Revert "msubprojects: if fetching the remote fails, gracefully fallback to local copy"
This reverts commit 4568482316.

As it turns out, the rationale for this was completely bogus. This
command doesn't re-apply the patch_directory etc. and in fact there is
no command whatsoever that does this. So, this command does not have two
purposes, and we are not making one of them more robust -- instead it
has one purpose, and we are making it lie about whether it failed.

Instead of trying to freeload off of this command, we will just add
another command to properly apply patch overlays.
2021-10-10 10:17:55 -04:00
Jussi Pakkanen 95d8b8787a Be more strict about target names with slashes. 2021-10-10 15:01:53 +03:00
Xavier Claessens 6b7d43ebe0 minstall: Ignore ldconfig errors when we did not install libraries
Fixes: #9241
2021-10-10 14:42:13 +03:00
Eli Schwartz da81586a5b pkgconfig module: correctly generate Libs search path with absolute install_dir
For example the OpenRC build files install libraries to install_dir: '/lib'
and this works, but causes the generated pkg-config to say:

prefix=/usr

Libs: -L${prefix}//lib

which is both ugly (double //) and resolves to /usr/lib which is exactly
what does not work.
2021-10-10 14:30:46 +03:00
Jussi Pakkanen 046d088549
Merge pull request #9373 from anarazel/vs-build-speed
backend/vs: Parallelize compilation inside one project
2021-10-10 14:26:11 +03:00
Xavier Claessens 77ef437cc4 optinterpreter: Add deprecated kwarg
It can be either:
- boolean: the option is completely deprecated.
- list: some choices are deprecated.
- dict: some choices are deprecated and replaced by another.

Fixes: #7444
2021-10-09 18:13:34 -04:00
Xavier Claessens 953bbf5e19 optinterpreter: Refactor to use typed_pos_args() and typed_kwargs() 2021-10-09 18:13:34 -04:00
Xavier Claessens a844e9bdb0 optinterpreter: Add support for dictionaries 2021-10-09 18:13:34 -04:00
Xavier Claessens 709d151eb9 typed_kwargs: Fix when ContainerTypeInfo is used in a tuple
info.types could be a tuple like (str, ContainerTypeInfo()). That means
we have to check types one by one and only print error if none of them
matched.

Also fix the case when default value is None for a container type, it
should leave the value to None to be able to distinguish between unset
and empty list.
2021-10-09 18:13:34 -04:00
Xavier Claessens 329d111709 python: Add platlibdir and purelibdir options 2021-10-08 17:47:35 -04:00
Xavier Claessens 5316c7df62 ModuleState: Add wrapper to get option 2021-10-08 17:47:35 -04:00
Xavier Claessens 2628ce576c Add support for module options 2021-10-08 17:47:35 -04:00
Eli Schwartz 108bd996ee
add install_emptydir function
This replaces the absolute hack of using

```
install_subdir('nonexisting', install_dir: 'share')
```

which requires you to make sure you don't accidentally or deliberately
have a completely different directory with the same name in your source
tree that is full of files you don't want installed. It also avoids
splitting the name in two and listing them in the wrong order.

You can also set the install mode of each directory component by listing
them one at a time in order, and in fact create nested structures at
all.

Fixes #1604
Properly fixes #2904
2021-10-08 14:35:00 -04:00
Paolo Bonzini 7639b70796 cmake: handle arguments in the [binaries] section of the machine file
Sometimes, the machine file can include compiler command line options,
in order to pick the correct multilib.  For example, Meson uses "$cc
--print-search-dirs" to find the library search path, where $cc is the
cc from the machine file.  Because the outputs of "gcc -m32
--print-search-dirs" and "gcc --print-search-dirs" are different, this
only works if you have

   [binaries]
   cc = ['gcc', '-m32']

in the machine file.  Right now, however, the cmake module assumes that
the compiler listed in the machine file is either a compiler, or a
"launcher" followed by the compiler.  Check if the second argument
starts with a slash (for Microsoft-like compilers) or a dash (for
everyone else), and if so presume that the CMAKE_*_COMPILER_LAUNCHER
need not be defined.
2021-10-08 20:09:43 +02:00
Andres Freund 14096260c4 backend/vs: Parallelize compilation inside one project.
UseMultiToolTask allows parallelism inside a project, without requiring cl.exe
internal multi-threading (which meson generated projects currently can't use,
mainly due to specifying output filenames for each object).

TODO:
- think about making behaviour conditional on msbuild version / add comment
  why not
2021-10-08 10:10:19 -07:00
Andres Freund 1fb2818d42 backend/vs: Deduplicate basic project template.
Note that a few minor details of the output changed for some target types. I
think I called them out with XXXs in the code for now.
2021-10-08 10:09:20 -07:00
Andres Freund f2e4177c76 backend/vs: Name pch pdb files to avoid naming & lock conflicts. 2021-10-08 09:17:16 -07:00
Andres Freund 157f11dc9e backend/vs: Move Microsoft.Cpp.props to before ItemDefinitionGroup.
The main reason for this move is to make it easier to merge the copies of
project generation. But as far as I can tell, the Microsoft.Cpp.props import
also belongs before the ItemDefinitionGroup.

Originally the order seems to have been that way, but 431a9ea664 changed it in
the course of other changes.
2021-10-08 09:16:19 -07:00
Dylan Baker 3f8c78b317 modules/gnome: Fix unset install_dir
install_dir needs to be set to something, because CustomTarget expects
that. genmarshal still relies on CustomTarget setting it internally
itself.

Fixes #9350
2021-10-08 08:44:30 -04:00