Bug 248540 - games/minetest Minetest 5.3.0 fails to compile with multiple issues
Summary: games/minetest Minetest 5.3.0 fails to compile with multiple issues
Status: In Progress
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Dmitry Marakasov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-08 20:27 UTC by Patrick McMunn
Modified: 2020-08-25 02:02 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (amdmi3)


Attachments
port config options (580 bytes, text/plain)
2020-08-24 03:58 UTC, Patrick McMunn
no flags Details
My /etc/make.conf (353 bytes, text/plain)
2020-08-24 04:10 UTC, Patrick McMunn
no flags Details
log of failed build (52.31 KB, text/plain)
2020-08-24 04:15 UTC, Patrick McMunn
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick McMunn 2020-08-08 20:27:59 UTC
While trying to troubleshoot this issue, I ran into a few other problems as well. The main problem is that it failed to link to the bundled jsoncpp for the server component. I edited the Makefile so it would link to the system jsoncpp, and it compiled successfully but did not run. However, in order to finish compiling, I also had to disable NLS because the installation failed due to the missing translation files. And that was just trying to compile the server. Enabling the client introduced a different compilation failure.

Anyway, one thing at a time. I'm running 12.1-STABLE r363327. The main issue I ran into while trying to compile the server is as follows:

ld: error: undefined symbol: Json::Value::operator=(Json::Value&&)
>>> referenced by mods.cpp
>>>               src/CMakeFiles/minetestserver.dir/content/mods.cpp.o:(ModMetadata::save(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&))
>>> referenced by mods.cpp
>>>               src/CMakeFiles/minetestserver.dir/content/mods.cpp.o:(ModMetadata::load(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&))
>>> referenced by c_content.cpp
>>>               src/CMakeFiles/minetestserver.dir/script/common/c_content.cpp.o:(read_json_value(lua_State*, Json::Value&, int, unsigned char))
>>> referenced by c_content.cpp
>>>               src/CMakeFiles/minetestserver.dir/script/common/c_content.cpp.o:(read_json_value(lua_State*, Json::Value&, int, unsigned char))
>>> referenced by c_content.cpp
>>>               src/CMakeFiles/minetestserver.dir/script/common/c_content.cpp.o:(read_json_value(lua_State*, Json::Value&, int, unsigned char))
>>> referenced by c_content.cpp
>>>               src/CMakeFiles/minetestserver.dir/script/common/c_content.cpp.o:(read_json_value(lua_State*, Json::Value&, int, unsigned char))
>>> referenced by l_util.cpp
>>>               src/CMakeFiles/minetestserver.dir/script/lua_api/l_util.cpp.o:(ModApiUtil::l_parse_json(lua_State*))
>>> referenced by convert_json.cpp
>>>               src/CMakeFiles/minetestserver.dir/convert_json.cpp.o:(fetchJsonValue(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >*))
>>> referenced by convert_json.cpp
>>>               src/CMakeFiles/minetestserver.dir/convert_json.cpp.o:(fastWriteJson(Json::Value const&))
>>> referenced by remoteplayer.cpp
>>>               src/CMakeFiles/minetestserver.dir/remoteplayer.cpp.o:(RemotePlayer::serializeExtraAttributes(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&))
>>> referenced 41 more times
>>> did you mean: Json::Value::operator=(Json::Value)
>>> defined in: lib/jsoncpp/libjsoncpp.a(jsoncpp.cpp.o)

ld: error: undefined symbol: Json::Value::operator=(Json::Value const&)
>>> referenced by c_content.cpp
>>>               src/CMakeFiles/minetestserver.dir/script/common/c_content.cpp.o:(read_json_value(lua_State*, Json::Value&, int, unsigned char))
>>> referenced by c_content.cpp
>>>               src/CMakeFiles/minetestserver.dir/script/common/c_content.cpp.o:(read_json_value(lua_State*, Json::Value&, int, unsigned char))
>>> referenced by serverlist.cpp
>>>               src/CMakeFiles/minetestserver.dir/serverlist.cpp.o:(ServerList::getOnline())
>>> referenced by serverlist.cpp
>>>               src/CMakeFiles/minetestserver.dir/serverlist.cpp.o:(ServerList::serializeJson(std::__1::vector<Json::Value, std::__1::allocator<Json::Value> > const&))
>>> referenced by serverlist.cpp
>>>               src/CMakeFiles/minetestserver.dir/serverlist.cpp.o:(std::__1::vector<Json::Value, std::__1::allocator<Json::Value> >::insert(std::__1::__wrap_iter<Json::Value const*>, Json::Value const&))
>>> referenced by tool.cpp
>>>               src/CMakeFiles/minetestserver.dir/tool.cpp.o:(ToolGroupCap::toJson(Json::Value&) const)
>>> referenced by tool.cpp
>>>               src/CMakeFiles/minetestserver.dir/tool.cpp.o:(ToolCapabilities::serializeJson(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const)
>>> referenced by tool.cpp
>>>               src/CMakeFiles/minetestserver.dir/tool.cpp.o:(ToolCapabilities::serializeJson(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const)

ld: error: undefined symbol: Json::StreamWriterBuilder::operator[](std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)
>>> referenced by convert_json.cpp
>>>               src/CMakeFiles/minetestserver.dir/convert_json.cpp.o:(fastWriteJson(Json::Value const&))

ld: error: undefined symbol: Json::ValueIteratorBase::deref()
>>> referenced by serverlist.cpp
>>>               src/CMakeFiles/minetestserver.dir/serverlist.cpp.o:(ServerList::getOnline())
>>> referenced by tool.cpp
>>>               src/CMakeFiles/minetestserver.dir/tool.cpp.o:(ToolCapabilities::deserializeJson(std::__1::basic_istream<char, std::__1::char_traits<char> >&))
>>> referenced by tool.cpp
>>>               src/CMakeFiles/minetestserver.dir/tool.cpp.o:(ToolCapabilities::deserializeJson(std::__1::basic_istream<char, std::__1::char_traits<char> >&))
c++: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/games/minetest
*** Error code 1

Stop.
make: stopped in /usr/ports/games/minetest
Comment 1 Patrick McMunn 2020-08-12 21:12:58 UTC
I tried building Minetest manually to see if I could troubleshoot the issue, and it still occurred. So I also filed an upstream bug report: https://github.com/minetest/minetest/issues/10289 .
Comment 2 Dmitry Marakasov freebsd_committer 2020-08-23 11:16:18 UTC
I cannot reproduce any of the problems. It builds fine both with and without NLS both with and without system jsoncpp present. Please attach your options configuration, make.conf and full build log.
Comment 3 Patrick McMunn 2020-08-24 03:58:24 UTC
Created attachment 217472 [details]
port config options

For the build log I'm attaching, I just ran rmconfig and then reset to default options.
Comment 4 Patrick McMunn 2020-08-24 04:10:00 UTC
Created attachment 217473 [details]
My /etc/make.conf
Comment 5 Patrick McMunn 2020-08-24 04:15:31 UTC
Created attachment 217474 [details]
log of failed build
Comment 6 Patrick McMunn 2020-08-24 04:25:42 UTC
I attached the requested information. But in the process of getting the requested information ready to attach, I noticed something. When I ran rmconfig and recreated the port config options, they were not the defaults as I originally thought. My make.conf set some default options which, in the case of Minetest, enabled all of the database options which are normally disabled in a default configuration.

So I reset the options to the actual defaults with all the database options disabled. Minetest built just fine with no problem. I haven't tried the database options one at a time or any combination other than all of them at once, but apparently at least one of the database options is causing the problem.

Even after disabling the database options and achieving a successful build, one of my earlier finds still holds true. If the client option is disabled and only the server is built, but NLS is enabled, then Minetest will build successfully but fail to install due to missing minetest.mo files.
Comment 7 Patrick McMunn 2020-08-24 04:38:49 UTC
One last observation. I tested all the database backends. The build will fail if either PosGreSQL or SpatialIndex is enabled. LevelDB and Redis work, and Minetest will buid if either of those is enabled.
Comment 8 Patrick McMunn 2020-08-25 02:02:12 UTC
I had time to do some further testing. Minetest will build with the PostGreSQL and SpatialIndex optons enabled if -DENABLE_SYSTEM_JSONCPP=1 is passed to cmake. There is a note in the port's Makefile referencing cmake/Modules/FindJson.cmake which states that using the system jsoncpp "May cause segfaults and other memory errors!". I brought this up with upstream, and he said "That warning text is old and should probably be removed.". So it looks like enabling the system jsoncpp should be safe and will avoid these compilation errors.