SuperFola / pataro

A generic and modular Roguelike game on top of libtcod - I'll be back soon, just need a break!
25 stars 3 forks source link

Fix CI #6

Closed SuperFola closed 3 years ago

SuperFola commented 3 years ago

The CI is downloading the 1.16 libtcod release and building it with scons on Ubuntu, and the CMakeLists includes tcod/include (which should be a symlink to tcod/src), thus it should find the include libtcod.hpp, but when building, it doesn't.

On Windows, the release isn't downloaded because wget and unzip are not present.

On macOS, libsdl is downloaded but the libtcod release isn't.

HexDecimal commented 3 years ago

Libtcod is being added to Vcpkg soon which could simplify the process of developing on multiple platforms.

HexDecimal commented 3 years ago

It might be better to use CMake with the most recent libtcod than SCons. CMake should be able to support linking and headers with fewer issues.

For Windows you'll usually have to use PowerShell for things like downloading. I recommended splitting your workflow steps into separate steps by platform.

CI can be a pain to debug. You can work on this on a seperate branch until CI passes, then rebase your commits afterwards so that your commit history isn't full of fixes.

I can try helping out with CI or I can modify libtcod's CMake scripts if needed. I'm mostly waiting on Vcpkg right now.

SuperFola commented 3 years ago

Thanks for the tips, I fixed the Windows CI (downloading libtcod as a zip and using it as is).

I'm now trying to fix it on Linux (using libtcod cmakelists with an add_subdirectory(tcod)), but it yields a cmake error (which I have reproduced on Linux):

CMake Error: File /home/runner/work/pataro/pataro/tcod/src/LibtcodConfig.cmake.in does not exist.
CMake Error at /usr/local/share/cmake-3.19/Modules/CMakePackageConfigHelpers.cmake:336 (configure_file):
  configure_file Problem configuring file
Call Stack (most recent call first):
  tcod/src/CMakeLists.txt:88 (configure_package_config_file)

apparently it's LIBTCODConfig.cmake.in instead of what's needed, but that may be because I'm not using/experienced with conan (which seems to be used by libtcod cmake files).

Otherwise I'll wait for vcpkg as well to make it work seemlessly on linux and macos

HexDecimal commented 3 years ago

LIBTCODConfig.cmake.in was fixed in later releases of libtcod. I've been having a hard time deploying Conan builds with GitHub Actions right now but I might be able to get a working version by avoiding GitHub's actions/checkout Action.

SuperFola commented 3 years ago

Mea culpa, I was still using an alpha version instead of the latest 1.16.6, I just have to replicate an error message from cmake and it should work on Linux and macOS as well