const version_data = b.fmt(
\\ #include "Version.hpp"
\\ namespace Project {
\\ char const* const VersionString = "0.0.1";
\\ char const* const SourceIdentifierString = "debug";
\\ char const* const ArchitectureString = "{s} {s}";
, .{
@tagName(target.result.os.tag),
@tagName(target.result.cpu.arch),
});
This code fails to compile with the following error:
/<zig>/lib/std/fmt.zig:492:5: error: invalid format string '
char const* const VersionString = "0.0.1";
char const* const SourceIdentifierString = "debug";
char const* const ArchitectureString = "{s' for type 'u8'
@compileError("invalid format string '" ++ fmt ++ "' for type '" ++ @typeName(@TypeOf(value)) ++ "'");
It reads to me like the compiler is treating @tagName output as u8 instead of [:0] const u8. This also happens with string literals.