[d] как отладить сторонний пакет под dub

Phoenix

Как-то так сейчас.
 
 ffdub/fdub(0/1)$  cat dub.json 
{
"name": "fdub",
"targetPath": "bin",
"targetName": "testapp",
"targetType": "executable",
"description": "A minimal D application.",
"copyright": "Copyright © 2015, igor",
"authors": ["igor"],
"dependencies": {
"dlangui": "~master",
}
}

 
 $ dub list       
WARNING: gnome-keyring:: couldn't connect to: /home/igor/.cache/keyring-1o42WR/pkcs11: No such file or directory
Packages present in the system and known to dub:
fdub ~master: /home/igor/devel/dlang/tutoral/ffdub/fdub/
derelict-util 1.9.1: /home/igor/.dub/packages/derelict-util-1.9.1/
dlangui ~master: /home/igor/.dub/packages/dlangui-master/
dlangui:helloworld ~master: /home/igor/.dub/packages/dlangui-master/examples/helloworld/
dlangui:example1 ~master: /home/igor/.dub/packages/dlangui-master/examples/example1/
dlangui:dmledit ~master: /home/igor/.dub/packages/dlangui-master/examples/dmledit/
dlangui:d3d ~master: /home/igor/.dub/packages/dlangui-master/examples/d3d/
dlangui:tetris ~master: /home/igor/.dub/packages/dlangui-master/examples/tetris/
dlib ~master: /home/igor/.dub/packages/dlib-master/
dlib 0.5.2: /home/igor/.dub/packages/dlib-0.5.2/
derelict-sdl2 1.9.5: /home/igor/.dub/packages/derelict-sdl2-1.9.5/
gl3n 1.0.1: /home/igor/.dub/packages/gl3n-1.0.1/
derelict-gl3 1.0.12: /home/igor/.dub/packages/derelict-gl3-1.0.12/
dsfml ~master: /home/igor/.dub/packages/dsfml-master/
dsfml:audio ~master: /home/igor/.dub/packages/dsfml-master/
dsfml:graphics ~master: /home/igor/.dub/packages/dsfml-master/
dsfml:window ~master: /home/igor/.dub/packages/dsfml-master/
dsfml:network ~master: /home/igor/.dub/packages/dsfml-master/
dsfml:system ~master: /home/igor/.dub/packages/dsfml-master/
derelict-ft 1.0.2: /home/igor/.dub/packages/derelict-ft-1.0.2/

Падает с segfault. хочу поотлаживать. Скачать исходники, положил рядом. В .dub лезть не хочу. Как сказать dub, что у меня своя версия dlangui и derelict-ft по нужному пути.
Но не глобально, а только для данного проекта?
доков как-то по dub совсем нет :(
ps
 $ dub run
WARNING: gnome-keyring:: couldn't connect to: /home/igor/.cache/keyring-1o42WR/pkcs11: No such file or directory
WARNING: A deprecated branch based version specification is used for the dependency dlangui. Please use numbered versions instead. Also note that you can still use the dub.selections.json file to override a certain dependency to use a branch instead.
Target gl3n 1.0.1 is up to date. Use --force to rebuild.
Target dlib ~master is up to date. Use --force to rebuild.
Target derelict-util 1.9.1 is up to date. Use --force to rebuild.
Target derelict-ft 1.0.2 is up to date. Use --force to rebuild.
Target derelict-sdl2 1.9.5 is up to date. Use --force to rebuild.
Target derelict-gl3 1.0.12 is up to date. Use --force to rebuild.
Target dlangui ~master is up to date. Use --force to rebuild.
Target fdub ~master is up to date. Use --force to rebuild.
Running ./bin/testapp
2015-05-08 12:59:36.461 W Only hardcoded paths to TTF fonts are supported under linux so far. TODO: implement fontconfig support.
2015-05-08 12:59:36.461 D FreeTypeFontManager.registerFont /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf SansSerif DejaVuSans italic=false weight=400
2015-05-08 12:59:36.461 D FreeTypeFontManager.registerFont /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Bold.ttf SansSerif DejaVuSans italic=false weight=800
2015-05-08 12:59:36.462 D FreeTypeFontManager.registerFont /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Oblique.ttf SansSerif DejaVuSans italic=true weight=400
2015-05-08 12:59:36.462 D FreeTypeFontManager.registerFont /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-BoldOblique.ttf SansSerif DejaVuSans italic=true weight=800
2015-05-08 12:59:36.462 D FreeTypeFontManager.registerFont /usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono.ttf MonoSpace DejaVuSansMono italic=false weight=400
2015-05-08 12:59:36.462 D FreeTypeFontManager.registerFont /usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono-Bold.ttf MonoSpace DejaVuSansMono italic=false weight=800
2015-05-08 12:59:36.462 D FreeTypeFontManager.registerFont /usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono-Oblique.ttf MonoSpace DejaVuSansMono italic=true weight=400
2015-05-08 12:59:36.462 D FreeTypeFontManager.registerFont /usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono-BoldOblique.ttf MonoSpace DejaVuSansMono italic=true weight=800
2015-05-08 12:59:36.462 D Creating default theme
2015-05-08 12:59:36.673 D Loading string resources from file @/std_en.ini
2015-05-08 12:59:36.675 I Applying loaded theme theme_default
2015-05-08 12:59:36.676 D Creating SDL window
2015-05-08 12:59:36.678 I Trying to create OpenGL 3.2 context
2015-05-08 12:59:36.680 E SDL_GL_CreateContext failed: Could not create GL context
2015-05-08 12:59:36.680 W trying other versions of OpenGL
2015-05-08 12:59:36.680 I Trying to create OpenGL 3.3 context
2015-05-08 12:59:36.682 E SDL_GL_CreateContext failed: Could not create GL context
2015-05-08 12:59:36.682 I Trying to create OpenGL 3.1 context
2015-05-08 12:59:36.687 E SDL_GL_CreateContext failed: Could not create GL context
2015-05-08 12:59:36.687 I Trying to create OpenGL 4.0 context
2015-05-08 12:59:36.690 E SDL_GL_CreateContext failed: Could not create GL context
2015-05-08 12:59:36.690 I Trying to create OpenGL 2.1 context
2015-05-08 12:59:36.695 E SDL_GL_CreateContext failed: Could not create GL context
2015-05-08 12:59:36.695 W OpenGL support is disabled
Error executing command run:
Program exited with code -11

 $ gdb bin/testapp 
GNU gdb (GDB) 7.4.1-debian
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/igor/devel/dlang/tutoral/ffdub/fdub/bin/testapp...done.
(gdb) r
Starting program: /home/igor/devel/dlang/tutoral/ffdub/fdub/bin/testapp
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
2015-05-08 13:00:04.504 W Only hardcoded paths to TTF fonts are supported under linux so far. TODO: implement fontconfig support.
2015-05-08 13:00:04.504 D FreeTypeFontManager.registerFont /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf SansSerif DejaVuSans italic=false weight=400
2015-05-08 13:00:04.504 D FreeTypeFontManager.registerFont /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Bold.ttf SansSerif DejaVuSans italic=false weight=800
2015-05-08 13:00:04.505 D FreeTypeFontManager.registerFont /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-Oblique.ttf SansSerif DejaVuSans italic=true weight=400
2015-05-08 13:00:04.505 D FreeTypeFontManager.registerFont /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans-BoldOblique.ttf SansSerif DejaVuSans italic=true weight=800
2015-05-08 13:00:04.505 D FreeTypeFontManager.registerFont /usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono.ttf MonoSpace DejaVuSansMono italic=false weight=400
2015-05-08 13:00:04.506 D FreeTypeFontManager.registerFont /usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono-Bold.ttf MonoSpace DejaVuSansMono italic=false weight=800
2015-05-08 13:00:04.506 D FreeTypeFontManager.registerFont /usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono-Oblique.ttf MonoSpace DejaVuSansMono italic=true weight=400
2015-05-08 13:00:04.506 D FreeTypeFontManager.registerFont /usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono-BoldOblique.ttf MonoSpace DejaVuSansMono italic=true weight=800
2015-05-08 13:00:04.506 D Creating default theme
[New Thread 0x7fffef6a4700 (LWP 29787)]
2015-05-08 13:00:04.850 D Loading string resources from file @/std_en.ini
2015-05-08 13:00:04.855 I Applying loaded theme theme_default
2015-05-08 13:00:04.855 D Creating SDL window
2015-05-08 13:00:04.858 I Trying to create OpenGL 3.2 context
2015-05-08 13:00:04.860 E SDL_GL_CreateContext failed: Could not create GL context
2015-05-08 13:00:04.860 W trying other versions of OpenGL
2015-05-08 13:00:04.860 I Trying to create OpenGL 3.3 context
2015-05-08 13:00:04.863 E SDL_GL_CreateContext failed: Could not create GL context
2015-05-08 13:00:04.863 I Trying to create OpenGL 3.1 context
2015-05-08 13:00:04.867 E SDL_GL_CreateContext failed: Could not create GL context
2015-05-08 13:00:04.868 I Trying to create OpenGL 4.0 context
2015-05-08 13:00:04.870 E SDL_GL_CreateContext failed: Could not create GL context
2015-05-08 13:00:04.871 I Trying to create OpenGL 2.1 context
2015-05-08 13:00:04.875 E SDL_GL_CreateContext failed: Could not create GL context
2015-05-08 13:00:04.876 W OpenGL support is disabled

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff66b7940 in ? from /usr/lib/x86_64-linux-gnu/libSDL2.so

(gdb) bt
0x00007ffff66b7940 in ? from /usr/lib/x86_64-linux-gnu/libSDL2.so
0x00007ffff66b7a4a in ? from /usr/lib/x86_64-linux-gnu/libSDL2.so
0x00007ffff66bb339 in ? from /usr/lib/x86_64-linux-gnu/libSDL2.so
0x00007ffff66ac8c5 in ? from /usr/lib/x86_64-linux-gnu/libSDL2.so
0x00007ffff6660e86 in ? from /usr/lib/x86_64-linux-gnu/libSDL2.so
0x00007ffff66537c0 in ? from /usr/lib/x86_64-linux-gnu/libSDL2.so
0x00000000006eb573 in dlangui.platforms.sdl.sdlapp.SDLWindow.create (this=0x7ffff7f5ea00, flags=1)
at ../../../../../.dub/packages/dlangui-master/src/dlangui/platforms/sdl/sdlapp.d:187
0x00000000006eae2f in dlangui.platforms.sdl.sdlapp.SDLWindow.__ctor (this=0x7ffff7f5ea00, height=0, width=0, flags=1, parent=0x0, caption=...,
platform=0x7ffff7ef6c80) at ../../../../../.dub/packages/dlangui-master/src/dlangui/platforms/sdl/sdlapp.d:69
0x00000000006edf44 in dlangui.platforms.sdl.sdlapp.SDLPlatform.createWindow (this=0x7ffff7ef6c80, height=0, width=0, flags=1, parent=0x0,
windowCaption=...) at ../../../../../.dub/packages/dlangui-master/src/dlangui/platforms/sdl/sdlapp.d:938
0x0000000000608c97 in UIAppMain (args=...) at ../../../../../.dub/packages/dlangui-master/src/dlangui/platforms/common/platform.d:1237
0x0000000000633bde in dlangui.platforms.sdl.sdlapp.sdlmain (args=...)
at ../../../../../.dub/packages/dlangui-master/src/dlangui/platforms/sdl/sdlapp.d:1329
0x000000000063395d in DLANGUImain (args=...) at ../../../../../.dub/packages/dlangui-master/src/dlangui/platforms/sdl/sdlapp.d:1257
0x0000000000608c18 in D main (args=...) at ../../../../../.dub/packages/dlangui-master/src/dlangui/platforms/common/platform.d:1402
0x000000000074a593 in rt.dmain2._d_run_main
0x00007fffffffe1a0 in ?
0x00007fffffffdff0 in ?
0x000000000074a4e6 in rt.dmain2._d_run_main
0x00007fffffffe0c0 in ?
0x00007fffffffe110 in ?
0x00007fffffffe0f5 in ?
0x00007fffffffe1a0 in ?
0x000000000074867d in gc_malloc
0x00000000007aa130 in ?
0x00007fffffffe1a0 in ?
0x00007fff00000000 in ?
0x00007fffffffe1a0 in ?
0x000000000074a574 in ?
0x00007fffffffe010 in ?
0x000000000074a54c in rt.dmain2._d_run_main
---Type <return> to continue, or q <return> to quit---
0x0000000000000001 in ?
0x00007fffffffe080 in ?
0x000000000074a4e6 in rt.dmain2._d_run_main
0x00007fffffffe0c0 in ?
0x00007fffffffe110 in ?
0x00007fffffffe0f5 in ?
0x00007fffffffe001 in ?
0x0000000000000000 in ?

Phoenix

Раз в тему никто не овтетил, ещё напишу.
Нашёл хак, как можно собрать по linux.
Нужно отключить USE_OPENGL в , выкинув "USE_OPENGL" из "versions" в dub.json у dlangui.
Но это чужой пакет в ~/.dub/packages/, править там не очень корректно. Можно как-то в моей сборке сказать, что я не хочу OPENGL в зависимостях?

jakal222

Раз в тему никто не овтетил, ещё напишу.
Нашёл хак, как можно собрать по linux.
Нужно отключить USE_OPENGL в , выкинув "USE_OPENGL" из "versions" в dub.json у dlangui.
Но это чужой пакет в ~/.dub/packages/, править там не очень корректно. Можно как-то в моей сборке сказать, что я не хочу OPENGL в зависимостях?
Самый очевидный путь: поднять какой-нибудь линух на виртуалке и поотлаживать.
Это же линух, он создан быть легким.
Еще вариант - погуглить IRC чаты с линуксоидами, типа freenode#ubuntu или freenode#linux.

evgen5555

А поставить libsdl2-dev и линковаться с ней не пойдет?
Оставить комментарий
Имя или ник:
Комментарий: