Skip to content

ktx: Add new 4.4.2 version#28400

Open
kacprzak wants to merge 11 commits intoconan-io:masterfrom
kacprzak:ktx/4.4.0
Open

ktx: Add new 4.4.2 version#28400
kacprzak wants to merge 11 commits intoconan-io:masterfrom
kacprzak:ktx/4.4.0

Conversation

@kacprzak
Copy link

@kacprzak kacprzak commented Sep 16, 2025

Summary

Added: ktx/4.4.2

Motivation

#27392

Changes made by maintainers

  • Simplified recipe to only publish new revisions for the new version.

Note that this does not mean that the old versions are no longer available,
it just means that we will no longer provide support for those old versions (but you can always require the old references as usual)

  • made the linter happy with const evals, took the time to regenerate the patch to have a more robust unvendorization

There are some dependencies that are still vendorized, but only 1 of them has visible symbols in the resulting package and exists in CCI, but as the vendorized version is not present, I decided to keep it as-is. The rest are either not available in CCI, or only used as part of the tools



Add a 👍 reaction to pull requests you find important to help the team prioritize, thanks!

@CLAassistant
Copy link

CLAassistant commented Sep 16, 2025

CLA assistant check
All committers have signed the CLA.

self.requires("zstd/[^1.5]")
if self.options.tools:
self.requires("fmt/10.2.1", transitive_libs=False)
self.requires("fmt/[>=11 <12]")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vendored version uses fmt 11, set this as a version range to avoid conflicts where possible

@AbrilRBS AbrilRBS changed the title Ktx/4.4.0 ktx: Add new 4.4.2 version Dec 26, 2025
@ltjax
Copy link

ltjax commented Dec 26, 2025

I tested this, but it does not compile with g++14. That does seem to be a problem with how the ktx tools handle forwarding to {fmt}. My errors are this:

/home/ltjax/.conan2/p/b/ktx0e591fa15a9b9/b/src/tools/ktx/command.h: In instantiation of ‘void ktx::Reporter::fatal_usage(Args&& ...) [with Args = {const char (&)[26], const std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&}]’:
/home/ltjax/.conan2/p/b/ktx0e591fa15a9b9/b/src/tools/ktx/command.h:233:31:   required from here
/home/ltjax/.conan2/p/b/ktx0e591fa15a9b9/b/src/tools/ktx/command.h:122:19: error: ‘args#0’ is not a constant expression
  122 |         fmt::print(std::cerr, std::forward<Args>(args)...);
      |         ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I submitted an issue for this upstream: KhronosGroup/KTX-Software#1101

Other than that: The new CMake option I needed is not exposed to conan either, it's KTX_FEATURE_JS

@AbrilRBS
Copy link
Member

AbrilRBS commented Dec 27, 2025

My errors are this:

Could you try to re-build fmt on your end? You're probably picking up a binary built with C++ 17 as a compatibility fallback when using C++23 in your profile. You can do this by passing -b="fmt/*" in your Conan command

Edit: I've tested this locally, and rebuilding fmt for C++23 also errors out in a similar manner, but this time this is apple-clang 17 in macos:

../../src/tools/ktx/command.h:114:31: error: call to consteval function 'fmt::fstring<const char *>::fstring<37UL>' is not a constant expression
  114 |         fmt::print(std::cerr, std::forward<Args>(args)...);
      |                               ^
../../src/tools/ktx/command_transcode.cpp:159:13: note: in instantiation of function template specialization 'ktx::Reporter::fatal<const char (&)[37], const char *>' requested here
  159 |             fatal(rc::KTX_FAILURE, "Zstd deflation failed. KTX Error: {}", ktxErrorString(ret));
      |             ^
../../src/tools/ktx/command.h:114:50: note: function parameter 'args' with unknown value cannot be used in a constant expression
  114 |         fmt::print(std::cerr, std::forward<Args>(args)...);
      |                                                  ^
../../src/tools/ktx/command.h:112:50: note: declared here
  112 |     void fatal(ReturnCode return_code, Args&&... args) {
      |                                                  ^

Seeing their response to your upstream issue and that they find it an unexpected error, this might have something to do with fmt coming from Conan instead of the vendorized version they ship? I'll investigate further and let you know what I find.

Other than that: The new CMake option I needed is not exposed to conan either, it's KTX_FEATURE_JS

Note that the 4.4.2 version seems to be older than the PR that included this option (KhronosGroup/KTX-Software#1073) so there currently is no available version with this option published by upstream. Happy to open a new PR once this one gets merged and a new version is published with the changes to add it to the recipe!

@ltjax
Copy link

ltjax commented Dec 27, 2025

I tried it with -b="fmt/*". that builds {fmt} just fine, but ktx still errors out the same exact way (unsurprisingly, I think, since the consteval stuff needs to be in the header, right?)

@ltjax
Copy link

ltjax commented Dec 28, 2025

For now, I think the best course of action would be to patch the bit in the tools setting the minimum language version via target_compile_features(... cxx_std_17) to set_target_properties(... CXX_STANDARD 17) as it used to be in 4.3.2

@AbrilRBS
Copy link
Member

@ltjax I see your progress in KhronosGroup/KTX-Software#1102. Do you think we can wait until it gets merged and a new version released? Or should we include the current PR and validate out C++23 ubilds with tools enabled?

@ltjax
Copy link

ltjax commented Jan 23, 2026

I have no idea when that will be released, since progress seems to have stalled somewhat. I'd say this version here is good for now and can be used by adding ktx/*:compiler.cppstd=17 to the profile, even if the rest of the project is C++20 or C++23, which is a good enough solution for me. Unlike 4.3.2, it also seems to compile properly in Emscripten, so that's nice too.

@uilianries uilianries linked an issue Jan 28, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[request] ktx/v4.4.0

6 participants