Giter Club home page Giter Club logo

Comments (11)

Andrettin avatar Andrettin commented on September 28, 2024 1

Good news: I got the CI working again! Thanks to the documentation written by @bergentroll in the README_ACTIONS.md file, I was able to create an updated docker image, with the SDL2 library change taken into account.

from wyrmgus.

Andrettin avatar Andrettin commented on September 28, 2024

Thanks for the heads up! I can reproduce most of these errors here by building a non-unity or debug build. I've fixed them in the latest commits:
4cb1b58
d0d17e2
af89574

Regarding the very first one in path_util.h, it could be that GCC hasn't updated their std::filesystem::path::u8string() function yet to return an std::u8string instead of an std::string (this is a C++20 change):
https://en.cppreference.com/w/cpp/filesystem/path/string

Either way, just calling std::filesystem::path::string() would be fine there too for Linux, since filepath strings are inherently encoded in UTF-8 under Linux; so this particular issue could be solved via an ifdef.

As for the continuous integration, you are absolutely right, that is something that should be fixed; it stopped working since I updated to SDL2. I will look into creating an updated docker image.

from wyrmgus.

AMDmi3 avatar AMDmi3 commented on September 28, 2024

Regarding the very first one in path_util.h, it could be that GCC hasn't updated their std::filesystem::path::u8string() function yet to return an std::u8string instead of an std::string (this is a C++20 change):

I use clang/libc++. It doesn't have all C++20 features either.

In file included from /wrkdirs/usr/ports/games/wyrmgus/work/.build/CMakeFiles/wyrmgus.dir/cmake_pch.hxx:5:
/wrkdirs/usr/ports/games/wyrmgus/work/Wyrmgus-9655dbc/src/pch.h:57:10: fatal error: 'source_location' file not found
#include <source_location>
         ^~~~~~~~~~~~~~~~~
1 error generated.

from wyrmgus.

AMDmi3 avatar AMDmi3 commented on September 28, 2024

I was able to build with these patches: https://github.com/AMDmi3/freebsd-ports/tree/master/games/wyrmgus/files

from wyrmgus.

AMDmi3 avatar AMDmi3 commented on September 28, 2024

It now fails to run:

/usr/local/share/wyrmsun/scripts/stratagus.lua:29: main: Stratagus default config file loading ...
/usr/local/share/wyrmsun/scripts/stratagus.lua:1956: main: ... ready!
Wyrmsun v5.1.2, Copyright (c) 1998-2021 by The Stratagus Project
  written by Lutz Sammer, Fabrice Rossi, Vladi Shabanski, Patrice Fortier,
  Jon Gabrielson, Andreas Arens, Nehal Mistry, Jimmy Salmon, Pali Rohar,
  cybermind, Andrettin and others.
	https://github.com/Andrettin/Wyrmgus
Compile options DEBUG ZLIB OPENGL BSD X11 

Stratagus may be copied only under the terms of the GNU General Public License
which may be found in the Stratagus source kit.

DISCLAIMER:
This software is provided as-is.  The author(s) can not be held liable for any
damage that might arise from the use of this software.
Use it at your own risk.

[2021.09.22 21:27:22] File "/home/marakasov/.local/share/Wyrmsun/quests.txt" not found.
[2021.09.22 21:27:22] Invalid interface_style instance: "default".
[2021.09.22 21:27:22] Warning: file:///usr/local/share/wyrmsun/interface/WidgetBase.qml:27:2: QML WidgetImage: Failed to get image from provider: image://interface/default/large_button/normal (file:///usr/local/share/wyrmsun/interface/WidgetBase.qml: 
                                                                          [2021.09.22 21:27:22] Invalid interface_style instance: "default".
[2021.09.22 21:27:22] Warning: file:///usr/local/share/wyrmsun/interface/WidgetBase.qml:27:2: QML WidgetImage: Failed to get image from provider: image://interface/default/large_button/normal (file:///usr/local/share/wyrmsun/interface/WidgetBase.qml: 
                                                                          [2021.09.22 21:27:22] Invalid interface_style instance: "default".
[2021.09.22 21:27:22] Warning: file:///usr/local/share/wyrmsun/interface/WidgetBase.qml:27:2: QML WidgetImage: Failed to get image from provider: image://interface/default/large_button/normal (file:///usr/local/share/wyrmsun/interface/WidgetBase.qml: 
                                                                          [2021.09.22 21:27:22] Invalid interface_style instance: "default".
[2021.09.22 21:27:22] Warning: file:///usr/local/share/wyrmsun/interface/WidgetBase.qml:27:2: QML WidgetImage: Failed to get image from provider: image://interface/default/large_button/normal (file:///usr/local/share/wyrmsun/interface/WidgetBase.qml: 
                                                                          [2021.09.22 21:27:22] Invalid interface_style instance: "default".
[2021.09.22 21:27:22] Warning: file:///usr/local/share/wyrmsun/interface/WidgetBase.qml:27:2: QML WidgetImage: Failed to get image from provider: image://interface/default/large_button/normal (file:///usr/local/share/wyrmsun/interface/WidgetBase.qml: 
                                                                          Thanks for playing Wyrmsun.
[2021.09.22 21:27:22] Invalid interface_style instance: "default".
[2021.09.22 21:27:22] Warning: file:///usr/local/share/wyrmsun/interface/WidgetBase.qml:27:2: QML WidgetImage: Failed to get image from provider: image://interface/default/large_button/normal (file:///usr/local/share/wyrmsun/interface/WidgetBase.qml: 
                                                                          [2021.09.22 21:27:22] Invalid interface_style instance: "default".
[2021.09.22 21:27:22] Warning: file:///usr/local/share/wyrmsun/interface/WidgetBase.qml:27:2: QML WidgetImage: Failed to get image from provider: image://interface/default/large_button/normal (file:///usr/local/share/wyrmsun/interface/WidgetBase.qml: 
                                                                          [2021.09.22 21:27:22] Invalid interface_style instance: "default".
[2021.09.22 21:27:22] Warning: file:///usr/local/share/wyrmsun/interface/WidgetBase.qml:27:2: QML WidgetImage: Failed to get image from provider: image://interface/default/large_button/normal (file:///usr/local/share/wyrmsun/interface/WidgetBase.qml: 

I remember that with 5.0.1 I've had to add some qt dependencies like quickcontrols quickcontrols2 and graphicaleffects which were not listed anywhere in the docs or build system and were not checked during the build. May it be that some more of them are now required?

from wyrmgus.

Andrettin avatar Andrettin commented on September 28, 2024

Thanks for the error report! The actual error has to do with changes to persistent quest completion saving (the rest are just subsequent errors due to the database not having been initialized properly). I've fixed the issue here now:
38bed6a

from wyrmgus.

Andrettin avatar Andrettin commented on September 28, 2024

I was able to build with these patches: https://github.com/AMDmi3/freebsd-ports/tree/master/games/wyrmgus/files

Thanks! I think those changes would be good to add to the source code under a Clang ifdef, as Clang is a major compiler. Checking for the __clang__ macro seems to be the appropriate way to do it, from what I've gathered. Or do you have a different suggestion?

from wyrmgus.

Andrettin avatar Andrettin commented on September 28, 2024

I've gone ahead and committed those changes:
59abd72

If you think a different macro would be better, let me know!

from wyrmgus.

AMDmi3 avatar AMDmi3 commented on September 28, 2024

For my specific case it should probably check for libc++ version, I'll try to come with proper ifdefs. However, shouldn't it be more like #ifdef WIN32 or linux as, like you've said, linux (BSD and probably other *nix like OSes) should have paths utf8 encoded by default. I'm particularly suspicious towards the last function, utf16 is likely not suitable for *nix at all.

from wyrmgus.

Andrettin avatar Andrettin commented on September 28, 2024

For my specific case it should probably check for libc++ version, I'll try to come with proper ifdefs. However, shouldn't it be more like #ifdef WIN32 or linux as, like you've said, linux (BSD and probably other *nix like OSes) should have paths utf8 encoded by default. I'm particularly suspicious towards the last function, utf16 is likely not suitable for *nix at all.

Yes, for the last function I've checked for Windows instead. The C++ standard itself allows for std::filesystem::path to be constructed from an std::u16string:
https://en.cppreference.com/w/cpp/filesystem/path/path

So in principle the previous code would have been platform-independent, if each platform implemented the standard perfectly. Nevertheless, it is weird, yes, (and probably inefficient) to construct a filepath from a UTF-16 string in Unix.

For the other functions, I think that in principle it would be better to have platform-independent code that ensures that the filepaths are UTF-8 encoded; the ifdefs would be more of a stopgap until all major compilers fully implement C++20.

from wyrmgus.

AMDmi3 avatar AMDmi3 commented on September 28, 2024

It builds and runs now. However, pressing a button to start a scenario or a legacy quest doesn't do anything, e.g. game does not start. No messages on console either. after this pressing a "custom game" button hang the game. However after restart I cannot reproduce any problem. Since this builds and runs, closing the issue.

from wyrmgus.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.