Skip to content
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

Jansson dependency #5050

Closed
susnux opened this issue Jan 11, 2017 · 6 comments
Closed

Jansson dependency #5050

susnux opened this issue Jan 11, 2017 · 6 comments
Assignees
Labels
build Pertains to compilation, language standard, external dependencies.

Comments

@susnux
Copy link
Contributor

susnux commented Jan 11, 2017

The readme and the wiki says that jannson >= 2.3 is required.
But trying 2.3 (openSUSE 13.1 ships only 2.3.1) it does not compile.

First error: Invalid conversion from const json_t* to json_t*
In src/network/http.cpp args->request.body = json_deep_copy(request->body);
Jansson 2.3 only supports json_deep_copy(json_t*).
This only works with jansson >= 2.5 (or a const_cast).

Second error:

src/interface/Theme.cpp:379:102: error: 'json_boolean' was not declared in this scope json_object_set_new(jsonTheme, "useLightsRide", json_boolean(Flags & UITHEME_FLAG_USE_LIGHTS_RIDE));

json_boolean first appeared in 2.4.

So either 2.4 is required with a const_cast addressing issue 1, e.g.

#if JANSSON_VERSION_HEX < 0x020500
       args->request.body = json_deep_copy(const_cast<json_t*>(request->body));
#endif

Or 2.5 or later is required (no changes).

@janisozaur
Copy link
Member

@susnux thanks for you report. Do you want to fix it for 2.4? If not, I'll up the required version to 2.5.

@janisozaur janisozaur self-assigned this Jan 11, 2017
@janisozaur janisozaur added the build Pertains to compilation, language standard, external dependencies. label Jan 11, 2017
@janisozaur
Copy link
Member

On second thought, I'll just update the version to 2.5.

I only lowered it because we used to use 2.7, which introduced a macro json_boolean_value was used and it turned out it was an easy fix, which allowed me to use Ubuntu 14.04's package, which was either at 2.5 or 2.6.

Since then we've moved to building on 16.04 using docker. Arch jobs also have much more recent jansson version.

@susnux
Copy link
Contributor Author

susnux commented Jan 11, 2017

Yes I also think this is the best solution since I can not make sure it will work 100% with 2.4.

@janisozaur
Copy link
Member

@susnux are you by any chance handling https://build.opensuse.org/package/show/games/openrct2 ?

Regarding chosen solution: we do intend to use progressively more of modern C++'s features and supporting old platforms comes at a cost to maintenance. Isn't openSUSE 13.1 obsolete by now? I thought it was at ~42 as of these days.

@susnux
Copy link
Contributor Author

susnux commented Jan 11, 2017

Yes I am an openSUSE:games maintainer, 0.0.5 is on its way into the openSUSE repositories ;-)

And yes 13.1 is quite old, but there are still some users (LTS version) so I always try to get packages run on as much versions as possible, if not (as in this case) then not, but I do my best.

@janisozaur
Copy link
Member

@susnux nice. Most of our users are expected to be running a current version of develop, we continuously push fresh builds to https://openrct2.org/downloads. They are, as already mentioned, built on Ubuntu 16.04. Can you comment on their ABI compatibility with openSUSE 42?

We have a semi-supported PPA for deb-based systems and Arch (my distro) has https://aur.archlinux.org/packages/openrct2-git. Any chance of having similar package for your system?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Pertains to compilation, language standard, external dependencies.
Projects
None yet
Development

No branches or pull requests

2 participants