necropotame / teeworlds-infclass

Infection Mod with a class system for TeeWorlds
Other
40 stars 25 forks source link

Building with mysql is hard #218

Open bretonium opened 6 years ago

bretonium commented 6 years ago

Today i have spent a lot of time trying to build infclass with mysql support. Even though the build succeeded, i always got this error when launched sql_server_d:

[5bcb4203][sql]: MySQL Error: Access denied for user 'breton'@'localhost'
[5bcb4203][sql]: ERROR: sql connection failed
[5bcb4203][sql]: Warning: Unable to connect to SqlWriteServer 0 ('127.0.0.1'), trying next...
[5bcb4203][sql]: FATAL ERROR: No SqlWriteServers available

I got this error even though i used another user for mysql credentials.

Turns out, i needed to install development libraries to my system: apt install libmariadbclient-dev libmysqlcppconn-dev. I also had to edit config.lua and set mysql.use_mysqlconfig = true. I figured it out only after seeing a mention of a similar problem with DDNet.

The perfect fix would be build system failure if required libraries are not present on the system. Less perfect fix would be documenting current behavior and/or running reproducible builds somewhere.

progval commented 6 years ago

I don't think the problem was caused by a missing library, because infclass clearly managed to contact mysql (Access denied for user 'breton'@'localhost' is an error from the server).

The bug here is a runtime bug, with nothing to do with dependencies; which just happens to go away when you use mysql.use_mysqlconfig = true. I had a similar issue some time ago. Try changing your MySQL password to something simpler, eg. 10 alphanumerical characters.

progval commented 6 years ago

Eww I just took a look at the code, and noticed that infclass bundles an old version of libmysqlclient. That's probably where the bug is