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

fmtlog broken now😢 #4806

Closed
urasssopretty opened this issue Jul 31, 2024 · 3 comments
Closed

fmtlog broken now😢 #4806

urasssopretty opened this issue Jul 31, 2024 · 3 comments
Labels

Comments

@urasssopretty
Copy link
Contributor

urasssopretty commented Jul 31, 2024

Xmake Version

2.9.4

Operating System Version and Architecture

x64 Windows 10, Windows 11, Arch Linux

Describe Bug

A project that was successfully builed half a year ago is not being builed now. I also tested fmtlot in an empty project. I receive the message:

In file included from .xmake/cache/packages/2407/f/fmtlog/v2.2.1/source/fmtlog.cc:1:
.xmake/cache/packages/2407/f/fmtlog/v2.2.1/source/fmtlog-inl.h:550:5: error: no member named 'throw_format_error' in namespace 'fmt::detail'; did you mean 'fmt::throw_format_error'?
  550 |     fmt::detail::throw_format_error(err.c_str());
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |     fmt::throw_format_error
.xmake/packages/f/fmt/11.0.2/24b2d6d5e23d42009b64f8ce95ee1fcc/include/fmt/base.h:737:41: note: 'fmt::throw_format_error' declared here
  737 | FMT_DEPRECATED FMT_NORETURN inline void throw_format_error(
      |     

Well, let's say fmtlog has a new version, but xrepo packages use a fixed version, so why it broken😢 (udp: omg fmtlog use fmt 10.2.1 now, it's discouraging)

Expected Behavior

fmtlog that works out of the box

Project Configuration

local dependencies = { "fmtlog" }
for _, dependency in ipairs(dependencies) do
    add_requires(dependency)
end

target("fucking")
    set_default(true)
    set_kind("binary")
    for _, dependency in ipairs(dependencies) do
        add_packages(dependency)
    end
    add_files("**.cc")
target_end()

Additional Information and Error Logs

$ xmake -y
checking for platform ... linux
checking for architecture ... x86_64
=> install fmtlog v2.2.1 .. failed

[ 25%] Building CXX object CMakeFiles/fmtlog-static.dir/fmtlog.cc.o
[ 50%] Building CXX object CMakeFiles/fmtlog-shared.dir/fmtlog.cc.o
In file included from /home/me/.xmake/cache/packages/2407/f/fmtlog/v2.2.1/source/fmtlog.cc:1:
In file included from /home/me/.xmake/cache/packages/2407/f/fmtlog/v2.2.1/source/fmtlog-inl.h:24:
/home/me/.xmake/cache/packages/2407/f/fmtlog/v2.2.1/source/fmtlog.h:636:15: error: no member named 'throw_format_error' in namespace 'fmt::detail'; did you mean 'fmt::throw_format_error'?
636 | if (!c) fmt::detail::throw_format_error("invalid format string");
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| fmt::throw_format_error
/home/me/.xmake/packages/f/fmt/11.0.2/d396b4e809304cf1ad4202e5aa292d4c/include/fmt/base.h:737:41: note: 'fmt::throw_format_error' declared here
737 | FMT_DEPRECATED FMT_NORETURN inline void throw_format_error(
| ^
In file included from /home/me/.xmake/cache/packages/2407/f/fmtlog/v2.2.1/source/fmtlog.cc:1:
In file included from /home/me/.xmake/cache/packages/2407/f/fmtlog/v2.2.1/source/fmtlog-inl.h:24:
/home/me/.xmake/cache/packages/2407/f/fmtlog/v2.2.1/source/fmtlog.h:649:21: error: no member named 'throw_format_error' in namespace 'fmt::detail'; did you mean 'fmt::throw_format_error'?
649 | if (id < 0) fmt::detail::throw_format_error("invalid format string");
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| fmt::throw_format_error
if you want to get more verbose errors, please see:
-> /home/me/.xmake/cache/packages/2407/f/fmtlog/v2.2.1/installdir.failed/logs/install.txt
error: install failed!

@Issues-translate-bot
Copy link

Bot detected the issue body's language is not English, translate it automatically.


Title: fmtlog broken now😢

@Chi-EEE
Copy link
Contributor

Chi-EEE commented Jul 31, 2024

Add this to your xmake.lua project scope:
add_requireconfs("fmtlog.fmt", {override = true, version = "10.2.1", configs = {cxxflags = "/utf-8"}})

local dependencies = { "fmtlog" }
for _, dependency in ipairs(dependencies) do
    add_requires(dependency)
end

add_requireconfs("fmtlog.fmt", {override = true, version = "10.2.1", configs = {cxxflags = "/utf-8"}})

target("fucking")
    set_default(true)
    set_kind("binary")
    for _, dependency in ipairs(dependencies) do
        add_packages(dependency)
    end
    add_files("**.cc")
target_end()

@urasssopretty
Copy link
Contributor Author

Hello and thanks✨❤️ for solving the problem!
The fmt package already has the "/utf-8" flag set. Is it possible to make the fmtlog package follow the fmt package config? As far as I can understand, he just stupidly git clone for fmt.

Setting the flag in the fmt config:
https://github.com/xmake-io/xmake-repo/blob/dev/packages/f/fmt/xmake.lua

if package:has_tool("cxx", "cl") and package:config("unicode") then
    package:add("cxxflags", "/utf-8")
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants