Skip to content

Deprecated options broken in master by option refactoring #14433

Open
@thesamesam

Description

@thesamesam

Describe the bug

Options marked as deprecated in meson.options are now rejected, e.g.

meson.build:1:0: ERROR: Value "true" (of type "string") for option "systemtap" is not one of the choices. Possible choices are (as string): "enabled", "disabled", "auto".

This came up in the wild with systemd and glib.

To Reproduce

meson.build:

project(
  'foo',
  'c',
  meson_version : '>= 1.3.0',
  version : '0.1',
  default_options : ['warning_level=3'],
)

dependencies = [
]

exe = executable(
  'foo',
  'foo.c',
  dependencies : dependencies,
  install : true,
)

test('basic', exe)

foo.c:

#include <stdio.h>

#define PROJECT_NAME "foo"

int main(int argc, char **argv) {
    if(argc != 1) {
        printf("%s takes no arguments.\n", argv[0]);
        return 1;
    }
    printf("This is project %s.\n", PROJECT_NAME);
    return 0;
}
option('systemtap',
       type : 'feature',
       value : 'auto',
       deprecated : { 'true': 'enabled', 'false': 'disabled' },
       description : 'include tracing support for systemtap')
$ meson setup build -Dsystemtap=true
The Meson build system
Version: 1.7.99
Source dir: /tmp/foo
Build dir: /tmp/foo/build
Build type: native build

meson.build:1:0: ERROR: Value "true" (of type "string") for option "systemtap" is not one of the choices. Possible choices are (as string): "enabled", "disabled", "auto".

A full log can be found at /tmp/foo/build/meson-logs/meson-log.txt

Expected behavior

A warning about the deprecated option, as in 1.7.0:

$ ~/git/meson/meson.py setup build -Dsystemtap=true
The Meson build system
Version: 1.7.0
Source dir: /tmp/foo
Build dir: /tmp/foo/build
Build type: native build
DEPRECATION: Option 'systemtap' value 'true' is replaced by 'enabled'
Project name: foo
Project version: 0.1
C compiler for the host machine: sccache cc (gcc 15.0.1 "cc (Gentoo Hardened 15.0.9999 p, commit bf513bda9c29822dae7198066c2a6bb18fd2b65b) 15.0.1 20250401 (experimental) 28751389a68e131e21fcaf8e3f661d76a2b4d0cc")
C linker for the host machine: cc ld.bfd 2.44.50.20250401
Host machine cpu family: x86_64
Host machine cpu: x86_64
Build targets in project: 1

foo 0.1

  User defined options
    systemtap: true

Found ninja-1.13.0.git at /usr/bin/ninja

system parameters

  • Is this a cross build or just a plain native build (for the same computer)? Plain native.
  • Gentoo Linux
  • Python 3.13.2
  • 1.7.99 (19482e4)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions