-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support non-default libc #1727
base: master
Are you sure you want to change the base?
Support non-default libc #1727
Conversation
ec81598
to
537ed90
Compare
Tested with CMake 3.25 locally and 3.31 on CI. Avoids: > CMake Deprecation Warning at CMakeLists.txt:5 (cmake_minimum_required): Compatibility with CMake < 3.10 will be removed from a future version of CMake.
23ec351
to
d06402f
Compare
Set CMAKE_SYSTEM_* instead of e.g. CMAKE_PREFIX_PATH as those will be searched later. Appending will search ours AFTER the users location(s).
Configure a header for determining which "backtrace" functionality is to be used. For `backtrace` it might be required to link libexecinfo, e.g. with musl libc. Use the CMake find module to search for that.
Use most recent actions Remove use of TRAVIS env variable
98e727c
to
e13ba4f
Compare
- Set all env vars in a single step - Do a single `apt install` - Remove outdated clang-16 setup step
5.4 is not supported by kaguya yet an older versions are not available.
I can test the branch on the weekend, ping me if you need to know anything specific. |
I think this is ready now. So please leave a comment/review once tested. |
Failure needs to be handled on non-MSVC Windows too so make the signatures consistent.
libs/s25main/Debug.cpp
Outdated
@@ -193,14 +184,12 @@ DebugInfo::~DebugInfo() | |||
|
|||
std::vector<void*> DebugInfo::GetStackTrace(void* ctx) noexcept | |||
{ | |||
#ifndef RTTR_CONTEXT_PTR_TYPE | |||
using RTTR_CONTEXT_PTR_TYPE = void*; | |||
#endif | |||
std::vector<void*> stacktrace(256); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm, what I recall is we probably should change this to a compile time storage (e.g std::array) since std::vector may not be able to allocate due to corruption/crash.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True but it did work so far and we would likely run into the same issue in other places, e.g. with std::stringstream
I did convert this vector to a boost::static_vector
but I haven't found a static_allocator
or so in Boost so that change would be larger and not suitable for this PR.
Avoid a dynamic memory allocation which may fail
it seems to compile just fine, both with gcc-13 and clang-19: ldd /usr/bin/s25client
I will do some additional runtime testing, because musl can create some unforeseen issues with localization. Results propably tomorrow. |
so I did some runtime testing on a musl system: the system language is not honored and it drops back to the english default (as expected), but you can correct that by setting it to a language of your choice in the menue. I found one bug: in the Campaigns menue, there is an error about the world campaign being unloadable, so there is only the roman campaign available. the log states:
the files do exist on the disk, but the paths are all in non-capital letters. So the real path is: this is no issue if I compile the same musl branch on my linux x86_64 system with glibc. |
Why is that? How is the system language set there? Care to open a PR with an enhancement?
That is an unrelated issue caused by a wrong spelling of the path in the lua file. Fix: #1730
I can't see how. The lua file sets the path to |
E.g. the musl libc doesn't support all features of glibc so our dev-tools don't work there.
--> Exclude them by default and adapt readme
Also the
backtrace
function might be in a separate library outside libc--> Use a CMake find module
Finally configure a header for the used method as the header defining
backtrace
might be changed.I also updated the GHA CI configs to use latest version of actions and less steps to view them more easily.
Requires:
Fixes #1725