MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / main

Function main

build.rs:411–455  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

409}
410
411fn main() {
412 generate_skill_bundle();
413 let out_path = Path::new("src/resources/logo.ansi");
414 let logo_bytes = include_bytes!("src/resources/logo.png");
415 let ansi = logo_art::image_to_ansi(logo_bytes, 90);
416 // Only rewrite when the content differs: `cargo package` verification
417 // rejects packages whose build script modifies files in the source dir.
418 if !matches!(fs::read(out_path), Ok(current) if current == ansi.as_bytes()) {
419 if let Err(e) = fs::write(out_path, &ansi) {
420 panic!("failed to write {}: {e}", out_path.display());
421 }
422 }
423 println!("cargo::rerun-if-changed=src/resources/logo.png");
424 let asset_stamp = emit_dashboard_asset_inputs();
425 println!("cargo::rustc-env=TRACEDECAY_DASHBOARD_ASSET_STAMP={asset_stamp}");
426
427 // Generator provenance: baked into generated agent plugins (manifest +
428 // module header) so a stale installed plugin is distinguishable from
429 // the binary that should have generated it. Advisory only — may lag a
430 // commit until the next build-script rerun.
431 let git_sha = Command::new("git")
432 .args(["rev-parse", "--short=12", "HEAD"])
433 .output()
434 .ok()
435 .filter(|out| out.status.success())
436 .map(|out| String::from_utf8_lossy(&out.stdout).trim().to_string())
437 .filter(|sha| !sha.is_empty())
438 .unwrap_or_else(|| "unknown".to_string());
439 println!("cargo::rustc-env=TRACEDECAY_GIT_SHA={git_sha}");
440
441 // Vendored WGSL grammar — compiled only when lang-wgsl is enabled.
442 // Using vendored sources avoids pulling in tree-sitter-wgsl 0.0.6 which was
443 // built against the incompatible tree-sitter 0.20 API.
444 if std::env::var("CARGO_FEATURE_LANG_WGSL").is_ok() {
445 let wgsl_dir = Path::new("vendor/tree-sitter-wgsl/src");
446 cc::Build::new()
447 .include(wgsl_dir)
448 .file(wgsl_dir.join("parser.c"))
449 .file(wgsl_dir.join("scanner.c"))
450 .warnings(false)
451 .compile("tree_sitter_wgsl");
452 println!("cargo::rerun-if-changed=vendor/tree-sitter-wgsl/src/parser.c");
453 println!("cargo::rerun-if-changed=vendor/tree-sitter-wgsl/src/scanner.c");
454 }
455}

Callers

nothing calls this directly

Calls 7

generate_skill_bundleFunction · 0.85
writeFunction · 0.85
outputMethod · 0.80
successMethod · 0.80
is_okMethod · 0.80
is_emptyMethod · 0.45

Tested by

no test coverage detected