kometbomb / klystrack

A chiptune tracker
http://kometbomb.github.io/klystrack/
Other
482 stars 29 forks source link

Build errors for themes and core dumps #206

Closed ghost closed 7 years ago

ghost commented 8 years ago

I am getting some missing file errors when running make, they seem all related to a themes directory.

cp: cannot stat ‘themes/AHX/analyzor.*’: No such file or directory
cp: cannot stat ‘themes/AHX/catometer.*’: No such file or directory
cp: cannot stat ‘themes/AHX/cursor.*’: No such file or directory
cp: cannot stat ‘themes/AHX/logo.*’: No such file or directory
cp: cannot stat ‘themes/Blacklyst/catometer.*’: No such file or directory
cp: cannot stat ‘themes/Blacklyst/cursor.*’: No such file or directory
cp: cannot stat ‘themes/Blacklyst/logo.*’: No such file or directory
cp: cannot stat ‘themes/C64/analyzor.*’: No such file or directory
cp: cannot stat ‘themes/C64/catometer.*’: No such file or directory
cp: cannot stat ‘themes/C64/cursor.*’: No such file or directory
cp: cannot stat ‘themes/Classic/analyzor.*’: No such file or directory
cp: cannot stat ‘themes/Classic/catometer.*’: No such file or directory
cp: cannot stat ‘themes/Classic/cursor.*’: No such file or directory
cp: cannot stat ‘themes/Classic/logo.*’: No such file or directory
cp: cannot stat ‘themes/Default/cursor.*’: No such file or directory
cp: cannot stat ‘themes/Gameboy/analyzor.*’: No such file or directory
cp: cannot stat ‘themes/Gameboy/catometer.*’: No such file or directory
cp: cannot stat ‘themes/Gameboy/cursor.*’: No such file or directory
cp: cannot stat ‘themes/Gameboy/logo.*’: No such file or directory
cp: cannot stat ‘themes/Golden_Brown/catometer.*’: No such file or directory
cp: cannot stat ‘themes/Golden_Brown/cursor.*’: No such file or directory
cp: cannot stat ‘themes/Golden_Brown/logo.*’: No such file or directory
cp: cannot stat ‘themes/Rust_Camo/cursor.*’: No such file or directory
cp: cannot stat ‘themes/Rust_Camo/logo.*’: No such file or directory
cp: cannot stat ‘themes/Rust_Red/cursor.*’: No such file or directory
cp: cannot stat ‘themes/Rust_Red/logo.*’: No such file or directory
cp: cannot stat ‘themes/Ultimate_Proctamed/catometer.*’: No such file or directory
cp: cannot stat ‘themes/Ultimate_Proctamed/cursor.*’: No such file or directory
cp: cannot stat ‘themes/Ultimate_Proctamed/logo.*’: No such file or directory

This does not seem to effect the build, but when I run the binary in the bin.debug folder I get a core dump.

$ cd bin.debug
$ ./klystrack 
[DEBUG] Starting klystrack 1.7.0 20160804
[DEBUG] Loading filebox favorites (/home/nathan/.klystrackfavorites)
[DEBUG] Renderer: opengl (Accelerated)
[DEBUG] Setting screen mode (scale = 1)
[DEBUG] Rendering to texture enabled
[DEBUG] Screen size is 640x480
[DEBUG] Window size is 640x480
[DEBUG] init
[DEBUG] Enumerating themes at /usr/lib/klystrack/res
[WARNING] Could not enumerate themes at /usr/lib/klystrack/res
[DEBUG] Enumerating keymaps at /usr/lib/klystrack/key
[WARNING] Could not enumerate keymaps at /usr/lib/klystrack/key
[DEBUG] undo = (nil) redo = (nil)
[DEBUG] init done
[DEBUG] Setting screen mode (scale = 1)
[DEBUG] Rendering to texture enabled
[DEBUG] Screen size is 640x480
[DEBUG] Window size is 640x480
[DEBUG] Setting screen mode (scale = 1)
[DEBUG] Rendering to texture enabled
[DEBUG] Screen size is 640x480
[DEBUG] Window size is 640x480
[DEBUG] Setting screen mode (scale = 1)
[DEBUG] Rendering to texture enabled
[DEBUG] Screen size is 640x480
[DEBUG] Window size is 640x480
[DEBUG] Loading theme '/usr/lib/klystrack/res/Default'
[WARNING] Can't open bundle '/usr/lib/klystrack/res/Default'
[DEBUG] Theme loading failed
[DEBUG] Loading filebox favorites (/home/nathan/.klystrackfavorites)
[DEBUG] Reserving 32 Cyd channels
[DEBUG] New song
[DEBUG] Zap instruments
[DEBUG] Zap sequence
[DEBUG] Zap FX
[DEBUG] Zap wavetable
[DEBUG] Changed num_channels = 4
[DEBUG] Reserving 4 Cyd channels
[DEBUG] Opening SDL audio
[DEBUG] Got 44100 Hz/format 32784/2 channels
[DEBUG] SDL_WINDOWEVENT_SIZE_CHANGED 640x480
Segmentation fault (core dumped)
FreeFull commented 8 years ago

The segfault is related to /usr/lib/klystrack/res not existing. What I do is build with this command: make RES_PATH=. and then copy the res directory over to where the binary is (the directory itself, rather than just its contents).

kometbomb commented 8 years ago

Yup, indeed there a line saying this [WARNING] Can't open bundle '/usr/lib/klystrack/res/Default' I will make that a fatal error.

By the way, I have no idea what is the correct way to store assets on Linux, so please say if putting them in /usr/lib/ is not good. If there was just an archive with the binary and other files (just like the .zip for Windows) it's obvious but with a .deb package it's less so.

ghost commented 8 years ago

I think that /usr/local is probably a good place to put klystrack for installation. you won't have access to /usr/local without root privileges so for simple builds (i.e. make all), I would suggest using a relative path from the Makefile since the user should have read/write privileges in that location. Otherwise, when installing (i.e. make install) you should assume root privileges to install to /usr/local. At least, this is my opinion...

A quick snippit from TLDP about /usr/local says the following:

The original idea behind '/usr/local' was to have a separate ('local') '/usr' directory 
on every machine besides '/usr', which might be just mounted read-only from 
somewhere else. It copies the structure of '/usr'. These days, '/usr/local' is widely 
regarded as a good place in which to keep self-compiled or third-party programs.

Hope that helps

kometbomb commented 8 years ago

That was quite informational. Thanks!

ghost commented 8 years ago

I've tried setting RES_PATH= when running make as you mentioned, then making a symlink to from /usr/lib/klystrack to my klystrack folder. It seems to work but it is a temporary fix, so I believe until the paths are changed for make all and make install you can just leave this open, or create a different issue.

ghost commented 7 years ago

Edit: Actual problem was that I was copying over the themes from the themes directory as opposed to the res directory. Oops haha. ._.

kometbomb commented 7 years ago

Ah, OK. I was going to suggest you to check the file contents with a hex editor or something, fearing something went broken in the bundling tool.