Skip to content

[FreeBSD] Does not build with libfmt installed from ports #286

@rhaberkorn

Description

@rhaberkorn
# gmake
[1/77] CXXLINK src/c/+wordgrinder-ncurses
[2/77] TYPECHECK src/lua/+typecheck
(0 errors)
/usr/local/bin/ld: .obj/unix/src/c/arch/ncurses/+ncurses_lib/ncurses.a(dpy.o): in function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > fmt::v10::format<char const*&, char const*&>(fmt::v10::basic_format_string<char, fmt::v10::type_identity<char const*&>::type, fmt::v10::type_identity<char const*&>::type>, char const*&, char const*&)':
/usr/local/include/fmt/core.h:2835:(.text._Z14dpy_getkeynameB5cxx11i+0x3c0): undefined reference to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)'
/usr/local/bin/ld: .obj/unix/src/c/arch/ncurses/+ncurses_lib/ncurses.a(dpy.o): in function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > fmt::v10::format<int&, char const*>(fmt::v10::basic_format_string<char, fmt::v10::type_identity<int&>::type, fmt::v10::type_identity<char const*>::type>, int&, char const*&&)':
/usr/local/include/fmt/core.h:2835:(.text._Z14dpy_getkeynameB5cxx11i+0x3f5): undefined reference to `fmt::v10::vformat[abi:cxx11](fmt::v10::basic_string_view<char>, fmt::v10::basic_format_args<fmt::v10::basic_format_context<fmt::v10::appender, char> >)'
collect2: error: ld returned 1 exit status
gmake: *** [.obj/unix/build.mk:2262: .obj/unix/src/c/+wordgrinder-ncurses/wordgrinder-ncurses] Error 1

Obviously he picks up libfmt installed from a FreeBSD port instead of the included third_party/fmt and I suppose, it is not new enough.
Our awful legacy build systems like Autotools have configure-time checks, so you can actually check whether an installed version of the lib is sufficient or whether you have to enable any internal fallback.
Or you could just check the library version reported by pkg-config.

I worked around the problem by munging:

--- a/src/c/build.py
+++ b/src/c/build.py
@@ -10,7 +10,7 @@ from config import (
 )

 package(name="libcmark", package="libcmark", fallback="third_party/cmark")
-package(name="fmt", package="fmt", fallback="third_party/fmt")
+package(name="fmt", package=None, fallback="third_party/fmt")

 cxxlibrary(
     name="globals",

So he always picks up the fallback.
Now Wordgrinder builds and installs.

Btw. I also did not manage to disable the GLFW support.
Setting HAS_GLFW = False in config.py does not seem to do anything.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions