# kache-e2e fixture: a DEBUG-profile Rust build.
#
# Every other Rust fixture builds `cargo build --release` — and the
# release profile has `debug = false`, so it emits no debug info at
# all. This is the debug-profile cell: it exercises caching and
# cross-path restore of debug `.rlib` / `.rmeta` / `.d` artifacts,
# which carry DWARF and dep-info — exactly where the hard path-leak
# and stale-restore bugs live (#100, #104).
#
# Deliberately NO `[diff]` and NO `forbidden_substrings`: on macOS a
# debug *executable* embeds an `N_OSO` debug map whose paths are not
# yet normalized (the deferred OSO work), so the binary is not
# byte-identical across build paths. The dependency's debug `.rlib`
# IS path-portable — that is what this fixture verifies, via the
# relocate phase and the direct dep-info check.

name = "e2e-rust-debug"
tags = ["suite:e2e", "lang:rust"]

# Restored dep-info must be path-expanded, not left relativized. Debug
# builds are precisely where the #100 silent-restore bug bit.
check_depinfo = true

[source]
kind = "fixture"
path = "source"

[env]
RUSTC_WRAPPER = "$KACHE"

[commands]
# DEBUG build — no `--release`. That is the entire point of the fixture.
build = "cargo build"
clean = "rm -rf target"

[verify]
run = "./target/debug/rust-debug"
expected_stdout_contains = ["rust-debug: 42"]

[assertions.cold]
# Cold build populates the cache — the `itoa` dependency at least.
min_entries_after = 1

[assertions.warm]
# A clean rebuild restores the cached dependency.
min_hits = 1

[assertions.noop]
# A no-op rebuild after a warm build must not recompile.
should_not_recompile = true
recompile_marker = "Compiling"

# Same source built from a *different* absolute path against the same
# cache. The dependency's debug `.rlib` must still hit — debug builds
# are path-portable too (DWARF remapped, dep-info expanded). Strict
# zero-miss: a debug-specific path leak would surface as a miss here.
[assertions.relocate]
min_hits = 1
max_misses = 0
