| 1 |
--- |
| 2 |
title: Release 0.64.0 |
| 3 |
short-description: Release notes for 0.64.0 |
| 4 |
... |
| 5 |
|
| 6 |
# New features |
| 7 |
|
| 8 |
## Add `optimization` `plain` option |
| 9 |
|
| 10 |
The `optimization` built-in option now accepts `plain` value, |
| 11 |
which will not set any optimization flags. This is now the default |
| 12 |
value of the flag for `buildtype=plain`, which is useful for distros, |
| 13 |
that set the optimization and hardening flags by other means. |
| 14 |
|
| 15 |
If you are using the value of `get_option('optimization')` in your |
| 16 |
Meson scripts, make sure you are not making assumptions about it, |
| 17 |
such as that the value can be passed to a compiler in `-O` flag. |
| 18 |
|
| 19 |
## New languages: `nasm` and `masm` |
| 20 |
|
| 21 |
When the `nasm` language is added to the project, `.asm` files are |
| 22 |
automatically compiled with NASM. This is only supported for x86 and x86_64 CPU |
| 23 |
family. `yasm` is used as fallback if `nasm` command is not found. |
| 24 |
|
| 25 |
When the `masm` language is added to the project, `.masm` files are |
| 26 |
automatically compiled with Microsoft's Macro Assembler. This is only supported |
| 27 |
for x86, x86_64, ARM and AARCH64 CPU families. |
| 28 |
|
| 29 |
Note that GNU Assembly files usually have `.s` or `.S` extension and were already |
| 30 |
built using C compiler such as GCC or CLANG. |
| 31 |
|
| 32 |
```meson |
| 33 |
project('test', 'nasm') |
| 34 |
|
| 35 |
exe = executable('hello', 'hello.asm') |
| 36 |
test('hello', exe) |
| 37 |
``` |
| 38 |
|
| 39 |
## Pager and colors for `meson configure` output |
| 40 |
|
| 41 |
The output of `meson configure`, printing all options, is now more readable by |
| 42 |
automatically using a pager (`less` by default) and colors. The pager used can |
| 43 |
be controlled by setting `PAGER` environment variable, or `--no-pager` command |
| 44 |
line option. |
| 45 |
|
| 46 |
## various `install_*` functions no longer handle the sticky bit |
| 47 |
|
| 48 |
It is not possible to portably grant the sticky bit to a file, and where |
| 49 |
possible, it doesn't do anything. It is not expected that any users are using |
| 50 |
this functionality. |
| 51 |
|
| 52 |
Variously: |
| 53 |
- on Linux, it has no meaningful effect |
| 54 |
- on Solaris, attempting to set the permission bit is silently ignored by the OS |
| 55 |
- on FreeBSD, attempting to set the permission bit is an error |
| 56 |
|
| 57 |
Attempting to set this permission bit in the `install_mode:` kwarg to any |
| 58 |
function other than [[install_emptydir]] will now result in a warning, and the |
| 59 |
permission bit being ignored. |
| 60 |
|
| 61 |
## `fs.copyfile` to replace `configure_file(copy : true)` |
| 62 |
|
| 63 |
A new method has been added to the `fs` module, `copyfile`. This method replaces |
| 64 |
`configure_file(copy : true)`, but only copies files. Unlike `configure_file()` |
| 65 |
it runs at build time, and the output name is optional defaulting to the |
| 66 |
filename without paths of the input if unset: |
| 67 |
|
| 68 |
```meson |
| 69 |
fs.copyfile('src/file.txt') |
| 70 |
``` |
| 71 |
Will create a file in the current build directory called `file.txt` |
| 72 |
|
| 73 |
|
| 74 |
```meson |
| 75 |
fs.copyfile('file.txt', 'outfile.txt') |
| 76 |
``` |
| 77 |
Will create a copy renamed to `outfile.txt` |
| 78 |
|
| 79 |
## Added `update_mime_database` to `gnome.post_install()` |
| 80 |
|
| 81 |
Applications that install a `.xml` file containing a `mime-type` need to update |
| 82 |
the cache upon installation. Most applications do that using a custom script, |
| 83 |
but it can now be done by Meson directly. |
| 84 |
|
| 85 |
## Added preserve_path arg to install_data |
| 86 |
|
| 87 |
The [[install_data]] function now has an optional argument `preserve_path` |
| 88 |
that allows installing multi-directory data file structures that live |
| 89 |
alongside source code with a single command. |
| 90 |
|
| 91 |
This is also available in the specialized `py_installation.install_sources` |
| 92 |
method. |
| 93 |
|
| 94 |
## BSD support for the `jni` dependency |
| 95 |
|
| 96 |
This system dependency now supports all BSD systems that Meson currently |
| 97 |
supports, including FreeBSD, NetBSD, OpenBSD, and DragonflyBSD. |
| 98 |
|
| 99 |
## Credentials from `~/.netrc` for `https` URLs |
| 100 |
|
| 101 |
When a subproject is downloaded using an `https://` URL, credentials from |
| 102 |
`~/.netrc` are now used. This avoids hardcoding login and password in plain |
| 103 |
text in the URL itself. |
| 104 |
|
| 105 |
## Basic support for oneAPI compilers on Linux and Windows |
| 106 |
|
| 107 |
To use on Linux: |
| 108 |
|
| 109 |
``` |
| 110 |
source /opt/intel/oneapi/setvars.sh |
| 111 |
CC=icx CXX=icpx FC=ifx meson setup builddir |
| 112 |
``` |
| 113 |
|
| 114 |
## New method to preprocess source files |
| 115 |
|
| 116 |
Compiler object has a new `preprocess()` method. It is supported by all C/C++ |
| 117 |
compilers. It preprocess sources without compiling them. |
| 118 |
|
| 119 |
The preprocessor will receive the same arguments (include directories, defines, |
| 120 |
etc) as with normal compilation. That includes for example args added with |
| 121 |
`add_project_arguments()`, or on the command line with `-Dc_args=-DFOO`. |
| 122 |
|
| 123 |
```meson |
| 124 |
cc = meson.get_compiler('c') |
| 125 |
pp_files = cc.preprocess('foo.c', 'bar.c', output: '@PLAINNAME@') |
| 126 |
exe = executable('app', pp_files) |
| 127 |
``` |
| 128 |
|
| 129 |
## python.find_installation() now accepts pure argument |
| 130 |
|
| 131 |
The default value of `pure:` for `py.install_sources()` and |
| 132 |
`py.get_install_dir()` can now be changed by explicitly passing a `pure:` kwarg |
| 133 |
to `find_installation()`. |
| 134 |
|
| 135 |
This can be used to ensure that multiple `install_sources()` invocations do not |
| 136 |
forget to specify the kwarg each time. |
| 137 |
|
| 138 |
## Generates rust-project.json when there are Rust targets |
| 139 |
|
| 140 |
This is a format similar to compile_commands.json, but specifically used by the |
| 141 |
official rust LSP, rust-analyzer. It is generated automatically if there are |
| 142 |
Rust targets, and is placed in the build directory. |
| 143 |
|
| 144 |
## `summary()` accepts disablers |
| 145 |
|
| 146 |
Disabler options can be passed to `summary()` as the value to be printed. |
| 147 |
|
| 148 |
## Option to allow meson test to fail fast after the first failing testcase |
| 149 |
|
| 150 |
`meson test --maxfail=1` will now cause all pending or in-progress tests to be |
| 151 |
canceled or interrupted after 1 test is marked as failing. This can be used for |
| 152 |
example to quit a CI run and avoid burning additional time as soon as it is |
| 153 |
known that the overall return status will be failing. |
| 154 |
|
| 155 |
## Incremental ThinLTO with `b_thinlto_cache` |
| 156 |
|
| 157 |
[Incremental ThinLTO](https://clang.llvm.org/docs/ThinLTO.html#incremental) can now be enabled by passing |
| 158 |
`-Db_thinlto_cache=true` during setup. The use of caching speeds up incremental builds significantly while retaining all |
| 159 |
the runtime performance benefits of ThinLTO. |
| 160 |
|
| 161 |
The cache location defaults to a Meson-managed directory inside the build folder, but can be customized with |
| 162 |
`b_thinlto_cache_dir`. |
| 163 |
|
| 164 |
## Update all wraps from WrapDB with `meson wrap update` command |
| 165 |
|
| 166 |
The command `meson wrap update`, with no extra argument, will now update all wraps |
| 167 |
that comes from WrapDB to the latest version. The extra `--force` argument will |
| 168 |
also replace wraps that do not come from WrapDB if one is available. |
| 169 |
|
| 170 |
The command `meson subprojects update` will not download new wrap files from |
| 171 |
WrapDB any more. |
| 172 |
|
| 173 |
## Added `include_core_only` arg to wayland.scan_xml. |
| 174 |
|
| 175 |
The `scan_xml` function from the wayland module now has an optional bool |
| 176 |
argument `include_core_only`, so that headers generated by wayland-scanner now |
| 177 |
only include `wayland-client-core.h` instead of `wayland-client.h`. |
| 178 |
|
| 179 |
## Automatic fallback using WrapDB |
| 180 |
|
| 181 |
A new command has been added: `meson wrap update-db`. It downloads the list of |
| 182 |
wraps available in [WrapDB](https://wrapdb.mesonbuild.com) and stores it locally in |
| 183 |
`subprojects/wrapdb.json`. When that file exists and a dependency is not found |
| 184 |
on the system but is available in WrapDB, Meson will automatically download it. |
| 185 |
|