-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
compiler.links command for vala crashes #12959
Comments
The bug still happens in meson release 1.4.0 |
Reproduced. Fixed formatting and reduced a little bit: project(
'vala-test',
['c', 'vala'],
license: 'GPL3+',
meson_version: '>= 0.62.0',
version: '0.1',
)
valac = meson.get_compiler('vala')
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));}'''
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 Full backtrace:
|
Does vala.compiles() similarly crash? It’s an interesting question with languages like vala that are transpilers what these even mean, does compiles mean vala->c? Vala->obj? |
vala.compiles() doesn’t crash. |
Good to know, I'll have to go look at the implementation of vala.compiles and see what it's doing. |
In meson it is possible to transparently use vala or cython sources to generate libraries or executables, even mixing in other sources that get directly compiled to object code. This somehow implies that the transpiler step is implicit, from a user point of view. Therefore, I think that the less surprising thing for vala's |
dcbaker, with respect to your question vala→c or vala→obj. When I pass args : ['--Xcc=-DVALA_STRICT_C'] to valac.compiles I get: warning: -X has no effect when -C or --ccode is set Passing -C or --ccode to valac ensures it only compiles the vala code to C code. I’m not sure why you would want to do this. Unless there is a way to pass the C code to gcc. |
It seems that the meson code for vala has been nobbled to stop it linking even when mode==CompileCheckMode.LINK |
Fixes issue #12959 compiler.links command for vala crashes
Fixes issue mesonbuild#12959 compiler.links command for vala crashes
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
The text was updated successfully, but these errors were encountered: