Skip to content

compiler.links command for vala crashes #12959

Closed
@bcorby

Description

@bcorby

meson crashes with:

AttributeError: 'NoneType' object has no attribute 'get_option_args'
meson.build:20:20: ERROR: Unhandled python exception

My meson.build file:
**# Project & version number
project('vala-test', ['c', 'vala'],
license: 'GPL3+',
meson_version: '>= 0.62.0',
version: '0.1'
)

gee_dep = dependency('gee-0.8')
gio_dep = dependency('gio-2.0', version: '>= 2.78.0')
glib_dep = dependency('glib-2.0', version: '>= 2.78.0')

valac = meson.get_compiler('vala')
posix_dep = valac.find_library('posix')

code0 = '''private const string [] strings = {"a","b"};
private static string test_string (string [] s) {return s[0];}
void main() {stdout.printf ("%s\n",test_string (strings));}'''

this next line crashes

code0_links = valac.links(code0, args : '--define=VALA_STRICT_C', name : 'if an array of strings needs casting?')
if not code0_links
message ('VALA_NEEDS_ARRAY_STRING_CASTING')
endif**

I run this in the directory with meson.build to cause the crash:
meson setup ../builddir

Expected behavior
I see the message VALA_NEEDS_ARRAY_STRING_CASTING.

system parameters

  • native build (for the same computer)?
  • debian testing operating system
  • Python 3.11.6
  • meson --version: 1.2.1
  • ninja --version: 1.11.1
  • vala --version: Vala 0.56.13
  • gcc --version: gcc (GCC) 14.0.1 20240131

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions