Nheko-Reborn / mtxclient

Client API library for Matrix, built on top of libcurl
MIT License
40 stars 25 forks source link

Error while building on Archlinux #38

Closed MayeulC closed 4 years ago

MayeulC commented 4 years ago

This might be related to my config, or something else. In any case, I prefer to leave a written trace of it.

It happened on both my computers, that were both Archlinux "pet" installs dating from 2018. I tried replicating that issue in a docker container, to no avail, even when installing every packet that was on my system.

I am not sure what I did on one of my systems to fix it. It might have involved playing with ccache, pacman, makepkg.conf, LC_ALL, etc. But it now works.

I've been unable to replicate the fix on my other computer, so I instead symlinked /usr/include to /include. That's a dirty workaround, but I'm fine with it for now.


This is the configure output:

-- Configuring done
CMake Error in CMakeLists.txt:
  Imported target "Boost::iostreams" includes non-existent path

    "/include"

  in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:
  * The path was deleted, renamed, or moved to another location.
  * An install or uninstall procedure did not complete successfully.
  * The installation package was faulty and references files it does not
  provide.

CMake Error in CMakeLists.txt:
  Imported target "Boost::iostreams" includes non-existent path

    "/include"

  in its INTERFACE_INCLUDE_DIRECTORIES.  Possible reasons include:
  * The path was deleted, renamed, or moved to another location.
  * An install or uninstall procedure did not complete successfully.
  * The installation package was faulty and references files it does not
  provide.

Looking at the source, I find:

grep -R INTERFACE_INCLUDE .
./CMakeFiles/Export/lib/cmake/MatrixClient/MatrixClientTargets.cmake:  INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include;/usr/include"
./MatrixClientTargets.cmake:  INTERFACE_INCLUDE_DIRECTORIES "/home/user/mtxclient-aur/src/mtxclient-0.3.1/include;/usr/include"

Which leads me to think that _IMPORT_PREFIX is set to "". As I didn't successfully override it with -D and didn't want to resort to temporary hacks in the source tree, I settled on the symlink workaround.


I'm writing this to document my issue in case someone ever encounters something similar, but I am going to close it as "can't reproduce", since that's what I've basically been told in the Matrix room.