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

Failing to compile on Linux #35041

Closed
MilosRasic opened this issue Oct 26, 2019 · 2 comments · Fixed by #35063
Closed

Failing to compile on Linux #35041

MilosRasic opened this issue Oct 26, 2019 · 2 comments · Fixed by #35063
Labels
Code: Build Issues regarding different builds and build environments OS: Linux Issues related to Linux operating system

Comments

@MilosRasic
Copy link
Contributor

MilosRasic commented Oct 26, 2019

Describe the bug

Latest master fails to compile on Linux with the following output:

milosrasic@linux-w1h8:~/Cataclysm-DDA> make -j4 CLANG=1 CCACHE=1 NATIVE=linux64 RELEASE=1 TILES=1 SOUND=1 LOCALIZE=0 CLANG=1 CCACHE=1 USE_HOME_DIR=1
astyle -V: Artistic Style Version 3.1
#define VERSION "0.D-8819-gee41a78b03"
CCACHE_CPP2=1 ccache clang++ -ffast-math -Os -Werror -Wall -Wextra -Wmissing-declarations -Wold-style-cast -Woverloaded-virtual -Wpedantic -fsigned-char -std=c++14 -MMD -MP -m64 -I/usr/include/SDL2 -D_REENTRANT -DSDL_SOUND -I/usr/include/SDL2 -D_REENTRANT -I/usr/include/SDL2 -D_REENTRANT -I/usr/include/SDL2 -D_REENTRANT -DCATA_IN_TOOL -Itools/format -Isrc \
  tools/format/format.cpp src/json.cpp -o tools/format/json_formatter.cgi
no astyle regressions
CCACHE_CPP2=1 ccache clang++  -DRELEASE -DGIT_VERSION -DTILES -DBACKTRACE -DUSE_HOME_DIR -ffast-math -Os -Werror -Wall -Wextra -Wmissing-declarations -Wold-style-cast -Woverloaded-virtual -Wpedantic -fsigned-char -std=c++14 -MMD -MP -m64 -I/usr/include/SDL2 -D_REENTRANT -DSDL_SOUND -I/usr/include/SDL2 -D_REENTRANT -I/usr/include/SDL2 -D_REENTRANT -I/usr/include/SDL2 -D_REENTRANT -c src/action.cpp -o obj/tiles/action.o
CCACHE_CPP2=1 ccache clang++  -DRELEASE -DGIT_VERSION -DTILES -DBACKTRACE -DUSE_HOME_DIR -ffast-math -Os -Werror -Wall -Wextra -Wmissing-declarations -Wold-style-cast -Woverloaded-virtual -Wpedantic -fsigned-char -std=c++14 -MMD -MP -m64 -I/usr/include/SDL2 -D_REENTRANT -DSDL_SOUND -I/usr/include/SDL2 -D_REENTRANT -I/usr/include/SDL2 -D_REENTRANT -I/usr/include/SDL2 -D_REENTRANT -c src/active_item_cache.cpp -o obj/tiles/active_item_cache.o
CCACHE_CPP2=1 ccache clang++  -DRELEASE -DGIT_VERSION -DTILES -DBACKTRACE -DUSE_HOME_DIR -ffast-math -Os -Werror -Wall -Wextra -Wmissing-declarations -Wold-style-cast -Woverloaded-virtual -Wpedantic -fsigned-char -std=c++14 -MMD -MP -m64 -I/usr/include/SDL2 -D_REENTRANT -DSDL_SOUND -I/usr/include/SDL2 -D_REENTRANT -I/usr/include/SDL2 -D_REENTRANT -I/usr/include/SDL2 -D_REENTRANT -c src/activity_handlers.cpp -o obj/tiles/activity_handlers.o
CCACHE_CPP2=1 ccache clang++  -DRELEASE -DGIT_VERSION -DTILES -DBACKTRACE -DUSE_HOME_DIR -ffast-math -Os -Werror -Wall -Wextra -Wmissing-declarations -Wold-style-cast -Woverloaded-virtual -Wpedantic -fsigned-char -std=c++14 -MMD -MP -m64 -I/usr/include/SDL2 -D_REENTRANT -DSDL_SOUND -I/usr/include/SDL2 -D_REENTRANT -I/usr/include/SDL2 -D_REENTRANT -I/usr/include/SDL2 -D_REENTRANT -c src/activity_item_handling.cpp -o obj/tiles/activity_item_handling.o
In file included from src/json.cpp:1:
src/json.h:786:14: error: private field 'reported_unvisited_members' is not used [-Werror,-Wunused-private-field]
        bool reported_unvisited_members = false;
             ^
