server: short-circuit main() for SANDO_BOOT_SMOKE; bump to 0.9.2
Sando's boot_smoke gate spawns the binary on the build host to verify
it loads + links + survives. The real init reads
docs/internal/business/assumptions.toml (not present in the sando
workspace) and panics. Branch early when SANDO_BOOT_SMOKE=1 and run a
minimal axum server bound to 127.0.0.1:0 that idles until the gate
kills it. Proves the linker, tokio runtime, axum, and TCP bind paths
without depending on runtime-config files.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3 files changed,
+18 insertions,
-2 deletions
| 4140 |
4140 |
|
|
| 4141 |
4141 |
|
[[package]]
|
| 4142 |
4142 |
|
name = "makenotwork"
|
| 4143 |
|
- |
version = "0.9.1"
|
|
4143 |
+ |
version = "0.9.2"
|
| 4144 |
4144 |
|
dependencies = [
|
| 4145 |
4145 |
|
"anyhow",
|
| 4146 |
4146 |
|
"apple-codesign",
|
| 1 |
1 |
|
[package]
|
| 2 |
2 |
|
name = "makenotwork"
|
| 3 |
|
- |
version = "0.9.1"
|
|
3 |
+ |
version = "0.9.2"
|
| 4 |
4 |
|
edition = "2024"
|
| 5 |
5 |
|
license-file = "LICENSE"
|
| 6 |
6 |
|
|
| 39 |
39 |
|
})
|
| 40 |
40 |
|
.init();
|
| 41 |
41 |
|
|
|
42 |
+ |
// Sando boot-smoke gate spawns the binary with SANDO_BOOT_SMOKE=1 to
|
|
43 |
+ |
// verify it loads + links + survives. The real init loads
|
|
44 |
+ |
// assumptions.toml and other runtime files that don't exist in the
|
|
45 |
+ |
// sando build workspace. Short-circuit to a tiny axum server that
|
|
46 |
+ |
// proves the binary, tokio runtime, axum, and TCP bind all work,
|
|
47 |
+ |
// then idles until the gate kills it.
|
|
48 |
+ |
if std::env::var("SANDO_BOOT_SMOKE").is_ok() {
|
|
49 |
+ |
tracing::info!("SANDO_BOOT_SMOKE=1; running minimal smoke server");
|
|
50 |
+ |
let app = axum::Router::new()
|
|
51 |
+ |
.route("/health", axum::routing::get(|| async { "ok" }));
|
|
52 |
+ |
let listener = tokio::net::TcpListener::bind("127.0.0.1:0").await
|
|
53 |
+ |
.expect("smoke: bind 127.0.0.1:0");
|
|
54 |
+ |
axum::serve(listener, app).await.expect("smoke: serve");
|
|
55 |
+ |
return;
|
|
56 |
+ |
}
|
|
57 |
+ |
|
| 42 |
58 |
|
let config = Config::from_env().expect("Failed to load configuration");
|
| 43 |
59 |
|
tracing::info!("Configuration loaded");
|
| 44 |
60 |
|
|