Commit Graph

14558 Commits

Author SHA1 Message Date
Dylan Baker a3444d31db interpreter: use typed_kwargs for build_target.implicit_include_directories 2023-10-17 08:09:06 -07:00
Dylan Baker ca32ffc157 interpreter: use typed_kwargs for build_target.extra_files 2023-10-17 08:09:06 -07:00
Dylan Baker 357abf51c5 interpreter: use typed_kwargs for build_target.native 2023-10-17 08:09:06 -07:00
Dylan Baker 2fc8729078 interpreter: use typed_kwargs for build_target.install_mode 2023-10-17 08:09:06 -07:00
Dylan Baker bae2e13b39 interpreter: use typed_kwargs for build_target.install 2023-10-17 08:09:06 -07:00
Dylan Baker 507d8bf4d7 interpreter: use typed_kwargs for build_target.build_by_default
This allows a little bit of cleanup in the build layer, since there is
code now that would always be true and we shouldn't do that.
2023-10-17 08:09:06 -07:00
Nirbheek Chauhan bd0ab92bba msubprojects: Fix typo 'any way' -> 'anyway' 2023-10-17 13:02:23 +05:30
Xavier Claessens 746c4eff48 msubprojects: Fix crash if wrapdb_version is in bad format
Fixes: #12378
2023-10-17 13:02:23 +05:30
Dylan Baker 5fcf347661 modules/rust: only use include and define args from global/project args 2023-10-17 12:58:09 +05:30
Dylan Baker 658fe7243b modules/rust: remove rust_crate_type for test() method
This is required to test non-executable targets when they set an
explicit type.
2023-10-16 17:31:12 -07:00
Dylan Baker 74771d2119 compilers/d: use DFeatures for get_features_args 2023-10-16 13:28:32 -07:00
Dylan Baker 6599c32fd3 compilers/d: remove duplicate method from subclass
The DCompiler and DmDLikeCompiler classes both implement the exact same
`get_feature_args()` method. The DmdLikeCompiler inherits the DCompiler.
As such, removing it doesn't change the behavior of anything, but
decreases the chances of bugs being introduced, as well as LoC.
2023-10-16 13:28:32 -07:00
Dylan Baker b2f681c92a build: use a TypedDict for d_features
This allows for better type checking.
2023-10-16 13:28:32 -07:00
Dylan Baker 7c101413d0 interpreter: use typed_kwargs for build_target.d_unittest 2023-10-16 13:28:32 -07:00
Dylan Baker 2048d1333e interpreter: use typed_kwargs for build_target.d_module_versions 2023-10-16 13:28:32 -07:00
Dylan Baker 9b1efa37fd interpreter: use typed_kwargs for build_target.d_import_dirs 2023-10-16 13:28:32 -07:00
Dylan Baker 19beb070e8 interpreter: use typed_kwargs for build_target.d_debug 2023-10-16 13:28:32 -07:00
Nirbheek Chauhan 4ebe03713d ninjabackend: Use the right ranlib for static linker rules
Fixes https://github.com/mesonbuild/meson/issues/12349
2023-10-12 09:31:04 -07:00
Mattijs Korpershoek 4ae75eef16 cpp: use -nostlib++ instead of -nostlib for custom cpp_stdlib
The <lang>_stdlib can be used in cross files to use a custom standard library
for a given language.

When cpp_stdlib is used in a cross file, meson passes
* -nostdinc++ to the compiler
* -nostlib to the linker

According to [1] (gcc) and [2] (clang), we should pass -nostlib++ to the linker
when we don't want to link to the standard C++ library.
Currently, we pass -nostlib.

Fix this by implementing a C++ specific get_no_stdlib_link_args() function.

[1] https://gcc.gnu.org/onlinedocs/gcc/Link-Options.html#index-nostdlib_002b_002b
[2] https://clang.llvm.org/docs/ClangCommandLineReference.html#cmdoption-clang-nostdlib
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
2023-10-12 20:15:42 +05:30
Tristan Partin c0a5da8649 Use -idirafter when adding Apple framework include paths
System headers will continue to "preempt" the framework headers. This
should allow both <GStreamer/gst/gst.h> and <gst/gst.h>
2023-10-12 05:13:55 +05:30
Ada 4c9927e8b7 Fix MSVC linker error LNK1170 with long rspfiles
The MSVC linker errors out if a line in the rspfile is too long.
The resolution is to use the built-in ninja keyword $in_newline instead of $in, which splits each input into separate lines.
2023-10-12 02:48:45 +05:30
Charles Brunet 208b31faf1 MSVCDynamicLinker: prevent duplicated /nologo argument 2023-10-12 02:48:18 +05:30
Nirbheek Chauhan 3c6f04b294 msubprojects: Checkout if the branch is tracking upstream
A rebase of the current branch is the wrong thing to do if the
revision (branch) specified in the wrap changed, which is the case in
the majority of cases, such as when switching from one release branch
to another.
2023-10-11 23:48:13 +05:30
Nirbheek Chauhan b78aa8f9e9 msubprojects: Abort the rebase if there's conflicts
Don't leave the subproject tree in a broken / conflicting state. The
user is most likely not a git expert who will know what magic command
to run to fix their source tree.
2023-10-11 23:48:13 +05:30
Xavier Claessens 3af0632c3d cargo: Use rust_abi and rust.proc_macro() instead of rust_crate_type 2023-10-09 21:13:58 -04:00
Xavier Claessens dc329f0f04 interpreter: Add support for cargo subproject 2023-10-09 21:13:58 -04:00
Xavier Claessens ea42d2d019 cargo: Fix '1.0.45' version conversion
The middle 0 was wrongly dropped.
2023-10-09 21:13:58 -04:00
Xavier Claessens 019a0c38c6 cargo: Support all crate library types 2023-10-09 21:13:58 -04:00
Xavier Claessens d6bf48cd7e cargo: Package description is optional 2023-10-09 21:13:58 -04:00
Xavier Claessens 3a16da39ad cargo: Add support for rust_dependency_map 2023-10-09 21:13:58 -04:00
Xavier Claessens 3abe52133d cargo: Use "-rs" suffix convention to lookup for Rust dependencies 2023-10-09 21:13:58 -04:00
Xavier Claessens f752efdd88 cargo: interpreter: Reorganize functions order
Keep _create_foo() functions together and with a common signature.
That's cleaner especially since we are going to add more of them.
2023-10-09 21:13:58 -04:00
Xavier Claessens 05d5055d85 cargo: Remove unused function 2023-10-09 21:13:58 -04:00
Xavier Claessens 3334addbbd cargo: Builder: Add dict support 2023-10-09 21:13:58 -04:00
Xavier Claessens b5b952688f cargo: builder: Remove all duplicated functions
Keep only the Builder class, there is no point in duplicating
everything.
2023-10-09 21:13:58 -04:00
Dylan Baker 013536fcb4 interpreter: add <lang>_(static|shared)_args
Which allow passing arguments specifically to the static or shared
libraries.