1 error generated.
make: *** [Makefile:1044: json_formatter] Error 1
make: *** Waiting for unfinished jobs....
^[[A^[[B^Cmake: *** [Makefile:792: obj/tiles/activity_handlers.o] Interrupt
make: *** [Makefile:792: obj/tiles/action.o] Interrupt
make: *** [Makefile:792: obj/tiles/activity_item_handling.o] Interrupt

milosrasic@linux-w1h8:~/Cataclysm-DDA> make -j4 CLANG=1 CCACHE=1 NATIVE=linux64 RELEASE=1 TILES=1 SOUND=1 LOCALIZE=0 CLANG=1 CCACHE=0 USE_HOME_DIR=1
astyle -V: Artistic Style Version 3.1
CCACHE_CPP2=1 ccache clang++ -ffast-math -Os -Werror -Wall -Wextra -Wmissing-declarations -Wold-style-cast -Woverloaded-virtual -Wpedantic -fsigned-char -std=c++14 -MMD -MP -m64 -I/usr/include/SDL2 -D_REENTRANT -DSDL_SOUND -I/usr/include/SDL2 -D_REENTRANT -I/usr/include/SDL2 -D_REENTRANT -I/usr/include/SDL2 -D_REENTRANT -DCATA_IN_TOOL -Itools/format -Isrc \
  tools/format/format.cpp src/json.cpp -o tools/format/json_formatter.cgi
no astyle regressions
CCACHE_CPP2=1 ccache clang++  -DRELEASE -DGIT_VERSION -DTILES -DBACKTRACE -DUSE_HOME_DIR -ffast-math -Os -Werror -Wall -Wextra -Wmissing-declarations -Wold-style-cast -Woverloaded-virtual -Wpedantic -fsigned-char -std=c++14 -MMD -MP -m64 -I/usr/include/SDL2 -D_REENTRANT -DSDL_SOUND -I/usr/include/SDL2 -D_REENTRANT -I/usr/include/SDL2 -D_REENTRANT -I/usr/include/SDL2 -D_REENTRANT -c src/action.cpp -o obj/tiles/action.o
CCACHE_CPP2=1 ccache clang++  -DRELEASE -DGIT_VERSION -DTILES -DBACKTRACE -DUSE_HOME_DIR -ffast-math -Os -Werror -Wall -Wextra -Wmissing-declarations -Wold-style-cast -Woverloaded-virtual -Wpedantic -fsigned-char -std=c++14 -MMD -MP -m64 -I/usr/include/SDL2 -D_REENTRANT -DSDL_SOUND -I/usr/include/SDL2 -D_REENTRANT -I/usr/include/SDL2 -D_REENTRANT -I/usr/include/SDL2 -D_REENTRANT -c src/activity_handlers.cpp -o obj/tiles/activity_handlers.o
CCACHE_CPP2=1 ccache clang++  -DRELEASE -DGIT_VERSION -DTILES -DBACKTRACE -DUSE_HOME_DIR -ffast-math -Os -Werror -Wall -Wextra -Wmissing-declarations -Wold-style-cast -Woverloaded-virtual -Wpedantic -fsigned-char -std=c++14 -MMD -MP -m64 -I/usr/include/SDL2 -D_REENTRANT -DSDL_SOUND -I/usr/include/SDL2 -D_REENTRANT -I/usr/include/SDL2 -D_REENTRANT -I/usr/include/SDL2 -D_REENTRANT -c src/activity_item_handling.cpp -o obj/tiles/activity_item_handling.o
In file included from src/json.cpp:1:
src/json.h:786:14: error: private field 'reported_unvisited_members' is not used [-Werror,-Wunused-private-field]
        bool reported_unvisited_members = false;
             ^
1 error generated.

Was compiling the latest code on this machine for a year now without issues. Also tried without CCACHE and got the same issue.

Tried to comment out reported_unvisited_members in json.h but then compilation failed when it ran into the use of reported_unvisited_members in json.cpp. Looks like astyle or clang might be getting confused by #ifndef CATA_IN_TOOL in json.cpp.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Clone the repo or pull from master on a Linux
  2. make -j4 CLANG=1 CCACHE=1 NATIVE=linux64 RELEASE=1 TILES=1 SOUND=1 LOCALIZE=0 CLANG=1 CCACHE=1 USE_HOME_DIR=1

Expected behavior

Latest master compiles on Linux.

Versions and configuration

Can't generate this in-game because compilation fails and the old binary I have crashes with the latest master.

  • OS: OpenSUSE Tumbleweed
  • Game Version: latest master, commit ee41a78
  • Graphics version: Tiles
  • Mods loaded: N/A

Additional context

clang 8.0.1
ccache 3.7.3
astyle 3.1
cmake 3.15.3

@ZhilkinSerg
Copy link
Contributor

Try running with LINTJSON=0

@molkero
Copy link
Contributor

molkero commented Oct 26, 2019

Had the same issue, disabling clang helped.

@ZhilkinSerg ZhilkinSerg added Code: Build Issues regarding different builds and build environments OS: Linux Issues related to Linux operating system labels Oct 26, 2019
ZhilkinSerg added a commit that referenced this issue Oct 26, 2019
KorGgenT pushed a commit that referenced this issue Oct 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Code: Build Issues regarding different builds and build environments OS: Linux Issues related to Linux operating system
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants