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
SuperTuxKart fails to start when /data exists #2073
Comments
You can temporarily workaround it using environment variable: I don't see any clear solution atm. We could check first if SUPERTUXKART_DATADIR exists. But then local installation will use Even if we check if this directory is our (it contains karts, tracks etc.) we can't be sure that it's proper directory and not totally different STK version installed in strange location. Maybe we should add file with information about version to stk-assets? In cmake we can use PROJECT_VERSION as compiler definition. Then it could be easily compared in file_manager. |
What do you think of the proposal above (#2074)? This changes the priority for
I think this is more reasonable than the current priorities, because I would expect that a path I specified during compilation would take priority over the existence of the various relative paths. Local installation should still work fine, because this only affects the behavior when the Regarding the Arch Linux package, if #2074 is accepted, the package maintainer can just add the option |
I have installed in my system:
If you will prioritize SUPERTUXKART_DATADIR, then 0.9-rc1 version will find 0.8.1 data directory in We sould detect if this is our data directory. Ideally we should remember somewhere version number, or at least check if karts and tracks directories exist. But anyway is |
/data? Seriously? ;) No other distro ever had /data. How much of a problem is that for 0.9 - I am not exactly keen on changing the startup sequence, since we have basically a code freeze. ../.. was added mainly because many beginners would try to start a self-compiled version in unexpected directories (i.e. in cmake/bin, not cmake), and we got tired of debugging this ;) A very minor reason is that it was convenient once or twice for debugging (though that's not important, obviously you can just type a slightly longer path :P ). I'd suggest we just add a check if the file stk_config.xml exists in that data directory:
etc. - but ideally after 0.9. |
Thank you both for your responsiveness and helpfulness. 😃
Wouldn't you define the preprocessor option The only time I can see #2074 being a problem is if Edit: I just took a look at
Yeah, that's probably a good idea anyway, and it would fix this issue.
Yeah, it's not a distro thing. 😉 I have an SSD and an HDD, and most of my HDD is one big partition that I have mounted at I was just surprised that the existence of a directory seemingly unrelated to STK caused it to crash, so I thought it was appropriate to file a bug report. I'll just specify the |
I have /data on my smartphone by default (Jolla with Sailfish OS) :P |
Mounted /data? That should to go /mnt/data ;) Can you try the fix_2073 branch? It checks if the file ...../data/stk_config.xml exists (not only ......./data), that should avoid the problem. Not a really complete solution if you should have e.g. 0.8.1 installed in /data it would still detect the incorrect version. We could perhaps add a version number either to the file name of stk_config.xml, or as an xml attribute (which would be more work/slower to check at startup time). But tbh, I doubt that any of those cases merits additional work :) |
Why not add a file that has the name of the stk version it belongs to? e.g. for 0.9 you could add a file |
I agree with konstin. In cmake just add:
and check if Btw. /data is important directory on Android ;) |
We can discuss adding a version number, but I think we need a separate ticket for that - e.g. instead of PROJECT_VERSION we should probably use supertuxkart_0.9 or so (otherwise someone has /data/0.9 - which could be any not stk related file), see #2077 . |
…ed by STK to detect that stk is reading the right data files (and therefore avoids #2073, in which stk finds the wrong data directory).
As konstin suggested I've added a file 'supertuxkart.git' in 78c592e, which is used by the file manager to detect the right data directory. There are now also proper error messages in place, which is I think as good as it gets. |
Version: 0.9rc1-1 (Arch Linux package)
Description
When a directory
/data
exists, STK experiences a fatal error and fails to start.Steps to reproduce
supertuxkart
. The Arch Linux package places thesupertuxkart
binary at/usr/bin/supertuxkart
and the data files in/usr/share/supertuxkart/data
./data
directory. (That's a directory nameddata
, immediately under the root directory.)supertuxkart
at the command line.Actual behavior
This results in the following output:
Expected behavior
Start SuperTuxKart.
Problem
Looking at the source, it appears that the bug was introduced in b9b2f96. The problem is that STK erroneously assumes that if a directory
../../data
exists (in this case/data
), it must contain the STK data files. Note that even if the Arch Linux package was built withSUPERTUXKART_DATADIR
defined to the correct directory, STK would still check for the problematic path../../data
first.Temporary workaround
For the time being, I can manually specify the correct data directory with
supertuxkart --root=/usr/share/supertuxkart/data
.The text was updated successfully, but these errors were encountered: