MOSS and Ubuntu 20.04

Discussions About MOSS (Myst Online Server Software)

Moderators: a'moaca', rarified

Post Reply
cjkelly1
Member
Posts: 67
Joined: Mon Dec 29, 2008 6:08 am

MOSS and Ubuntu 20.04

Post by cjkelly1 »

Notes for anyone attempting to use MOSS on Ubuntu 20.04

I believe the audience for this post is quite small, if not actually non-existent, but anyway..... :-)

MOSS builds on Ubuntu 20.04, with the following caveats:

Note: Any modifications that I made to get things to work are not necessarily the "correct" ones. I am not a C expert, and so YMMV.

1. Compile error in Logger.h.

Code: Select all

make  all-am
make[1]: Entering directory '/home/moss/moss'
depbase=`echo dispatcher.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
g++ -DHAVE_CONFIG_H -I.   -I/usr/include/postgresql     -pthread -g -O2 -MT dispatcher.o -MD -MP -MF $depbase.Tpo -c -o dispatcher.o dispatcher.cc &&\
mv -f $depbase.Tpo $depbase.Po
In file included from dispatcher.cc:92:
Logger.h: In function ‘std::string methodName(const char*)’:
Logger.h:188:3: error: ‘uint_t’ was not declared in this scope; did you mean ‘wint_t’?
  188 |   uint_t lvl = 1;
      |   ^~~~~~
      |   wint_t
Logger.h:189:10: error: ‘lvl’ was not declared in this scope
  189 |   while (lvl > 0 && end >= 0) {
      |          ^~~
make[1]: *** [Makefile:908: dispatcher.o] Error 1
make[1]: Leaving directory '/home/moss/moss'
make: *** [Makefile:596: all] Error 2
I changed uint_t to uint32_t and it was happy.


2. Compile error and deprecation warning in SDL.cc

Code: Select all

make  all-am
make[1]: Entering directory '/home/moss/moss'
depbase=`echo SDL.lo | sed 's|[^/]*$|.deps/&|;s|\.lo$||'`;\
/bin/bash ./libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I.   -I/usr/include/postgresql     -pthread -g -O2 -MT SDL.lo -MD -MP -MF $depbase.Tpo -c -o SDL.lo SDL.cc &&\
mv -f $depbase.Tpo $depbase.Plo
libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I/usr/include/postgresql -pthread -g -O2 -MT SDL.lo -MD -MP -MF .deps/SDL.Tpo -c SDL.cc  -fPIC -DPIC -o .libs/SDL.o
In file included from SDL.cc:55:
SDL.h: In constructor ‘SDLDesc::Variable::Variable(SDLDesc::sdl_type_t)’:
SDL.h:78:7: error: ‘memset’ was not declared in this scope
   78 |       memset(&m_default, 0, sizeof(m_default));
      |       ^~~~~~
SDL.h:1:1: note: ‘memset’ is defined in header ‘<cstring>’; did you forget to ‘#include <cstring>’?
  +++ |+#include <cstring>
    1 | /* -*- c++ -*- */
SDL.cc: In constructor ‘SDLDesc::SDLDesc(const string&)’:
SDL.cc:61:3: error: ‘memcpy’ was not declared in this scope
   61 |   memcpy(m_name, name.c_str(), name.length()+1);
      |   ^~~~~~
SDL.cc:56:1: note: ‘memcpy’ is defined in header ‘<cstring>’; did you forget to ‘#include <cstring>’?
   55 | #include "SDL.h"
  +++ |+#include <cstring>
   56 | 
SDL.cc: In static member function ‘static SDLDesc* SDLDesc::find_by_name(const char*, const std::__cxx11::list<SDLDesc*>&, u_int)’:
SDL.cc:84:9: error: ‘strlen’ was not declared in this scope
   84 |     if (strlen(desc->name()) == strlen(name)
      |         ^~~~~~
SDL.cc:84:9: note: ‘strlen’ is defined in header ‘<cstring>’; did you forget to ‘#include <cstring>’?
SDL.cc: In function ‘char* f_dirent(dirent*)’:
SDL.cc:118:39: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 4 has type ‘__ino_t’ {aka ‘long unsigned int’} [-Wformat=]
  118 |     snprintf(out, sizeof(out), "{ino=%u name=%s}", d->d_ino, d->d_name);
      |                                      ~^            ~~~~~~~~
      |                                       |               |
      |                                       unsigned int    __ino_t {aka long unsigned int}
      |                                      %lu
SDL.cc: In static member function ‘static int SDLDesc::parse_directory(Logger*, std::__cxx11::list<SDLDesc*>&, std::string&, bool, bool)’:
SDL.cc:132:83: error: ‘strerror’ was not declared in this scope
  132 | Cannot open directory %s for listing: %s\n", dirname.c_str(), strerror(errno));
      |                                                               ^~~~~~~~

SDL.cc:143:46: warning: ‘int readdir_r(DIR*, dirent*, dirent**)’ is deprecated [-Wdeprecated-declarations]
  143 |   while ((ret = readdir_r(dir, entry, &result)) == 0) {
      |                                              ^
In file included from SDL.cc:33:
/usr/include/dirent.h:183:12: note: declared here
  183 | extern int readdir_r (DIR *__restrict __dirp,
      |            ^~~~~~~~~
SDL.cc:143:46: warning: ‘int readdir_r(DIR*, dirent*, dirent**)’ is deprecated [-Wdeprecated-declarations]
  143 |   while ((ret = readdir_r(dir, entry, &result)) == 0) {
      |                                              ^
In file included from SDL.cc:33:
/usr/include/dirent.h:183:12: note: declared here
  183 | extern int readdir_r (DIR *__restrict __dirp,
      |            ^~~~~~~~~
SDL.cc:147:15: error: ‘strlen’ was not declared in this scope
  147 |     int ret = strlen(result->d_name);
      |               ^~~~~~
SDL.cc:147:15: note: ‘strlen’ is defined in header ‘<cstring>’; did you forget to ‘#include <cstring>’?
SDL.cc:173:71: error: ‘strerror’ was not declared in this scope
  173 | err(log, "Error reading directory %s: %s\n", dirname.c_str(), strerror(errno));
      |                                                               ^~~~~~~~

/snip - the entire output is too long for the forum

In SDL.cc, #include <string.h> was changed to #include <strings.h> in commit 3bcd4e9abd435402a1f8099e0e4faf4977934b08.

I changed it back, and it was happy.

The change that introduced the deprecation warning was in the same commit as above, and the developers have determined that it is safe to ignore.

3. Compile errors and deprecation warnings in db_requests.h.

Code: Select all

make  all-am
make[1]: Entering directory '/home/moss/moss'
depbase=`echo backend_all.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
g++ -DHAVE_CONFIG_H -I.   -I/usr/include/postgresql     -pthread -g -O2 -MT backend_all.o -MD -MP -MF $depbase.Tpo -c -o backend_all.o backend_all.cc &&\
mv -f $depbase.Tpo $depbase.Po
In file included from backend_all.cc:89:
db_requests.h: In constructor ‘AuthAcctLogin_AcctQuery::AuthAcctLogin_AcctQuery(const char*, AuthAcctLogin_AcctQuery_Result&)’:
db_requests.h:234:36: warning: ‘pqxx::transactor<TRANSACTION>::transactor(const string&) [with TRANSACTION = pqxx::transaction<>; std::string = std::__cxx11::basic_string<char>]’ is deprecated [-Wdeprecated-declarations]
  234 |       m_name(name), m_result(result)
      |                                    ^
In file included from /usr/include/pqxx/transactor:6,
                 from /usr/include/pqxx/pqxx:19,
                 from backend_all.cc:50:
/usr/include/pqxx/transactor.hxx:160:28: note: declared here
  160 |   PQXX_DEPRECATED explicit transactor(     //[t04]
      |                            ^~~~~~~~~~
In file included from backend_all.cc:89:
db_requests.h: In copy constructor ‘AuthAcctLogin_AcctQuery::AuthAcctLogin_AcctQuery(const AuthAcctLogin_AcctQuery&)’:
db_requests.h:239:52: warning: ‘pqxx::transactor<TRANSACTION>::transactor(const string&) [with TRANSACTION = pqxx::transaction<>; std::string = std::__cxx11::basic_string<char>]’ is deprecated [-Wdeprecated-declarations]
  239 |       m_name(other.m_name), m_result(other.m_result)
      |                                                    ^
In file included from /usr/include/pqxx/transactor:6,
                 from /usr/include/pqxx/pqxx:19,
                 from backend_all.cc:50:
/usr/include/pqxx/transactor.hxx:160:28: note: declared here
  160 |   (     //[t04]
      |                            ^~~~~~~~~~
In file included from backend_all.cc:89:
db_requests.h: In member function ‘void AuthAcctLogin_AcctQuery::operator()(pqxx::transactor<>::argument_type&)’:
db_requests.h:256:21: error: ‘field’ is not a member of ‘pqxx::result’
  256 |       pqxx::result::field F = R[0]["hash"];
      |                     ^~~~~
db_requests.h:258:18: error: ‘F’ was not declared in this scope
  258 |       if (strlen(F.c_str()) != 40) {
      |                  ^
db_requests.h:262:20: error: ‘F’ was not declared in this scope
  262 |       memcpy(hash, F.c_str(), 41);
      |                    ^

/snip - the entire output is too long for the forum

pqxx deprecated pqxx::result::field a while ago, and then removed it.

I changed all occurrences of pqxx::result::field to pqxx::field

pqxx 6.4.5 has deprecated Transactor, so expect this to become an error in the future.


For creating manifests and such, I recommend using the UruManifest utility at https://github.com/Hoikas/UruManifest. I received warnings from MOSS when I followed the SDL file location advice in the README.md file, but it is very trivial to move the SDLs into the directory structure recommended in the MOSS in-tree "setup" document if you like. MOSS still works, either way you do it. I just dislike seeing warnings and errors. :-)

You can also use the old in-tree ManifestCreator tool to generate the manifests, but the UruManifest tool is vastly superior. The UruManifest tool also has the added advantage that it also generates manifests for the H'uru dirtsand server, so it is basically a "one stop shop" for generating manifests, no matter which server you decide to use.

Note to OU staff: You can remove my ManifestCreator tool from the MOSS tree and update the instructions to send users to UruManifest, if you want. The ManifestCreator tool was sufficient at the time, but it is written in an obscure language and will not be receiving any updates.

Happy Uru-ing!
User avatar
Hoikas
Member
Posts: 344
Joined: Fri Jun 03, 2011 8:38 pm

Re: MOSS and Ubuntu 20.04

Post by Hoikas »

I don’t use MOSS, but those code changes all look correct and should probably be committed to the repository.
Image
cjkelly1
Member
Posts: 67
Joined: Mon Dec 29, 2008 6:08 am

Re: MOSS and Ubuntu 20.04

Post by cjkelly1 »

MOSS repo forked on OU gitblit and changes placed into "UpdatesForUbuntu" branch, for easy merging if OU management decides the changes are acceptable.
User avatar
rarified
Member
Posts: 1061
Joined: Tue Dec 16, 2008 10:48 pm
Location: Colorado, US

Re: MOSS and Ubuntu 20.04

Post by rarified »

Just catching up on the forums now, and finishing updating the VS2010 build process for CWE.

I'll look in a day or two. It's not ignored. 8-)

_R
One of the OpenUru toolsmiths... a bookbinder.
cjkelly1
Member
Posts: 67
Joined: Mon Dec 29, 2008 6:08 am

Re: MOSS and Ubuntu 20.04

Post by cjkelly1 »

rarified wrote: Tue Dec 29, 2020 10:43 pm Just catching up on the forums now, and finishing updating the VS2010 build process for CWE.

I'll look in a day or two. It's not ignored. 8-)

_R
No worries and no hurry. I had just posted in case someone might be trying to compile under Ubuntu, run into errors, and swing by here in search of help.
cjkelly1
Member
Posts: 67
Joined: Mon Dec 29, 2008 6:08 am

Re: MOSS and Ubuntu 20.04

Post by cjkelly1 »

Any possibility of somehow adding review/comment functionality to the OU gitblit? Being able to submit something as a PR and get reviews, suggestions, comments, criticisms, etc. would be handy. The forum works, but has the disadvantage of not being tied to the potential code changes.
User avatar
rarified
Member
Posts: 1061
Joined: Tue Dec 16, 2008 10:48 pm
Location: Colorado, US

Re: MOSS and Ubuntu 20.04

Post by rarified »

cjkelly1 wrote: Sun Jan 10, 2021 3:51 am Any possibility of somehow adding review/comment functionality to the OU gitblit? Being able to submit something as a PR and get reviews, suggestions, comments, criticisms, etc. would be handy. The forum works, but has the disadvantage of not being tied to the potential code changes.
I started looking at that -- there are supposed to be hooks to do that. I haven't found them yet. And if it is a linkage to another service, I may have to point it at the Fisheye browser.

_R
One of the OpenUru toolsmiths... a bookbinder.
Post Reply

Return to “MOSS”