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

gcc-10 / clang-10 compatibility break #119

Open
Buom01 opened this issue Dec 18, 2020 · 3 comments
Open

gcc-10 / clang-10 compatibility break #119

Buom01 opened this issue Dec 18, 2020 · 3 comments

Comments

@Buom01
Copy link
Member

Buom01 commented Dec 18, 2020

Hi,

I noticed a time ago that the repo doesn't build with GCC 10. As it's really difficult to have both gcc-10 and gcc-9 on a single Linux distro, I'm looking for a reliable solution for everyone.


I thought about updating the code. Beginning by sol2 library, and as they said (here: https://sol2.readthedocs.io/en/latest/tutorial/getting-started.html ):

If you get an avalanche of errors (particularly referring to auto), you may not have enabled C++14 / C++17 mode for your compiler. Add one of std=c++17, std=c++1z OR std=c++1y to your compiler options. [...]

-std=c++1* is required (doesn't compile else, according to my tests).

As I didn't learn enough C++ (I will learn it soon at school), I'm not sure nor fine about all conversion that -std=c++17 and gcc-10 implies to other parts of code. I think that (as the make output said) it would need a some boring updates/changes in the code. Which may be long to do properly, and could make some things harder to import from forks.


Finally, I think that nobody would make too many changes to an old project while, in a way, Stellar-Prey aim to drop compatibility and could make maintenance and programming a lot easier.
For now, I'm thinking a Docker container with gcc-9 is the quickest solution for development and doesn't require any changes.

(It would look like docker run -ti -v $(pwd):/anywhere mymakecontainer and could be aliased for easier dev purpose. It could also take arguments but maybe not environment variable without explicit -e argument.)


So my question would be, how to handle GCC 10 ? What is the best approach ?

@wtfbbqhax
Copy link
Member

@Buom01 if the issue is simply with --std=c++1y we can update that as appropriate.

Is there also an issue with sol2?

@wtfbbqhax
Copy link
Member

FWIW, I think we should fix the build to work with the latest compiler toolchains in rotation-

@Buom01
Copy link
Member Author

Buom01 commented Apr 28, 2021

Sorry for the late reply.
I learned a lot more in C++ since, but I don't think to solve this issue nor the Makefile myself currently.
Building with the documented Docker's container work quite well enough at least as a temporary solution. (https://github.com/GrangerHub/tremulous#how-to-build-for-win64)

Is there also an issue with sol2?

Not really, I just failed to do a basic upgrade of it. As it may need tweaks to work with gcc-10 (or with the entire project)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants