{"action":"created","issue":{"url":"https://api.github.com/repos/leosac/leosac/issues/104","repository_url":"https://api.github.com/repos/leosac/leosac","labels_url":"https://api.github.com/repos/leosac/leosac/issues/104/labels{/name}","comments_url":"https://api.github.com/repos/leosac/leosac/issues/104/comments","events_url":"https://api.github.com/repos/leosac/leosac/issues/104/events","html_url":"https://github.com/leosac/leosac/issues/104","id":294862431,"number":104,"title":"CHAR_WIDTH macro name conflict","user":{"login":"knnniggett","id":5150042,"avatar_url":"https://avatars2.githubusercontent.com/u/5150042?v=4","gravatar_id":"","url":"https://api.github.com/users/knnniggett","html_url":"https://github.com/knnniggett","followers_url":"https://api.github.com/users/knnniggett/followers","following_url":"https://api.github.com/users/knnniggett/following{/other_user}","gists_url":"https://api.github.com/users/knnniggett/gists{/gist_id}","starred_url":"https://api.github.com/users/knnniggett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/knnniggett/subscriptions","organizations_url":"https://api.github.com/users/knnniggett/orgs","repos_url":"https://api.github.com/users/knnniggett/repos","events_url":"https://api.github.com/users/knnniggett/events{/privacy}","received_events_url":"https://api.github.com/users/knnniggett/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-02-06T18:19:20Z","updated_at":"2018-02-08T00:44:48Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"This is not an urgent issue, but I thought I'd document it while it was still fresh in my mind.\r\n\r\nlibc6-dev 2.26-4 found in Debian testing (Buster) repo defines CHAR_WIDTH macro in /usr/include/limits.h. This conflicts with the macro of the same name found in deps/spdlog/fmt/bundled/format.h, which as you can see is part of the spdlog submodule.\r\n\r\nIndeed, it appears this conflict has already been identified and resolved in the spdlog project:\r\nhttps://github.com/gabime/spdlog/issues/300\r\n\r\nNaturally, my knee-jerk response was to update the spdlog submodule and try the build again. Unfortunately, the build fails with new errors. This time it complains about missing member functions and sinks.... so it would seem the spdlog api has changed. That is where I stopped troubleshooting for the time being.\r\n\r\nToday, one can avoid this issue by just not doing a bulk apt-get update with the testing repo enabled.  I should not have done that anyway.  Eventually, we will need to address this."},"comment":{"url":"https://api.github.com/repos/leosac/leosac/issues/comments/363963592","html_url":"https://github.com/leosac/leosac/issues/104#issuecomment-363963592","issue_url":"https://api.github.com/repos/leosac/leosac/issues/104","id":363963592,"user":{"login":"knnniggett","id":5150042,"avatar_url":"https://avatars2.githubusercontent.com/u/5150042?v=4","gravatar_id":"","url":"https://api.github.com/users/knnniggett","html_url":"https://github.com/knnniggett","followers_url":"https://api.github.com/users/knnniggett/followers","following_url":"https://api.github.com/users/knnniggett/following{/other_user}","gists_url":"https://api.github.com/users/knnniggett/gists{/gist_id}","starred_url":"https://api.github.com/users/knnniggett/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/knnniggett/subscriptions","organizations_url":"https://api.github.com/users/knnniggett/orgs","repos_url":"https://api.github.com/users/knnniggett/repos","events_url":"https://api.github.com/users/knnniggett/events{/privacy}","received_events_url":"https://api.github.com/users/knnniggett/received_events","type":"User","site_admin":false},"created_at":"2018-02-08T00:44:48Z","updated_at":"2018-02-08T00:44:48Z","author_association":"CONTRIBUTOR","body":"Wow, thanks for jumping on this so quickly. That would have taken me a week to figure out!\r\n\r\nWe are almost there, but develop branch now fails to build:\r\n```\r\n[ 81%] Linking CXX executable ../leosac\r\ncd /tmp/tmp.aiPz3Rlt1I/leosac_0.7.0/obj-x86_64-linux-gnu/src && /usr/bin/cmake -E cmake_link_script CMakeFiles/leosac.dir/link.txt --verbose=1\r\n/usr/bin/c++   -g -O2 -fdebug-prefix-map=/tmp/tmp.aiPz3Rlt1I/leosac_0.7.0=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -std=c++14 -Wno-undef -Wno-shadow -Wno-unknown-pragmas -O3 -DNDEBUG  -Wl,-z,relro CMakeFiles/leosac.dir/main.cpp.o  -o ../leosac -Wl,-rpath,/tmp/tmp.aiPz3Rlt1I/leosac_0.7.0/obj-x86_64-linux-gnu: -rdynamic ../libleosac_lib.so -lbacktrace -ldl -lpthread ../libzmqpp.so -lzmq -lboost_date_time -lboost_system -lboost_serialization -lboost_regex -lboost_filesystem -lodb -lodb-pgsql -lodb-sqlite -lodb-boost -lbacktrace -lscrypt ../libleosac_db.so \r\n../libleosac_lib.so: undefined reference to `int fmt::internal::CharTraits<char>::format_float<double>(char*, unsigned long, char const*, unsigned int, int, double)'\r\n../libleosac_lib.so: undefined reference to `int fmt::internal::CharTraits<char>::format_float<long double>(char*, unsigned long, char const*, unsigned int, int, long double)'\r\ncollect2: error: ld returned 1 exit status\r\nsrc/CMakeFiles/leosac.dir/build.make:110: recipe for target 'leosac' failed\r\nmake[3]: *** [leosac] Error 1\r\nmake[3]: Leaving directory '/tmp/tmp.aiPz3Rlt1I/leosac_0.7.0/obj-x86_64-linux-gnu'\r\nCMakeFiles/Makefile2:194: recipe for target 'src/CMakeFiles/leosac.dir/all' failed\r\nmake[2]: *** [src/CMakeFiles/leosac.dir/all] Error 2\r\nmake[2]: *** Waiting for unfinished jobs....\r\n```\r\nI was surprised to see the leosac binary try to link against the bundled fmt library.\r\nI used this as my guide: https://github.com/fmtlib/fmt/issues/517\r\n\r\nIt looks like FMT_HEADER_ONLY is not defined. That macro gets defined in `deps/spdlog/include/spdlog/fmt/fmt.h` so I think we need to change these:\r\n```\r\n$ grep -r \"format\\.h\" ./\r\n./tools/ThreadUtils.cpp:#include <spdlog/fmt/bundled/format.h>\r\n./tools/version.cpp:#include <spdlog/fmt/bundled/format.h>\r\n./tools/db/Savepoint.cpp:#include <spdlog/fmt/bundled/format.h>\r\n./exception/InvalidArgument.hpp:#include <spdlog/fmt/bundled/format.h>\r\n```\r\n\r\nto include spdlog/fmt/fmt.h, rather than include format.h directly.\r\n\r\nI'm not sure I'll have time to try this tonight, but I will tomorrow if you don't beat me to it."}}
{"actor":{"display_login":"knnniggett"}}