aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/markdown/Release-notes-for-1.8.0.md134
-rw-r--r--docs/markdown/snippets/android-exe-type.md10
-rw-r--r--docs/markdown/snippets/b_sanitizer_changes.md17
-rw-r--r--docs/markdown/snippets/c2y.md4
-rw-r--r--docs/markdown/snippets/i18n_xgettext.md12
-rw-r--r--docs/markdown/snippets/multiple_version_compare.md8
-rw-r--r--docs/markdown/snippets/objc-cpp.md8
-rw-r--r--docs/markdown/snippets/optionrefactor.md19
-rw-r--r--docs/markdown/snippets/rust-objects.md4
-rw-r--r--docs/markdown/snippets/rust-test-link-whole.md4
-rw-r--r--docs/markdown/snippets/rustdoc.md6
-rw-r--r--docs/markdown/snippets/stabilized-wayland.md4
-rw-r--r--docs/markdown/snippets/swift-std.md4
-rw-r--r--docs/markdown/snippets/test-slicing.md6
-rw-r--r--docs/markdown/snippets/valgrind_test.md6
-rw-r--r--docs/sitemap.txt1
-rw-r--r--mesonbuild/compilers/compilers.py17
-rw-r--r--mesonbuild/compilers/cs.py5
-rw-r--r--mesonbuild/compilers/cuda.py23
-rw-r--r--mesonbuild/compilers/d.py10
-rw-r--r--mesonbuild/compilers/java.py5
-rw-r--r--mesonbuild/compilers/mixins/clike.py17
-rw-r--r--mesonbuild/compilers/rust.py14
-rw-r--r--mesonbuild/compilers/swift.py10
-rw-r--r--mesonbuild/mformat.py5
-rw-r--r--test cases/format/5 transform/default.expected.meson14
-rw-r--r--test cases/format/5 transform/muon.expected.meson14
-rw-r--r--test cases/format/5 transform/options.expected.meson14
-rw-r--r--test cases/format/5 transform/source.meson14
-rw-r--r--unittests/allplatformstests.py2
30 files changed, 226 insertions, 185 deletions
diff --git a/docs/markdown/Release-notes-for-1.8.0.md b/docs/markdown/Release-notes-for-1.8.0.md
new file mode 100644
index 0000000..4289e91
--- /dev/null
+++ b/docs/markdown/Release-notes-for-1.8.0.md
@@ -0,0 +1,134 @@
+---
+title: Release 1.8.0
+short-description: Release notes for 1.8.0
+...
+
+# New features
+
+Meson 1.8.0 was released on 28 April 2025
+## New argument `android_exe_type` for executables
+
+Android application executables actually need to be linked
+as a shared object, which is loaded from a pre-warmed JVM.
+Meson projects can now specify a new argument `android_exe_type`
+and set it to `application`, in order produce such a shared library
+only on Android targets.
+
+This makes it possible to use the same `meson.build` file
+for both Android and non-Android systems.
+
+## Changes to the b_sanitize option
+
+Before 1.8 the `b_sanitize` option was a combo option, which is an enumerated
+set of values. In 1.8 this was changed to a free-form array of options where
+available sanitizers are not hardcoded anymore but instead verified via a
+compiler check.
+
+This solves a number of longstanding issues such as:
+
+ - Sanitizers may be supported by a compiler, but not on a specific platform
+ (OpenBSD).
+ - New sanitizers are not recognized by Meson.
+ - Using sanitizers in previously-unsupported combinations.
+
+To not break backwards compatibility, calling `get_option('b_sanitize')`
+continues to return the configured value as a string, with a guarantee that
+`address,undefined` remains ordered.
+
+## New C standard `c2y` (and `gnu2y`)
+
+The `c2y` standard and its companion `gnu2y` are now supported
+when using either Clang 19.0.0 or newer, or GCC 15.0.0 or newer.
+
+## i18n module xgettext
+
+There is a new `xgettext` function in `i18n` module that acts as a
+wrapper around `xgettext`. It allows to extract strings to translate from
+source files.
+
+This function is convenient, because:
+- It can find the sources files from a build target;
+- It will use an intermediate file when the number of source files is too
+ big to be handled directly from the command line;
+- It is able to get strings to translate from the dependencies of the given
+ targets.
+
+## `version_compare` now accept multiple compare strings
+
+Is it now possible to compare version against multiple values, to check for
+a range of version for instance.
+
+```meson
+'1.5'.version_compare('>=1', '<2')
+```
+
+## Improvements to Objective-C and Objective-C++
+
+Meson does not assume anymore that gcc/g++ always support
+Objective-C and Objective-C++, and instead checks that they
+can actually do a basic compile.
+
+Furthermore, Objective-C and Objective-C++ now support the
+same language standards as C and C++ respectively.
+
+## Per project subproject options rewrite
+
+You can now define per-subproject values for all shared configuration
+options. As an example you might want to enable optimizations on only
+one subproject:
+
+ meson configure -Dnumbercruncher:optimization=3
+
+Subproject specific values can be removed with -U
+
+ meson configure -Unumbercruncher:optimization
+
+This is a major change in how options are handled, and the
+implementation will evolve over the next few releases of Meson. If
+this change causes an error in your builds, please [report an issue on
+GitHub](https://github.com/mesonbuild/meson/issues/new).
+
+We have tried to keep backwards compatibility as much as possible, but
+this may lead to some build breakage.
+
+## `objects` added correctly to Rust executables
+
+Any objects included in a Rust executable were previously ignored. They
+are now added correctly.
+
+## `rust.test` now supports `link_whole`
+
+The `test` function in the `rust` module now supports the `link_whole`
+keyword argument in addition to `link_with` and `dependencies`.
+
+## Meson can run "rustdoc" on Rust projects
+
+Meson now defines a `rustdoc` target if the project
+uses the Rust programming language. The target runs rustdoc on all Rust
+sources, using the `rustdoc` program from the same Rust toolchain as the
+`rustc` compiler.
+
+## The Wayland module is stable
+
+The Wayland module has been tested in several projects and had the
+last breaking change in Meson 0.64.0; it is now marked as stable.
+
+## New `swift_std` compiler option
+
+A new compiler option allows to set the language version that is passed
+to swiftc (`none`, `4`, `4.2`, `5` or `6`).
+
+## New option to execute a slice of tests
+
+When tests take a long time to run a common strategy is to slice up the tests
+into multiple sets, where each set is executed on a separate machine. You can
+now use the `--slice i/n` argument for `meson test` to create `n` slices and
+execute the `ith` slice.
+
+## Valgrind now fails tests if errors are found
+
+Valgrind does not reflect an error in its exit code by default, meaning
+a test may silently pass despite memory errors. Meson now exports
+`VALGRIND_OPTS` such that Valgrind will exit with status 1 to indicate
+an error if `VALGRIND_OPTS` is not set in the environment.
+
diff --git a/docs/markdown/snippets/android-exe-type.md b/docs/markdown/snippets/android-exe-type.md
deleted file mode 100644
index ce4d946..0000000
--- a/docs/markdown/snippets/android-exe-type.md
+++ /dev/null
@@ -1,10 +0,0 @@
-## New argument `android_exe_type` for executables
-
-Android application executables actually need to be linked
-as a shared object, which is loaded from a pre-warmed JVM.
-Meson projects can now specify a new argument `android_exe_type`
-and set it to `application`, in order produce such a shared library
-only on Android targets.
-
-This makes it possible to use the same `meson.build` file
-for both Android and non-Android systems.
diff --git a/docs/markdown/snippets/b_sanitizer_changes.md b/docs/markdown/snippets/b_sanitizer_changes.md
deleted file mode 100644
index f726d70..0000000
--- a/docs/markdown/snippets/b_sanitizer_changes.md
+++ /dev/null
@@ -1,17 +0,0 @@
-## Changes to the b_sanitize option
-
-Before 1.8 the `b_sanitize` option was a combo option, which is an enumerated
-set of values. In 1.8 this was changed to a free-form array of options where
-available sanitizers are not hardcoded anymore but instead verified via a
-compiler check.
-
-This solves a number of longstanding issues such as:
-
- - Sanitizers may be supported by a compiler, but not on a specific platform
- (OpenBSD).
- - New sanitizers are not recognized by Meson.
- - Using sanitizers in previously-unsupported combinations.
-
-To not break backwards compatibility, calling `get_option('b_sanitize')`
-continues to return the configured value as a string, with a guarantee that
-`address,undefined` remains ordered.
diff --git a/docs/markdown/snippets/c2y.md b/docs/markdown/snippets/c2y.md
deleted file mode 100644
index 4b647f8..0000000
--- a/docs/markdown/snippets/c2y.md
+++ /dev/null
@@ -1,4 +0,0 @@
-## New C standard `c2y` (and `gnu2y`)
-
-The `c2y`` standard and its companion `gnu2y` are now supported
-when using either Clang 19.0.0 or newer, or GCC 15.0.0 or newer.
diff --git a/docs/markdown/snippets/i18n_xgettext.md b/docs/markdown/snippets/i18n_xgettext.md
deleted file mode 100644
index 0ad0a14..0000000
--- a/docs/markdown/snippets/i18n_xgettext.md
+++ /dev/null
@@ -1,12 +0,0 @@
-## i18n module xgettext
-
-There is a new `xgettext` function in `i18n` module that acts as a
-wrapper around `xgettext`. It allows to extract strings to translate from
-source files.
-
-This function is convenient, because:
-- It can find the sources files from a build target;
-- It will use an intermediate file when the number of source files is too
- big to be handled directly from the command line;
-- It is able to get strings to translate from the dependencies of the given
- targets.
diff --git a/docs/markdown/snippets/multiple_version_compare.md b/docs/markdown/snippets/multiple_version_compare.md
deleted file mode 100644
index 5e8c758..0000000
--- a/docs/markdown/snippets/multiple_version_compare.md
+++ /dev/null
@@ -1,8 +0,0 @@
-## `version_compare` now accept multiple compare strings
-
-Is it now possible to compare version against multiple values, to check for
-a range of version for instance.
-
-```meson
-'1.5'.version_compare('>=1', '<2')
-```
diff --git a/docs/markdown/snippets/objc-cpp.md b/docs/markdown/snippets/objc-cpp.md
deleted file mode 100644
index 3d22ccb..0000000
--- a/docs/markdown/snippets/objc-cpp.md
+++ /dev/null
@@ -1,8 +0,0 @@
-## Improvements to Objective-C and Objective-C++
-
-Meson does not assume anymore that gcc/g++ always support
-Objective-C and Objective-C++, and instead checks that they
-can actually do a basic compile.
-
-Furthermore, Objective-C and Objective-C++ now support the
-same language standards as C and C++ respectively.
diff --git a/docs/markdown/snippets/optionrefactor.md b/docs/markdown/snippets/optionrefactor.md
deleted file mode 100644
index 53dbdbc..0000000
--- a/docs/markdown/snippets/optionrefactor.md
+++ /dev/null
@@ -1,19 +0,0 @@
-## Per project subproject options rewrite
-
-You can now define per-subproject values for all shared configuration
-options. As an example you might want to enable optimizations on only
-one subproject:
-
- meson configure -Dnumbercruncher:optimization=3
-
-Subproject specific values can be removed with -U
-
- meson configure -Unumbercruncher:optimization
-
-This is a major change in how options are handled, and the
-implementation will evolve over the next few releases of Meson. If
-this change causes an error in your builds, please [report an issue on
-GitHub](https://github.com/mesonbuild/meson/issues/new).
-
-We have tried to keep backwards compatibility as much as possible, but
-this may lead to some build breakage.
diff --git a/docs/markdown/snippets/rust-objects.md b/docs/markdown/snippets/rust-objects.md
deleted file mode 100644
index 575e1f6..0000000
--- a/docs/markdown/snippets/rust-objects.md
+++ /dev/null
@@ -1,4 +0,0 @@
-## `objects` added correctly to Rust executables
-
-Any objects included in a Rust executable were previously ignored. They
-are now added correctly.
diff --git a/docs/markdown/snippets/rust-test-link-whole.md b/docs/markdown/snippets/rust-test-link-whole.md
deleted file mode 100644
index f3d006d..0000000
--- a/docs/markdown/snippets/rust-test-link-whole.md
+++ /dev/null
@@ -1,4 +0,0 @@
-## `rust.test` now supports `link_whole`
-
-The `test` function in the `rust` module now supports the `link_whole`
-keyword argument in addition to `link_with` and `dependencies`.
diff --git a/docs/markdown/snippets/rustdoc.md b/docs/markdown/snippets/rustdoc.md
deleted file mode 100644
index b0b64aa..0000000
--- a/docs/markdown/snippets/rustdoc.md
+++ /dev/null
@@ -1,6 +0,0 @@
-## Meson can run "rustdoc" on Rust projects
-
-Meson now defines a `rustdoc` target if the project
-uses the Rust programming language. The target runs rustdoc on all Rust
-sources, using the `rustdoc` program from the same Rust toolchain as the
-`rustc` compiler.
diff --git a/docs/markdown/snippets/stabilized-wayland.md b/docs/markdown/snippets/stabilized-wayland.md
deleted file mode 100644
index 3b132e6..0000000
--- a/docs/markdown/snippets/stabilized-wayland.md
+++ /dev/null
@@ -1,4 +0,0 @@
-## The Wayland module is stable
-
-The Wayland module has been tested in several projects and had the
-last breaking change in Meson 0.64.0; it is now marked as stable.
diff --git a/docs/markdown/snippets/swift-std.md b/docs/markdown/snippets/swift-std.md
deleted file mode 100644
index 64fe70c..0000000
--- a/docs/markdown/snippets/swift-std.md
+++ /dev/null
@@ -1,4 +0,0 @@
-## New `swift_std` compiler option
-
-A new compiler option allows to set the language version that is passed
-to swiftc (`none`, `4`, `4.2`, `5` or `6`).
diff --git a/docs/markdown/snippets/test-slicing.md b/docs/markdown/snippets/test-slicing.md
deleted file mode 100644
index 180b9ac..0000000
--- a/docs/markdown/snippets/test-slicing.md
+++ /dev/null
@@ -1,6 +0,0 @@
-## New option to execute a slice of tests
-
-When tests take a long time to run a common strategy is to slice up the tests
-into multiple sets, where each set is executed on a separate machine. You can
-now use the `--slice i/n` argument for `meson test` to create `n` slices and
-execute the `ith` slice.
diff --git a/docs/markdown/snippets/valgrind_test.md b/docs/markdown/snippets/valgrind_test.md
deleted file mode 100644
index 0787300..0000000
--- a/docs/markdown/snippets/valgrind_test.md
+++ /dev/null
@@ -1,6 +0,0 @@
-## Valgrind now fails tests if errors are found
-
-Valgrind does not reflect an error in its exit code by default, meaning
-a test may silently pass despite memory errors. Meson now exports
-`VALGRIND_OPTS` such that Valgrind will exit with status 1 to indicate
-an error if `VALGRIND_OPTS` is not set in the environment.
diff --git a/docs/sitemap.txt b/docs/sitemap.txt
index 21f495e..fd37185 100644
--- a/docs/sitemap.txt
+++ b/docs/sitemap.txt
@@ -88,6 +88,7 @@ index.md
Wrap-best-practices-and-tips.md
Shipping-prebuilt-binaries-as-wraps.md
Release-notes.md
+ Release-notes-for-1.8.0.md
Release-notes-for-1.7.0.md
Release-notes-for-1.6.0.md
Release-notes-for-1.5.0.md
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py
index 3c1d58b..ad252a1 100644
--- a/mesonbuild/compilers/compilers.py
+++ b/mesonbuild/compilers/compilers.py
@@ -1200,6 +1200,23 @@ class Compiler(HoldableObject, metaclass=abc.ABCMeta):
is good enough here.
"""
+ def run_sanity_check(self, environment: Environment, cmdlist: T.List[str], work_dir: str, use_exe_wrapper_for_cross: bool = True) -> T.Tuple[str, str]:
+ # Run sanity check
+ if self.is_cross and use_exe_wrapper_for_cross:
+ if not environment.has_exe_wrapper():
+ # Can't check if the binaries run so we have to assume they do
+ return ('', '')
+ cmdlist = environment.exe_wrapper.get_command() + cmdlist
+ mlog.debug('Running test binary command: ', mesonlib.join_args(cmdlist))
+ try:
+ pe, stdo, stde = Popen_safe_logged(cmdlist, 'Sanity check', cwd=work_dir)
+ except Exception as e:
+ raise mesonlib.EnvironmentException(f'Could not invoke sanity check executable: {e!s}.')
+
+ if pe.returncode != 0:
+ raise mesonlib.EnvironmentException(f'Executables created by {self.language} compiler {self.name_string()} are not runnable.')
+ return stdo, stde
+
def split_shlib_to_parts(self, fname: str) -> T.Tuple[T.Optional[str], str]:
return None, fname
diff --git a/mesonbuild/compilers/cs.py b/mesonbuild/compilers/cs.py
index 38bb338..4bbddeb 100644
--- a/mesonbuild/compilers/cs.py
+++ b/mesonbuild/compilers/cs.py
@@ -102,10 +102,7 @@ class CsCompiler(BasicLinkerIsCompilerMixin, Compiler):
cmdlist = [self.runner, obj]
else:
cmdlist = [os.path.join(work_dir, obj)]
- pe = subprocess.Popen(cmdlist, cwd=work_dir)
- pe.wait()
- if pe.returncode != 0:
- raise EnvironmentException('Executables created by Mono compiler %s are not runnable.' % self.name_string())
+ self.run_sanity_check(environment, cmdlist, work_dir, use_exe_wrapper_for_cross=False)
def needs_static_linker(self) -> bool:
return False
diff --git a/mesonbuild/compilers/cuda.py b/mesonbuild/compilers/cuda.py
index 6cc6f96..ab00cf1 100644
--- a/mesonbuild/compilers/cuda.py
+++ b/mesonbuild/compilers/cuda.py
@@ -577,21 +577,12 @@ class CudaCompiler(Compiler):
# Run sanity check (if possible)
if self.is_cross:
- if not env.has_exe_wrapper():
- return
- else:
- cmdlist = env.exe_wrapper.get_command() + [binary_name]
- else:
- cmdlist = self.exelist + ['--run', '"' + binary_name + '"']
- mlog.debug('Sanity check run command line: ', ' '.join(cmdlist))
- pe, stdo, stde = Popen_safe(cmdlist, cwd=work_dir)
- mlog.debug('Sanity check run stdout: ')
- mlog.debug(stdo)
- mlog.debug('-----\nSanity check run stderr:')
- mlog.debug(stde)
- mlog.debug('-----')
- pe.wait()
- if pe.returncode != 0:
+ return
+
+ cmdlist = self.exelist + ['--run', f'"{binary_name}"']
+ try:
+ stdo, stde = self.run_sanity_check(env, cmdlist, work_dir)
+ except EnvironmentException:
raise EnvironmentException(f'Executables created by {self.language} compiler {self.name_string()} are not runnable.')
# Interpret the result of the sanity test.
@@ -599,8 +590,6 @@ class CudaCompiler(Compiler):
# architecture detection test.
if stde == '':
self.detected_cc = stdo
- else:
- mlog.debug('cudaGetDeviceCount() returned ' + stde)
def has_header_symbol(self, hname: str, symbol: str, prefix: str,
env: 'Environment', *,
diff --git a/mesonbuild/compilers/d.py b/mesonbuild/compilers/d.py
index 8ee6ebf..51f2436 100644
--- a/mesonbuild/compilers/d.py
+++ b/mesonbuild/compilers/d.py
@@ -456,15 +456,7 @@ class DCompiler(Compiler):
if pc.returncode != 0:
raise EnvironmentException('D compiler %s cannot compile programs.' % self.name_string())
- if self.is_cross:
- if not environment.has_exe_wrapper():
- # Can't check if the binaries run so we have to assume they do
- return
- cmdlist = environment.exe_wrapper.get_command() + [output_name]
- else:
- cmdlist = [output_name]
- if subprocess.call(cmdlist) != 0:
- raise EnvironmentException('Executables created by D compiler %s are not runnable.' % self.name_string())
+ stdo, stde = self.run_sanity_check(environment, [output_name], work_dir)
def needs_static_linker(self) -> bool:
return True
diff --git a/mesonbuild/compilers/java.py b/mesonbuild/compilers/java.py
index 540e2aa..47d2ac9 100644
--- a/mesonbuild/compilers/java.py
+++ b/mesonbuild/compilers/java.py
@@ -91,10 +91,7 @@ class JavaCompiler(BasicLinkerIsCompilerMixin, Compiler):
runner = shutil.which(self.javarunner)
if runner:
cmdlist = [runner, '-cp', '.', obj]
- pe = subprocess.Popen(cmdlist, cwd=work_dir)
- pe.wait()
- if pe.returncode != 0:
- raise EnvironmentException(f'Executables created by Java compiler {self.name_string()} are not runnable.')
+ self.run_sanity_check(environment, cmdlist, work_dir, use_exe_wrapper_for_cross=False)
else:
m = "Java Virtual Machine wasn't found, but it's needed by Meson. " \
"Please install a JRE.\nIf you have specific needs where this " \
diff --git a/mesonbuild/compilers/mixins/clike.py b/mesonbuild/compilers/mixins/clike.py
index b163407..e45c485 100644
--- a/mesonbuild/compilers/mixins/clike.py
+++ b/mesonbuild/compilers/mixins/clike.py
@@ -307,22 +307,7 @@ class CLikeCompiler(Compiler):
mlog.debug('-----')
if pc.returncode != 0:
raise mesonlib.EnvironmentException(f'Compiler {self.name_string()} cannot compile programs.')
- # Run sanity check
- if self.is_cross:
- if not environment.has_exe_wrapper():
- # Can't check if the binaries run so we have to assume they do
- return
- cmdlist = environment.exe_wrapper.get_command() + [binary_name]
- else:
- cmdlist = [binary_name]
- mlog.debug('Running test binary command: ', mesonlib.join_args(cmdlist))
- try:
- # fortran code writes to stdout
- pe = subprocess.run(cmdlist, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
- except Exception as e:
- raise mesonlib.EnvironmentException(f'Could not invoke sanity test executable: {e!s}.')
- if pe.returncode != 0:
- raise mesonlib.EnvironmentException(f'Executables created by {self.language} compiler {self.name_string()} are not runnable.')
+ self.run_sanity_check(environment, [binary_name], work_dir)
def sanity_check(self, work_dir: str, environment: 'Environment') -> None:
code = 'int main(void) { int class=0; return class; }\n'
diff --git a/mesonbuild/compilers/rust.py b/mesonbuild/compilers/rust.py
index d0d2e69..cc9dc21 100644
--- a/mesonbuild/compilers/rust.py
+++ b/mesonbuild/compilers/rust.py
@@ -5,7 +5,7 @@
from __future__ import annotations
import functools
-import subprocess, os.path
+import os.path
import textwrap
import re
import typing as T
@@ -141,17 +141,7 @@ class RustCompiler(Compiler):
if pc.returncode != 0:
raise EnvironmentException(f'Rust compiler {self.name_string()} cannot compile programs.')
self._native_static_libs(work_dir, source_name)
- if self.is_cross:
- if not environment.has_exe_wrapper():
- # Can't check if the binaries run so we have to assume they do
- return
- cmdlist = environment.exe_wrapper.get_command() + [output_name]
- else:
- cmdlist = [output_name]
- pe = subprocess.Popen(cmdlist, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
- pe.wait()
- if pe.returncode != 0:
- raise EnvironmentException(f'Executables created by Rust compiler {self.name_string()} are not runnable.')
+ self.run_sanity_check(environment, [output_name], work_dir)
def _native_static_libs(self, work_dir: str, source_name: str) -> None:
# Get libraries needed to link with a Rust staticlib
diff --git a/mesonbuild/compilers/swift.py b/mesonbuild/compilers/swift.py
index 8410fbb..528d76f 100644
--- a/mesonbuild/compilers/swift.py
+++ b/mesonbuild/compilers/swift.py
@@ -8,7 +8,7 @@ import subprocess, os.path
import typing as T
from .. import mlog, options
-from ..mesonlib import EnvironmentException, MesonException, version_compare
+from ..mesonlib import MesonException, version_compare
from .compilers import Compiler, clike_debug_args
@@ -170,13 +170,7 @@ class SwiftCompiler(Compiler):
''')
pc = subprocess.Popen(self.exelist + extra_flags + ['-emit-executable', '-o', output_name, src], cwd=work_dir)
pc.wait()
- if pc.returncode != 0:
- raise EnvironmentException('Swift compiler %s cannot compile programs.' % self.name_string())
- if self.is_cross:
- # Can't check if the binaries run so we have to assume they do
- return
- if subprocess.call(output_name) != 0:
- raise EnvironmentException('Executables created by Swift compiler %s are not runnable.' % self.name_string())
+ self.run_sanity_check(environment, [output_name], work_dir)
def get_debug_args(self, is_debug: bool) -> T.List[str]:
return clike_debug_args[is_debug]
diff --git a/mesonbuild/mformat.py b/mesonbuild/mformat.py
index 92729a0..1e134f5 100644
--- a/mesonbuild/mformat.py
+++ b/mesonbuild/mformat.py
@@ -536,7 +536,7 @@ class TrimWhitespaces(FullAstVisitor):
def visit_ParenthesizedNode(self, node: mparser.ParenthesizedNode) -> None:
self.enter_node(node)
- is_multiline = node.lpar.whitespaces and '#' in node.lpar.whitespaces.value
+ is_multiline = node.lpar.lineno != node.rpar.lineno
if is_multiline:
self.indent_comments += self.config.indent_by
@@ -546,7 +546,8 @@ class TrimWhitespaces(FullAstVisitor):
if is_multiline:
node.inner.whitespaces.value = self.dedent(node.inner.whitespaces.value)
self.indent_comments = self.dedent(self.indent_comments)
- self.add_nl_after(node.inner)
+ if node.lpar.whitespaces and '\n' in node.lpar.whitespaces.value:
+ self.add_nl_after(node.inner)
node.rpar.accept(self)
self.move_whitespaces(node.rpar, node)
diff --git a/test cases/format/5 transform/default.expected.meson b/test cases/format/5 transform/default.expected.meson
index 18af2f8..4a9851a 100644
--- a/test cases/format/5 transform/default.expected.meson
+++ b/test cases/format/5 transform/default.expected.meson
@@ -36,6 +36,20 @@ a2 = [
# space array
a3 = [1, 2, 3]
+# multi line expression
+is_foo = (
+ true
+ and false
+ and true
+ and false
+ and true
+ and false
+ and true
+ and false
+ and true
+ and false
+)
+
# no single comma function
fct = files(
'meson.build', # force multiline
diff --git a/test cases/format/5 transform/muon.expected.meson b/test cases/format/5 transform/muon.expected.meson
index 0e6309c..3b61270 100644
--- a/test cases/format/5 transform/muon.expected.meson
+++ b/test cases/format/5 transform/muon.expected.meson
@@ -36,6 +36,20 @@ a2 = [
# space array
a3 = [1, 2, 3]
+# multi line expression
+is_foo = (
+ true
+ and false
+ and true
+ and false
+ and true
+ and false
+ and true
+ and false
+ and true
+ and false
+)
+
# no single comma function
fct = files(
'meson.build', # force multiline
diff --git a/test cases/format/5 transform/options.expected.meson b/test cases/format/5 transform/options.expected.meson
index 9ed6ac2..84917c1 100644
--- a/test cases/format/5 transform/options.expected.meson
+++ b/test cases/format/5 transform/options.expected.meson
@@ -14,6 +14,20 @@ a2 = [ 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 2
# space array
a3 = [ 1, 2, 3 ]
+# multi line expression
+is_foo = (
+ true
+ and false
+ and true
+ and false
+ and true
+ and false
+ and true
+ and false
+ and true
+ and false
+)
+
# no single comma function
fct = files(
'meson.build' # force multiline
diff --git a/test cases/format/5 transform/source.meson b/test cases/format/5 transform/source.meson
index 4482884..a3b326b 100644
--- a/test cases/format/5 transform/source.meson
+++ b/test cases/format/5 transform/source.meson
@@ -18,6 +18,20 @@ a2 = [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22
# space array
a3 = [ 1, 2, 3 ]
+# multi line expression
+is_foo = (
+ true
+ and false
+ and true
+ and false
+ and true
+ and false
+ and true
+ and false
+ and true
+ and false
+)
+
# no single comma function
fct = files(
'meson.build', # force multiline
diff --git a/unittests/allplatformstests.py b/unittests/allplatformstests.py
index 2fee06c..ea220a0 100644
--- a/unittests/allplatformstests.py
+++ b/unittests/allplatformstests.py
@@ -5196,7 +5196,7 @@ class AllPlatformTests(BasePlatformTests):
'10/10': [10],
}.items():
output = self._run(self.mtest_command + ['--slice=' + arg])
- tests = sorted([ int(x[5:]) for x in re.findall(r'test-[0-9]*', output) ])
+ tests = sorted([ int(x) for x in re.findall(r'\n[ 0-9]+/[0-9]+ test-([0-9]*)', output) ])
self.assertEqual(tests, expectation)
for arg, expectation in {'': 'error: argument --slice: value does not conform to format \'SLICE/NUM_SLICES\'',