jhass / crystal-gobject

gobject-introspection for Crystal
BSD 3-Clause "New" or "Revised" License
127 stars 13 forks source link

crystal-gobject has problems handling GI_TYPELIB_PATH #11

Closed grindhold closed 4 years ago

grindhold commented 7 years ago

i develop some gobject-introspectable libraries in vala. as those are not packaged when i develop them, they tend to land in /usr/local/lib/x86_64-linux-gnu/girepository-1.0 instead of /usr/lib/x86_64-linux-gnu/girepository-1.0. Usually I am able to compensate with exporting the environment variable GI_TYPELIB_PATH: export GI_TYPELIB_PATH=/usr/local/lib/x86_64-linux-gnu/girepository-1.0 However, crystal-gobject does not seem to be able to handle those libs. Strace shows that it indeed opens the correct typelib, but somehow fails to take the process further.

Strace for things in /usr:

open("/usr/lib/x86_64-linux-gnu/girepository-1.0/GFlow-0.2.typelib", O_RDONLY) = 9
open("/usr/lib/girepository-1.0", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 8
Generate GFlow... open("src/generated/lib_g_flow.cr", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0644) = 8
open("src/generated/g_flow/g_flow.cr", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0644) = 8
open("src/generated/g_flow/node_error.cr", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0644) = 8
open("src/generated/g_flow/simple_node.cr", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0644) = 8
open("src/generated/g_flow/simple_node_private.cr", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0644) = 8
open("src/generated/g_flow/simple_sink.cr", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0644) = 8
open("src/generated/g_flow/simple_sink_private.cr", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0644) = 8
open("src/generated/g_flow/simple_source.cr", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0644) = 8
open("src/generated/g_flow/simple_source_private.cr", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0644) = 8
open("src/generated/g_flow/dock.cr", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0644) = 8
open("src/generated/g_flow/node.cr", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0644) = 8
open("src/generated/g_flow/sink.cr", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0644) = 8
open("src/generated/g_flow/source.cr", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0644) = 8
open("src/generated/g_flow/module_functions.cr", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0644) = 8
done.

Strace for things in /usr/local:

open("/usr/local/lib/x86_64-linux-gnu/girepository-1.0", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 8
open("/usr/local/lib/x86_64-linux-gnu/girepository-1.0/GFlow-0.2.typelib", O_RDONLY) = 9
open("/usr/lib/x86_64-linux-gnu/girepository-1.0", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 8
open("/usr/lib/girepository-1.0", O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC) = 8
Generate GFlow... open("src/generated/lib_g_flow.cr", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0644) = 8
Nil assertion failed (Exception)
open("./stage3", O_RDONLY|O_CLOEXEC)    = 7
0x562cdccbb0b0: not_nil! at /opt/crystal/src/class.cr 65:0
0x562cdccaca5e: [] at /opt/crystal/src/string.cr 821:5
0x562cdcce6c0d: lib_definition at /home/grindhold/git/crystal-gobject/src/generator/namespace.cr 376:7
0x562cdcce67f5: write_lib at /home/grindhold/git/crystal-gobject/src/generator/namespace.cr 55:7
0x562cdcce6643: write at /home/grindhold/git/crystal-gobject/src/generator/namespace.cr 41:5
0x562cdcc7db34: __crystal_main at /home/grindhold/git/crystal-gobject/src/generator/generator.cr 23:1
0x562cdcc8ff39: main at /opt/crystal/src/main.cr 12:15
0x7f24c1fc82b1: __libc_start_main at ??
0x562cdcc7ccaa: _start at ??
0x0: ??? at ??
+++ exited with 1 +++
jhass commented 4 years ago

Hey, is this still an issue for you? Would you have an updated backtrace or better yet reproduction steps? :)

grindhold commented 4 years ago

never tested again. i don't even have the code i used around anymore :D

jhass commented 4 years ago

Then I'll close this for now until the next person complains :)