Conan-center-index: [spdlog] spdlog/1.5.0: Dependency version is incorrect

Created on 20 Feb 2020  路  3Comments  路  Source: conan-io/conan-center-index

Package and Environment Details (include every applicable attribute)

  • Package Name/Version: spdlog/1.5.0
  • Operating System+version: Windows 10 1909
  • Compiler+version: MSVC 15
  • Conan version: conan 1.22.2
  • Python version: Python 3.8.1

Conan profile (output of conan profile show default or conan profile show <profile> if custom profile is in use)

[settings]
os=Windows
os_build=Windows
arch=x86_64
arch_build=x86_64
compiler=Visual Studio
compiler.version=15
build_type=Release
[options]
[build_requires]
[env]

Steps to reproduce (Include if Applicable)

Compile and run the following:


#include "spdlog/spdlog.h"
#include "spdlog/sinks/rotating_file_sink.h"
#include <string>
int main() {
const std::string name = "logs/serial.txt";
auto dist_sink = std::make_shared<spdlog::sinks::dist_sink_mt>();
dist_sink->add_sink(std::make_shared<spdlog::sinks::rotating_file_sink_mt>("logs/" + name + ".txt", 1048576 * 5, 2, true));
return 0;
}

Always crashes trying to use fmt.

bug

Most helpful comment

I'm not a beta user yet, so I only provide information.

spdlog bundled fmt version table:

| spdlog version | fmt version |
|-----------------|--------------|
| v1.5.0 and above | 6.1.2 |
| v1.4.0, v1.4.1, v1.4.2 | 6.0.0 |

I think the should be the following change:

    @property
    def _fmt_version(self):
        spdlog_version = tools.Version(self.version)
        if spdlog_version >= "1.5.0"
            return "6.1.2"
        else:
            return "6.0.0"

    def requirements(self):
        self.requires("fmt/{}".format(self._fmt_version))

All 3 comments

I'm not a beta user yet, so I only provide information.

spdlog bundled fmt version table:

| spdlog version | fmt version |
|-----------------|--------------|
| v1.5.0 and above | 6.1.2 |
| v1.4.0, v1.4.1, v1.4.2 | 6.0.0 |

I think the should be the following change:

    @property
    def _fmt_version(self):
        spdlog_version = tools.Version(self.version)
        if spdlog_version >= "1.5.0"
            return "6.1.2"
        else:
            return "6.0.0"

    def requirements(self):
        self.requires("fmt/{}".format(self._fmt_version))

we had the same problem -> we defined in our conanfile.txt the dependency to fmt directly

I'm not a beta user yet, so I only provide information.

spdlog bundled fmt version table:
spdlog version fmt version
v1.5.0 and above 6.1.2
v1.4.0, v1.4.1, v1.4.2 6.0.0

I think the should be the following change:

    @property
    def _fmt_version(self):
        spdlog_version = tools.Version(self.version)
        if spdlog_version >= "1.5.0"
            return "6.1.2"
        else:
            return "6.0.0"

    def requirements(self):
        self.requires("fmt/{}".format(self._fmt_version))

@tt4g even if you are not a BETA user, you can open a PR anyway. Thanks for showing the possible solution. Regards!

Was this page helpful?
0 / 5 - 0 ratings