Skip to content
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

Error when building from source #71

Open
danenders opened this issue Nov 11, 2024 · 7 comments
Open

Error when building from source #71

danenders opened this issue Nov 11, 2024 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@danenders
Copy link

danenders commented Nov 11, 2024

Describe the bug
Hello. I've attempted to build from source on two different devices and have received the same error. I am following the steps outlined for building on MacOS.

Error Message received:

In file included from /Users/macbook/porytiles/Porytiles-1.x/lib/src/importer.cpp:8:
In member function 'void io::LineReader::set_file_name(const char*)',
inlined from 'io::LineReader::LineReader(const std::string&)' at /Users/macbook/porytiles/Porytiles-1.x/lib/../vendor/fast-cpp-csv-parser/csv.h:350:18,
inlined from 'io::CSVReader<column_count, trim_policy, quote_policy, overflow_policy, comment_policy>::CSVReader(Args&& ...) [with Args = {const std::__cxx11::basic_string<char, std::char_traits, std::allocator >&}; unsigned int column_count = 4; trim_policy = io::trim_chars<' ', '\011'>; quote_policy = io::no_quote_escape<','>; overflow_policy = io::throw_on_overflow; comment_policy = io::no_comment]' at /Users/macbook/porytiles/Porytiles-1.x/lib/../vendor/fast-cpp-csv-parser/csv.h:1077:41:
/Users/macbook/porytiles/Porytiles-1.x/lib/../vendor/fast-cpp-csv-parser/csv.h:410:14: error: 'char* strncpy(char*, const char*, size_t)' specified bound 1025 equals destination size [-Werror=stringop-truncation]
410 | strncpy(this->file_name, file_name, sizeof(this->file_name));
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
gmake[2]: *** [Porytiles-1.x/lib/CMakeFiles/Porytiles1xLib.dir/build.make:163: Porytiles-1.x/lib/CMakeFiles/Porytiles1xLib.dir/src/importer.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:347: Porytiles-1.x/lib/CMakeFiles/Porytiles1xLib.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2

Screen Shot 2024-11-11 at 9 38 59 AM
Environment (please complete the following information):
OS: MacOS Mojave, 10.14.6
Compiler: gcc 14.2.0_1

@danenders danenders added the bug Something isn't working label Nov 11, 2024
@grunt-lucas
Copy link
Owner

@danenders quick question: are you on an intel mac? What's the full output you see when you run uname -a? I ask because I am unable to reproduce this on my end. Granted I'm also running Sonoma.

@danenders
Copy link
Author

Yeah, I am!
Darwin Kernel Version 18.7.0: Tue Aug 20 16:57:14 PDT 2019; root:xnu-4903.271.2~2/RELEASE_X86_64 x86_64

All good if my janky computer is just too old to run this, but figured I'd flag the build error just in case it wasn't that!

@grunt-lucas
Copy link
Owner

@danenders no worries, I have a feeling it's something to do with that. I had someone else on Intel mac run into some trouble as well. Unfortunately I don't really have a good way to reproduce. Although I'd suggest installing/trying Clang 16 and see if that helps. If you have homebrew you should be able to do:

brew install llvm@16

to get that version specifically

@danenders
Copy link
Author

danenders commented Nov 17, 2024

Looks like that can't install either, homebrew fails during the install / patch process, part of the info provided cites my system being unsupported.

Seems like this is an issue with my setup being jank, think we can close this. Thanks for checking though, and even if I can't use this Porytiles sounds cool as hell, awesome work.

@grunt-lucas
Copy link
Owner

@danenders Just as a longshot, your GCC output seems to be failing due to a warning that's getting enabled as an error. Can you try:

CXX=g++-14 CXXFLAGS=-Wno-error=stringop-truncation cmake -B build

Seems like the default CMake configuration treats all warnings as errors. I suspect this is an issue that won't break the app so let's just disable it.

@grunt-lucas grunt-lucas reopened this Nov 18, 2024
@danenders
Copy link
Author

danenders commented Dec 8, 2024

Hey! Missed this getting re-opened; just tried with your suggestion and it got further, but still fails at the final step for the test:

Air:porytiles macbook$ ./build/Porytiles-1.x/tests/Porytiles1xTestSuite
[doctest] doctest version is "2.4.11"
[doctest] run with "--help" for options
libpng warning: Application built with libpng-1.4.12 but running with 1.6.44
===============================================================================
/Users/macbook/porytiles/Porytiles-1.x/lib/src/compiler.cpp:901:
TEST CASE:  candidate should return the NormalizedTile with requested flips

/Users/macbook/porytiles/Porytiles-1.x/lib/src/compiler.cpp:901: FATAL ERROR: test case CRASHED: SIGSEGV - Segmentation violation signal

===============================================================================
[doctest] test cases:  3 |  2 passed | 1 failed | 66 skipped
[doctest] assertions: 54 | 54 passed | 0 failed |
[doctest] Status: FAILURE!
Segmentation fault: 11

@grunt-lucas
Copy link
Owner

@danenders no worries, that's great. One step closer. Odd that I can't reproduce that crash on my end. But I do get a similar crash with latest LLVM, so there's probably a bug on my end. I'm going to hesitantly say you're probably OK to just use the resulting executable. Ignore the failing test results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants