Skip to content

Commit 4341302

Browse files
committed
Add build.rs to create placeholder contributors.csv when absent
include_str! requires contributors.csv to exist at compile time. The file is gitignored (generated by the CI release pipeline via stackql-exec), so clippy/test CI jobs on non-main branches would fail with a missing-file error. build.rs creates an empty placeholder if the file is not present, keeping all non-release builds green. https://claude.ai/code/session_01GzGtjMcwBXyVW3uKW4F2Ai
1 parent 495f331 commit 4341302

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

build.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
use std::fs;
2+
use std::path::Path;
3+
4+
fn main() {
5+
// contributors.csv is generated by the CI release pipeline (via stackql-exec)
6+
// and embedded into the binary at compile time via include_str! in info.rs.
7+
// For local builds and non-release CI jobs the file may not exist, so create
8+
// an empty placeholder to keep the build green.
9+
let csv_path = "contributors.csv";
10+
if !Path::new(csv_path).exists() {
11+
fs::write(csv_path, "").expect("Failed to create placeholder contributors.csv");
12+
}
13+
println!("cargo:rerun-if-changed=contributors.csv");
14+
}

0 commit comments

Comments
 (0)