For design, this is all handled in the interpreter, by the build layer
the arguments are combined into the existing fields. This limits changes
required in the mid and backend layers
2023-10-09 17:33:48 -04:00
Dylan Baker e24f430512 interpreter: extend annotations around build_both_libraries
This allows for even more accurate type information
2023-10-09 17:33:48 -04:00
Dylan Baker 835b23efb4 interpreter: deprecated language args that don't apply to targets
`java_args` is only valid for `jar()` (and `build_target()`, but that's
deprecated), while all other language args are invalid for `jar()`. This
deprecates all of those arguments, that shouldn't be allowed, and
provides useful error messages. As an advantage, this avoids generating
useless `java_static_args` and `java_shared_args`.

In order to get useful error messages for both build_target and
executable + *library, we need to separate LIBRARY and BUILD_TARGET a
bit.
2023-10-09 17:33:48 -04:00
Dylan Baker 523a27c6f0 build: Use typed_kwargs for language args
This also moves the repacking into the interpreter, making the build
implementation simpler and removing a layering violation. This also
makes use a defaultdict to remove the need to call `.get()`
2023-10-09 17:33:48 -04:00
Dylan Baker cbca191948 interpreter: Handle BuildTarget.vala_args as Files in the interpreter
Way back in Meson 0.25, support was added to `vala_args` for Files.
Strangely, this was never added to any other language, though it's been
discussed before. For type safety, it makes more sense to handle this in
the interpreter level, and pass only strings into the build IR.

This is accomplished by adding a `depend_files` field to the
`BuildTarget` class (which is not exposed to the user), and adding the
depend files into that field, while converting the arguments to relative
string paths. This ensures both the proper build dependencies happen, as
well as that the arguments are always strings.
2023-10-09 17:33:48 -04:00
Tristan Partin 8490eaa29d Add simd.py to run_mypy.py 2023-10-09 17:25:05 -04:00
Tristan Partin 101d783d66 Clean up some of the code in simd.check() 2023-10-09 17:25:05 -04:00
Tristan Partin a5f323b6cf Finish typing the simd module 2023-10-09 17:25:05 -04:00
Tristan Partin a3d287c553 Port simd.check() to typed_pos_args/typed_kwargs 2023-10-09 17:25:05 -04:00
Benjamin Redelings 84b8d257e4 Allow c++23 in gcc-11. 2023-10-09 23:53:31 +03:00
Eli Schwartz 49a6a99c7f
wrap: catch failure to extract tarball and raise WrapException
This most likely happens when the source archive has files which take
advantage of case sensitivity, and someone is unfortunate enough to have
to work with broken operating systems that do not have the capacity to
use modern technology, like the 1970s invention of case sensitive
filesystems.

For example, Windows and macOS both have retrocomputing environments,
where case sensitive abilities were carefully removed from modern
filesystems in order to share the delights of classical computing with
the masses.

On such systems, innocent tarballs fail to extract with:

```
OSError: [Errno 22] Invalid argument: 'C:\path\to\file'
```

thereby demonstrating Microsoft's unbounded and enthusiastic love for
users (who are, universally, retrocomputing fans).

n.b. there is, begrudgingly, a secret option for crazy people who hate
retrocomputing to enable modern 1970s computing on Windows systems.
Naturally, no one with any sense would ever use this, and it is rightly
left in its sensible default in for example Github Actions.

Fixes #12344
2023-10-08 23:16:37 -04:00
Nigel Kukard 2c4a1b6324 Add support for lcov 2.0
lcov 2.0 deprecates `--rc lcov_branch_coverage=1` for `--rc branch_coverage=1` and
gives an error when an exclude is used on a non existing directory.

I added a version check for lcov and removed the subprojects directory from the
exclusion list if it does not exist.

Fixes #11995
2023-10-08 23:13:06 -04:00
Jussi Pakkanen 583d2815d1 Document the color used in the logo. 2023-10-06 13:09:53 +03:00
Nomura 3cac6ea545 Add env kwarg in generator.process() 2023-10-05 09:59:43 -07:00
Dudemanguy 03a0d3ddfb mcompile: add suffix as an additional parameter
Since the previous commit allows for more scenarios with name
collisions, it makes sense to expand the compile command so that it can
also take into account suffixes. i.e. meson compile -C build foo.exe can
now work if the executable has an exe suffix along with being named foo.
2023-10-05 08:43:38 -07:00