No rule exists for the target "/protocols/presentation-time.xml", ...
#1
Hi,

I'm trying to build kodi for wayland on a raspberry 4 running Manjaro Linux.
While the build for X11 was rather easy, this one ends in some crude error messages.

git clone git://github.com/xbmc/xbmc.git kodi-wayland
cd $HOME/kodi-wayland

sudo make -C tools/depends/target/crossguid PREFIX=/usr/local
sudo make -C tools/depends/target/flatbuffers PREFIX=/usr/local
sudo make -C tools/depends/target/libfmt PREFIX=/usr/local
sudo make -C tools/depends/target/wayland-protocols PREFIX=/usr/local
sudo make -C tools/depends/target/waylandpp PREFIX=/usr/local

cd $HOME/kodi-build
cmake ../kodi-wayland -DCMAKE_INSTALL_PREFIX=/usr/local -DCORE_PLATFORM_NAME=wayland -DWAYLAND_RENDER_SYSTEM=gl -DENABLE_INTERNAL_FSTRCMP=1
cmake --build . -- VERBOSE=1 -j$(getconf _NPROCESSORS_ONLN)


First error is:

/usr/bin/ld.gold: error: cannot find -lpthreads
CMakeFiles/cmTC_03fdb.dir/CheckFunctionExists.c.o:CheckFunctionExists.c:function main: error: undefined reference to 'pthread_create'


when re-running the build, another error (probably a subsequent one) comes up:

No rule exists for the target "/protocols/presentation-time.xml",
   needed to create from "wayland-extra-protocols.hpp"

I'm somewhat confused ... somewhere I read pthreads (note the tailing "s") was not available on Linux
Reply
#2
(2019-09-30, 13:03)klaeuser Wrote: First error is:

/usr/bin/ld.gold: error: cannot find -lpthreads
CMakeFiles/cmTC_03fdb.dir/CheckFunctionExists.c.o:CheckFunctionExists.c:function main: error: undefined reference to 'pthread_create'
This is not an error, its part of the tests cmake does in order to find threads, its expected on linux.
Provide full output of cmake via pastebin site.
Reply
#3
(2019-09-30, 13:55)asavah Wrote:
(2019-09-30, 13:03)klaeuser Wrote: First error is:

/usr/bin/ld.gold: error: cannot find -lpthreads
CMakeFiles/cmTC_03fdb.dir/CheckFunctionExists.c.o:CheckFunctionExists.c:function main: error: undefined reference to 'pthread_create'
This is not an error, its part of the tests cmake does in order to find threads, its expected on linux.
Provide full output of cmake via pastebin site. 



CMakeOutput.log

https://paste.kodi.tv/ejabixalot


CMakeError.log

https://paste.kodi.tv/wigisosohi
Reply
#4
(2019-10-01, 09:52)klaeuser Wrote:
(2019-09-30, 13:55)asavah Wrote:
(2019-09-30, 13:03)klaeuser Wrote: First error is:

/usr/bin/ld.gold: error: cannot find -lpthreads
CMakeFiles/cmTC_03fdb.dir/CheckFunctionExists.c.o:CheckFunctionExists.c:function main: error: undefined reference to 'pthread_create'
This is not an error, its part of the tests cmake does in order to find threads, its expected on linux.
Provide full output of cmake via pastebin site.   



CMakeOutput.log

https://paste.kodi.tv/ejabixalot


CMakeError.log

https://paste.kodi.tv/wigisosohi  


I am not sure if the logs contain meaningful stuff (so much experimenting with them), so I just got the sources again and started a new build.

CMakeOutput.log:

https://paste.kodi.tv/aqutosoyuf


CMakeError.log:

https://paste.kodi.tv/voboyivugi


and the console output:

https://paste.kodi.tv/yujehavula
Reply
#5
(2019-10-01, 10:33)klaeuser Wrote:
(2019-10-01, 09:52)klaeuser Wrote:
(2019-09-30, 13:55)asavah Wrote: This is not an error, its part of the tests cmake does in order to find threads, its expected on linux.
Provide full output of cmake via pastebin site.   



CMakeOutput.log

https://paste.kodi.tv/ejabixalot


CMakeError.log

https://paste.kodi.tv/wigisosohi    


I am not sure if the logs contain meaningful stuff (so much experimenting with them), so I just got the sources again and started a new build.

CMakeOutput.log:

https://paste.kodi.tv/aqutosoyuf


CMakeError.log:

https://paste.kodi.tv/voboyivugi


and the console output:

https://paste.kodi.tv/yujehavula  

hmmm ... the last line of the console output is missing. This is strange ... isn't it written to stdout or stderr?
Anyway - make ends up with that line:

make: *** [Makefile:141: all] Fehler 2
Reply
#6
Hmm I can't see what fails in the console output.
Try building with one job (not parallel), so it stops right where it fails. 
Code:
cmake --build . -- VERBOSE=1 -j1
Reply
#7
(2019-10-01, 13:34)asavah Wrote: Hmm I can't see what fails in the console output.
Try building with one job (not parallel), so it stops right where it fails. 
Code:
cmake --build . -- VERBOSE=1 -j1

ok, new attempt.

CMakeOutput.log:

https://paste.kodi.tv/epasasopup

CMakeError.log:

https://paste.kodi.tv/kivuxajuzu


and the console output:

https://paste.kodi.tv/aqowijibun


Unfortunately, this does not look much more informative either.

Hopefully I catched the whole console output!
I'm redirecting stdout and stderr to a file with tee -a logfile 2>&1, but (especially at the end of the logfile there are often some lines missing). It looks like they were written to another channel ...
I pasted the missing lines at the end of the console log - just to be complete... and hopefully I forgot nothing
Reply
#8
I suppose there's something wrong with that file:

