Skip to content

Commit 6d40b97

Browse files
committed
fix(release): bump hard-coded version strings to 0.0.2 + route through MCPP_VERSION
The v0.0.2 release.yml run produced a fully-functional musl-static binary, but the smoke-test step rejected it because `mcpp --version` still printed `mcpp 0.0.1`. The version literal had been hand-coded in four places that the [package].version bump in mcpp.toml didn't reach: - src/toolchain/fingerprint.cppm:21 MCPP_VERSION = "0.0.1" - src/cli.cppm:64 "mcpp v0.0.1 — ..." (print_usage) - src/cli.cppm:2805 "mcpp 0.0.1" (cmd_self_version) - src/cli.cppm:2874 "mcpp 0.0.1" (--version handler) - src/cli.cppm:2947 .version("0.0.1") (cmdline App ctor) Bump the canonical constant in `fingerprint.cppm` to 0.0.2 and refactor all five sites to read `mcpp::toolchain::MCPP_VERSION` so future bumps only need a one-line change. The fingerprint constant already drives the toolchain hash key, so its value matters for cache invalidation anyway — this consolidates "what version am I" into a single authoritative location. Verified locally: $ mcpp --version mcpp 0.0.2 $ mcpp self version mcpp 0.0.2
1 parent ba5f1a6 commit 6d40b97

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/cli.cppm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ namespace mcpp::cli::detail {
6161
// canonical printer here so the docs/CHANGELOG examples don't drift
6262
// every time cmdline tweaks its formatting.
6363
void print_usage() {
64-
std::println("mcpp v0.0.1 — modern C++23 build tool");
64+
std::println("mcpp v{} — modern C++23 build tool", mcpp::toolchain::MCPP_VERSION);
6565
std::println("");
6666
std::println("Usage:");
6767
std::println("Project commands:");
@@ -2802,7 +2802,7 @@ int cmd_explain(std::string_view code) {
28022802
// can share `cmd_doctor` / `cmd_env` between top-level and `mcpp self`.
28032803

28042804
int cmd_self_version(const mcpplibs::cmdline::ParsedArgs& /*parsed*/) {
2805-
std::println("mcpp 0.0.1");
2805+
std::println("mcpp {}", mcpp::toolchain::MCPP_VERSION);
28062806
return 0;
28072807
}
28082808

@@ -2871,7 +2871,7 @@ int run(int argc, char** argv) {
28712871
std::string_view a = argv[1];
28722872
if (a == "--help" || a == "-h") { print_usage(); return 0; }
28732873
if (a == "--version" || a == "-V") {
2874-
std::println("mcpp 0.0.1");
2874+
std::println("mcpp {}", mcpp::toolchain::MCPP_VERSION);
28752875
return 0;
28762876
}
28772877
}
@@ -2944,7 +2944,7 @@ int run(int argc, char** argv) {
29442944

29452945
// ─── Build the top-level App ────────────────────────────────────────
29462946
auto app = cl::App("mcpp")
2947-
.version("0.0.1")
2947+
.version(std::string{mcpp::toolchain::MCPP_VERSION})
29482948
.description("modern C++ build tool")
29492949
.option(cl::Option("quiet").short_name('q')
29502950
.help("Suppress status output").global())

src/toolchain/fingerprint.cppm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import mcpp.toolchain.detect;
1818

1919
export namespace mcpp::toolchain {
2020

21-
inline constexpr std::string_view MCPP_VERSION = "0.0.1";
21+
inline constexpr std::string_view MCPP_VERSION = "0.0.2";
2222

2323
struct FingerprintInputs {
2424
Toolchain toolchain;

0 commit comments

Comments
 (0)