| 1 |
--- |
| 2 |
title: Release 1.7.0 |
| 3 |
short-description: Release notes for 1.7.0 |
| 4 |
... |
| 5 |
|
| 6 |
# New features |
| 7 |
|
| 8 |
Meson 1.7.0 was released on 26 January 2025 |
| 9 |
|
| 10 |
## Call for testing for next release |
| 11 |
|
| 12 |
At the beginning of next cycle we aim to merge the [option refactor |
| 13 |
branch](https://github.com/mesonbuild/meson/pull/13441). This is a |
| 14 |
_huge_ change that will touch pretty much all code. |
| 15 |
|
| 16 |
The main change it brings is that you can override any builtin option |
| 17 |
value for any subproject (even the top one) entirely from the command |
| 18 |
line. This means that you can, for example, enable optimizations on |
| 19 |
all subprojects but not on the top level project. |
| 20 |
|
| 21 |
We have done extensive testing and all our tests currently |
| 22 |
pass. However it is expected that this will break some workflows. So |
| 23 |
please test the branch when it lands and report issues. We want to fix |
| 24 |
all regressions as soon as possible, preferably far before the next rc |
| 25 |
release. |
| 26 |
|
| 27 |
## New custom dependency for atomic |
| 28 |
|
| 29 |
``` |
| 30 |
dependency('atomic') |
| 31 |
``` |
| 32 |
|
| 33 |
checks for the availability of the atomic operation library. First, it looks |
| 34 |
for the atomic library. If that is not found, then it will try to use what is |
| 35 |
provided by the libc. |
| 36 |
|
| 37 |
## `--cap-lints allow` used for Cargo subprojects |
| 38 |
|
| 39 |
Similar to Cargo itself, all downloaded Cargo subprojects automatically |
| 40 |
add the `--cap-lints allow` compiler argument, thus hiding any warnings |
| 41 |
from the compiler. |
| 42 |
|
| 43 |
Related to this, `warning_level=0` now translates into `--cap-lints allow` |
| 44 |
for Rust targets instead of `-A warnings`. |
| 45 |
|
| 46 |
## Cargo features are resolved globally |
| 47 |
|
| 48 |
When configuring a Cargo dependency, Meson will now resolve its complete |
| 49 |
dependency tree and feature set before generating the subproject AST. |
| 50 |
This solves many cases of Cargo subprojects being configured with missing |
| 51 |
features that the main project had to enable by hand using e.g. |
| 52 |
`default_options: ['foo-rs:feature-default=true']`. |
| 53 |
|
| 54 |
Note that there could still be issues in the case there are multiple Cargo |
| 55 |
entry points. That happens if the main Meson project makes multiple `dependency()` |
| 56 |
calls for different Cargo crates that have common dependencies. |
| 57 |
|
| 58 |
Breaks: This change removes per feature Meson options that were previously |
| 59 |
possible to set as shown above or from command line `-Dfoo-rs:feature-foo=true`. |
| 60 |
|
| 61 |
## Meson can run "clippy" on Rust projects |
| 62 |
|
| 63 |
Meson now defines a `clippy` target if the project uses the Rust programming |
| 64 |
language. The target runs clippy on all Rust sources, using the `clippy-driver` |
| 65 |
program from the same Rust toolchain as the `rustc` compiler. |
| 66 |
|
| 67 |
Using `clippy-driver` as the Rust compiler will now emit a warning, as it |
| 68 |
is not meant to be a general-purpose compiler front-end. |
| 69 |
|
| 70 |
## Devenv support in external project module |
| 71 |
|
| 72 |
The [external project module](External-Project-module.md) now setups `PATH` and |
| 73 |
`LD_LIBRARY_PATH` to be able to run programs. |
| 74 |
|
| 75 |
`@BINDIR@` is now substitued in arguments and `'--bindir=@PREFIX@/@BINDIR@'` |
| 76 |
default argument have been added. |
| 77 |
|
| 78 |
## Fixed `sizeof` and `find_library` methods for Fortran compilers |
| 79 |
|
| 80 |
The implementation of the `.sizeof()` method has been fixed for Fortran |
| 81 |
compilers (it was previously broken since it would try to compile a C code |
| 82 |
snippet). Note that this functionality requires Fortran 2008 support. |
| 83 |
|
| 84 |
Incidentally this also fixes the `.find_library()` method for Fortran compilers |
| 85 |
when the `prefer_static` built-in option is set to true. |
| 86 |
|
| 87 |
## format command now accept stdin argument |
| 88 |
|
| 89 |
You can now use `-` argument for `meson format` to read input from stdin |
| 90 |
instead of reading it from a file. |
| 91 |
|
| 92 |
## "machine" entry in target introspection data |
| 93 |
|
| 94 |
The JSON data returned by `meson introspect --targets` now has a `machine` |
| 95 |
entry in each `target_sources` block. The new entry can be one of `build` |
| 96 |
or `host` for compiler-built targets, or absent for `custom_target` targets. |
| 97 |
|
| 98 |
## Add new language Linear Asm |
| 99 |
|
| 100 |
TI C6000 compiler supports a dialect of TI asm, so we add a new language for it. |
| 101 |
|
| 102 |
## Control the number of child processes with an environment variable |
| 103 |
|
| 104 |
Previously, `meson test` checked the `MESON_TESTTHREADS` variable to control |
| 105 |
the amount of parallel jobs to run; this was useful when `meson test` is |
| 106 |
invoked through `ninja test` for example. With this version, a new variable |
| 107 |
`MESON_NUM_PROCESSES` is supported with a broader scope: in addition to |
| 108 |
`meson test`, it is also used by the `external_project` module and by |
| 109 |
Ninja targets that invoke `clang-tidy`, `clang-format` and `clippy`. |
| 110 |
|
| 111 |
## Support for Rust 2024 |
| 112 |
|
| 113 |
Meson can now request the compiler to use the 2024 edition of Rust. Use |
| 114 |
`rust_std=2024` to activate it. Rust 2024 requires the 1.85.0 version |
| 115 |
(or newer) of the compiler. |
| 116 |
|
| 117 |
## Support TASKING VX-Toolset |
| 118 |
|
| 119 |
Meson now supports the TASKING VX-Toolset compiler family for the Tricore cpu family. |
| 120 |
|
| 121 |
## Test targets no longer built by default |
| 122 |
|
| 123 |
`meson test` and the `ninja all` rule have been reworked to no longer force |
| 124 |
unnecessary rebuilds. |
| 125 |
|
| 126 |
`meson test` was invoking `ninja all` due to a bug if the chosen set of tests |
| 127 |
had no build dependencies. The behavior is now the same as when tests do have |
| 128 |
build dependencies, i.e. to only build the actual set of targets that are used |
| 129 |
by the test. This change could cause failures when upgrading to Meson 1.7.0, if |
| 130 |
the dependencies are not specified correctly in meson.build. Using `ninja test` |
| 131 |
has always been guaranteed to "do the right thing" and rebuild `all` as well; |
| 132 |
this continues to work. |
| 133 |
|
| 134 |
`ninja all` does not rebuild all tests anymore; it should be noted that this |
| 135 |
change means test programs are no longer guaranteed to have been built, |
| 136 |
depending on whether those test programs were *also* defined to build by |
| 137 |
default / marked as installable. This avoids building test-only binaries as |
| 138 |
part of installing the project (`ninja && ninja install`), which is unnecessary |
| 139 |
and has no use case. |
| 140 |
|
| 141 |
Some users might have been relying on the "all" target building test |
| 142 |
dependencies in combination with `meson test --no-rebuild` in order to skip |
| 143 |
calling out to ninja when running tests. This might break with this change |
| 144 |
because, when given `--no-rebuild`, Meson provides no guarantee that test |
| 145 |
dependencies are present and up to date. The recommended workflow is to use |
| 146 |
either `ninja test` or `ninja && meson test` but, if you wish to build test |
| 147 |
programs and dependencies in a separate stage, you can use for example `ninja |
| 148 |
all meson-test-prereq meson-benchmark-prereq` before `meson test --no-rebuild`. |
| 149 |
These prereq targets have been available since meson 0.63.0. |
| 150 |
|
| 151 |
## Install vcs_tag() output |
| 152 |
|
| 153 |
[[vcs_tag]] now has `install`, `install_dir`, `install_tag` and `install_mode` |
| 154 |
keyword arguments to install the generated file. |
| 155 |
|