~/kodi-build/CMakeFiles/generate-wayland-extra-protocols.dir/build.make

     58
     59 wayland-extra-protocols.hpp: /usr/local/bin/wayland-scanner++
     60 wayland-extra-protocols.hpp: /protocols/presentation-time.xml
     61 wayland-extra-protocols.hpp: /protocols/xdg-shell.xml

     62 wayland-extra-protocols.hpp: //usr/share/wayland-protocols/unstable/xdg-shell/xdg-shell-unstable-v6.xml
     63 wayland-extra-protocols.hpp: //usr/share/wayland-protocols/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml 
     

I'm completely new to cmake, but the directory /protocols does not exist.
You can find presentation-time.xml and xdg-shell.xml in these directories:

find ~ -name presentation-time.xml

./kodi-wayland/tools/depends/target/waylandpp/native/protocols/presentation-time.xml
./kodi-wayland/tools/depends/target/wayland-protocols/native/stable/presentation-time/presentation-time.xml

find ~ -name xdg-shell.xml

./kodi-wayland/tools/depends/target/waylandpp/native/protocols/xdg-shell.xml
./kodi-wayland/tools/depends/target/wayland-protocols/native/stable/xdg-shell/xdg-shell.xml

looks like the prefix was missing ... for what reason ever
Reply
#9
this might be the problem (or one of the problems):

./kodi-wayland/cmake/scripts/linux/ExtraTargets.cmake (20):

set(PROTOCOL_XMLS "${WAYLANDPP_PROTOCOLS_DIR}/presentation-time.xml"
"${WAYLANDPP_PROTOCOLS_DIR}/xdg-shell.xml" "${WAYLAND_PROTOCOLS_DIR}/unstable/xdg-shell/xdg-shell-unstable-v6.xml" "${WAYLAND_PROTOCOLS_DIR}/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml")


WAYLANDPP_PROTOCOLS_DIR is set here

~/kodi-wayland/cmake/modules/FindWaylandpp.cmake (34):

# Promote to cache variables so all code can access it set(WAYLANDPP_PROTOCOLS_DIR "${PC_WAYLANDPP_PKGDATADIR}/protocols" CACHE INTERNAL "")

obviously PC_WAYLANDPP_PKGDATADIR is not set and therefore WAYLANDPP_PROTOCOLS_DIR equals to "/protocols"


PC_WAYLANDPP_PKGDATADIR is filled in the same file (line 15), but only if PC_WAYLANDPP-FOUND is set

if(PC_WAYLANDPP_FOUND)
pkg_get_variable(PC_WAYLANDPP_PKGDATADIR wayland-client++ pkgdatadir)
endif()


Obviously PC_WAYLANDPP_FOUND is not set or this pkg_get_variable function does not return a correct value.

At the moment I have no idea where PC_WAYLANDPP_FOUND comes from. It was nice to have a possibility to dump all these variables ...
Reply
#10
somehow I'm talking to myself ...  Smile

Found a very useful cmake function called variable_watch() - this is exactly what I need!

Added two lines at the top of CMakeLists.txt:

variable_watch(WAYLANDPP_PROTOCOLS_DIR)                                             variable_watch(PC_WAYLANDPP_PKGDATADIR)

... and that gives us some very interresting information:


/usr/share/cmake-3.15/Modules/FindPkgConfig.cmake(728):  set(PC_WAYLANDPP_PKGDATADIR
  PARENT_SCOPE )
   Called from:   [5] /usr/share/cmake-3.15/Modules/FindPkgConfig.cmake
                  [4] /home/klaus/kodiwayland/cmake/modules/FindWaylandpp.cmake
                  [3] /home/klaus/kodi-wayland/cmake/scripts/common/Macros.cmake  
                  [2] /home/klaus/kodi-wayland/cmake/scripts/common/Macros.cmake  
                  [1] /home/klaus/kodi-wayland/CMakeLists.txt              
CMake Debug Log at /usr/share/cmake-3.15/Modules/FindPkgConfig.cmake:728 (set):  Variable "PC_WAYLANDPP_PKGDATADIR" was accessed using MODIFIED_ACCESS with value "".                                                                    

Call Stack (most recent call first):                                                  cmake/modules/FindWaylandpp.cmake:16 (pkg_get_variable)                           cmake/scripts/common/Macros.cmake:364 (find_package)
   cmake/scripts/common/Macros.cmake:380 (find_package_with_ver)                     CMakeLists.txt:167 (core_require_dep)
Reply
#11
OMG!
After days of debugging I finally found the problem.
An OS package (waylandpp) is missing.

The solution is quite simple:

pacman -S local/waylandpp

that's it!

Surely - Manjaro (and ARCH) Linux are not the most popular distributions, but similar things could happen on Debian/Ubuntu/Fedora/SuSe ... too.
This Check-Script (cmake/modules/FindWaylandpp.cmake) should urgently be improved!

From the error messages you can not necessarily recognize what's going on. 

The script does not give any hint that waylandpp is not available, but simply sets some variables (especially PC_WAYLANDPP_PKGDATADIR) to "" (empty string) - which in turn causes WAYLANDPP_PROTOCOLS_DIR to be set to a completely absurd value - which in turn leads to the error message:

  No rule exists for the target "/protocols/presentation-time.xml"

I'm not good enough with cmake to write a better check, but apparently these calls to pkg_check_modules are not sufficient to ensure waylandpp is available:

pkg_check_modules(PC_WAYLANDPP wayland-client++ wayland-egl++ wayland-cursor++ QUIET)
pkg_check_modules(PC_WAYLANDPP_SCANNER wayland-scanner++ QUIET)
Reply

Logout Mark Read Team Forum Stats Members Help
No rule exists for the target "/protocols/presentation-time.xml", ...0