polybar / polybar

A fast and easy-to-use status bar
https://polybar.github.io
MIT License
14.21k stars 711 forks source link

internal compiler error: in convert_nontype_argument, at cp/pt.c:6827 #806

Closed aejenk closed 7 years ago

aejenk commented 7 years ago

I dunno what I did wrong here, but for some reason, when I try to build polybar now I keep getting this error:

[  9%] Building CXX object bin/CMakeFiles/polybar.dir/components/bar.cpp.o
In file included from /home/textman/polybar/lib/xpp/include/xpp/proto/../generic.hpp:11:0,
                 from /home/textman/polybar/lib/xpp/include/xpp/proto/x.hpp:9,
                 from /home/textman/polybar/lib/xpp/include/xpp/event.hpp:9,
                 from /home/textman/polybar/include/x11/types.hpp:3,
                 from /home/textman/polybar/include/components/bar.hpp:12,
                 from /home/textman/polybar/src/components/bar.cpp:3:
/home/textman/polybar/lib/xpp/include/xpp/proto/../generic/reply_iterator.hpp:22:53: internal compiler error: in convert_nontype_argument, at cp/pt.c:6827
   xpp::generic::signature<int (const void *), SizeOf>
                                                     ^
/home/textman/polybar/lib/xpp/include/xpp/proto/../generic/reply_iterator.hpp:61:16: note: in expansion of macro ‘SIZEOF_SIGNATURE’

This happens both when xcb-proto was 1.12, and 1.11. xcb-randr is also at 1.11.1, but this error also popped up when it was 1.12.

patrick96 commented 7 years ago

Can you give us some more info. What OS are you running (and what version) Which version of polybar are you trying to compile? Against HEAD or 3.0.5?

aejenk commented 7 years ago

@patrick96 I'm running Ubuntu Zesty, and I believe I'm trying to build v3.0.5, because that's the one I'm currently using, and I haven't upgraded it since then. I'm only trying to recompile it because of xcb-util-xrm, to make it compatible with pywal.

patrick96 commented 7 years ago

You can figure out against which commit you are compiling by running

git describe --all --long

There are a few problems when compiling version 3.0.5 on Ubuntu 17.04. First gcc most likely won't work so you have to tell cmake to compile with clang like this:

cmake -DCMAKE_C_COMPILER="clang" -DCMAKE_CXX_COMPILER="clang++" ..

You also need to make sure that both packages xcb-proto and libxcb-randr0-dev are on the same version (preferrably 1.12). To make sure that is the case run

pkg-config --modversion xcb-randr 
pkg-config --modversion xcb-proto 

If you compiled with clang and have both xcb-randr and xcb-proto on 1.12 and it still doesn't work, please post the whole output of the cmake and make command

EDIT: Having both on version 1.11 should work too. See here for how to downgrade xcb-proto to 1.11

aejenk commented 7 years ago

here's the version of the commit : tags/3.0.5-0-g4e2e2a7

Also, libxcb-randr0-dev is on 1.11.1, while xcb-proto is on 1.11, does that mean they're on the same versions, or should I just upgrade to 1.12?

I was compiling using the build.sh script, so I'm not used to cmake, however I went into the polybar/build directory and ran the command you gave me, but it returned another error which was this...

[textman@Tojopad420:~]$ cd polybar/build/
[textman@Tojopad420:~/polybar/build]$ cmake -DCMAKE_C_COMPILER="clang" -DCMAKE_CXX_COMPILER="clang++" ..
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:6 (project):
  The CMAKE_C_COMPILER:

    clang

  is not a full path and was not found in the PATH.

  Tell CMake where to find the compiler by setting either the environment
  variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
  the compiler, or to the compiler name if it is in the PATH.

CMake Error at CMakeLists.txt:6 (project):
  The CMAKE_CXX_COMPILER:

    clang++

  is not a full path and was not found in the PATH.

  Tell CMake where to find the compiler by setting either the environment
  variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.

-- Configuring incomplete, errors occurred!
See also "/home/textman/polybar/CMakeFiles/CMakeOutput.log".
See also "/home/textman/polybar/CMakeFiles/CMakeError.log".

I tried installing clang-3.8 on it, and it still showed that error. The output of make was the same as in the original post too.

patrick96 commented 7 years ago

I think you should leave both at 1.11, I don't think there is a 1.12 version of libxcb-randr0-dev

You probably need the clang package which provides the latest clang version, then the cmake command should work

aejenk commented 7 years ago

Installed clang-4.0, which is the latest that I found, still ended up with problems. Here are all the commands that I ran, along with me showing that I have both clang-4.0 and clang++-4.0, just in case I'm either doing something wrong, or it'll help you out:

[textman@Tojopad420:~]$ cd polybar/build/
[textman@Tojopad420:~/polybar/build]$ sudo cmake -DCMAKE_C_COMPILER="clang" -DCMAKE_CXX_COMPILER="clang++" ..
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
CMake Error at CMakeLists.txt:6 (project):
  The CMAKE_C_COMPILER:

    clang

  is not a full path and was not found in the PATH.

  Tell CMake where to find the compiler by setting either the environment
  variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
  the compiler, or to the compiler name if it is in the PATH.

CMake Error at CMakeLists.txt:6 (project):
  The CMAKE_CXX_COMPILER:

    clang++

  is not a full path and was not found in the PATH.

  Tell CMake where to find the compiler by setting either the environment
  variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.

-- Configuring incomplete, errors occurred!
See also "/home/textman/polybar/CMakeFiles/CMakeOutput.log".
See also "/home/textman/polybar/CMakeFiles/CMakeError.log".
[textman@Tojopad420:~/polybar/build]$ clang
clang-4.0                     clang-change-namespace-4.0    clang-cpp-4.0                 clang-offload-bundler-4.0     clang-reorder-fields-4.0      
clang++-4.0                   clang-check-4.0               clang-import-test-4.0         clang-query-4.0               clang-tblgen-3.8              
clang-apply-replacements-4.0  clang-cl-4.0                  clang-include-fixer-4.0       clang-rename-4.0              clang-tblgen-4.0              
[textman@Tojopad420:~/polybar/build]$
aejenk commented 7 years ago

Oh, and I did managed to get a 1.12 version of xcb-randr by installing libxcb-1.12, however even with both of them at 1.12, the error popped up.

Should I remove the commit and download the latest version, just in case?

patrick96 commented 7 years ago

The package you need is just called clang NOT clang-4.0, clang provides the /usr/bin/clang executable and will also pull in clang-4.0 as a dependency.

Where did you find libxcb-1.12? I don't see it in the repositories.

You can try to compile against the newest commit and see if that works.

aejenk commented 7 years ago

AH, I'm dumb. I'll give that a shot.

I also found libxcb-1.12 from this link : http://www.linuxfromscratch.org/blfs/view/svn/x/libxcb.html It worked well when I built it, it also linked to xcb-proto 1.12.

aejenk commented 7 years ago

Okay it worked well! Built with xcb-util-xrm support! Thanks!

patrick96 commented 7 years ago

Great!

coquizen commented 7 years ago

As a note, patrick96's suggestion to sync up versions for xcb-proto and xcb-randr as well as using clang instead works on Debian Buster.