jnewing / anope

Anope IRC Services
https://www.anope.org
0 stars 0 forks source link

M_Json as 3pty module #2

Closed ahopelesshadow closed 4 months ago

ahopelesshadow commented 4 months ago

This may be more of a question than a bug, but I am having some troubles with running your m_json build. I should also note, I am by no means a master at anope or know all of its features/capabilities, but have installed it a few times. At first I tried just installing it straight from your git, and that compiled and installed, but the json module was not viewable to anope at all. and /api was not useable after i enabled the httpd module in the config. I then did a little research and realized that in order to make anope with 3rd pty modules, those files must be in a third directory. I attempted doing that and it hangs at a dependency for #include <nlohmann/json.hpp> after a bit of googleing i tried sudo apt install nlohmann-json-dev, and after trying to make again, i got even more errors. I also assume that by moving these files into a third directory, that will break paths somehow. Is there anyway you can provide a bit more guidance on this or update the readme on how to use your module until auth is added in 2.1? Not that it matters but I also tried updating your branch with the latest 2.x from anope official.

jnewing commented 4 months ago

**

This module does require the nlohmann/json C++ library, and Anope to be compiled using C++17.

**

Yes you are correct you do need the nlohmann/json hpp file and installing via the debian or ubuntu package is fine, however when compile anope you you must tell your compiler to use at least C++17. This flag will vary depending on the compiler you use. I guess also make sure you're checking out the proper m_json branch.

If using cmake try something like cmake -CMAKE_CXX_FLAGS="-std=c++17"

ahopelesshadow commented 4 months ago

**

This module does require the nlohmann/json C++ library, and Anope to be compiled using C++17.

**

Yes you are correct you do need the nlohmann/json hpp file and installing via the debian or ubuntu package is fine, however when compile anope you you must tell your compiler to use at least C++17. This flag will vary depending on the compiler you use. I guess also make sure you're checking out the proper m_json branch.

If using cmake try something like cmake -CMAKE_CXX_FLAGS="-std=c++17"

Looks like sudo apt install cmake was also grabbing a rather old version, installed the latest from kitware git, and added -dcmake_cxx_flags="-std=c++17" as you instructed to my ./Config during setup,

there was a typo in my apt command above, and for anyone else that reads this, the correct call is sudo apt install nlohmann-json3-dev

Beyond that I edited the modules to have them all in a /third directory and install them officially, and finally added the lines to modules.example.conf after enabling httpd, and successfully got this working.

I havnt done alot of testing other than dropping random peoples nicks using an authenticated oper nick. Im hoping I can also register a new nick, but need to figure out how to I would authenticate to get the ticket to do that. Closing this issue however.