The turbo task @cipherstash/auth#build:native in turbo.json has two faults. Nothing runs it through turbo yet, so neither has caused a problem. freshtonic found both in review of #1001.
Its cache key misses the stack-auth crate
The task's inputs cover languages/typescript/packages/auth only. The native binding compiles packages/stack-auth through a path dependency, and that folder sits outside the package. So when only the stack-auth crate changes, turbo finds a cache hit and restores the previous *.node binary.
Its outputs include a folder another script builds
The entry lists wasm/** as an output, but build:native does not build wasm/. build:wasm builds it, from ../stack-auth-wasm. So turbo stores whatever wasm/ holds when build:native ends, and a later cache hit can restore a stale copy.
Fix
If a workflow will run this task through turbo, add $TURBO_ROOT$/packages/stack-auth/**, the root Cargo.toml and the root Cargo.lock to its inputs, as the stash#build entry does, and remove wasm/** from its outputs. If nothing will, delete the entry.
The turbo task
@cipherstash/auth#build:nativeinturbo.jsonhas two faults. Nothing runs it through turbo yet, so neither has caused a problem. freshtonic found both in review of #1001.Its cache key misses the stack-auth crate
The task's inputs cover
languages/typescript/packages/authonly. The native binding compilespackages/stack-auththrough a path dependency, and that folder sits outside the package. So when only thestack-authcrate changes, turbo finds a cache hit and restores the previous*.nodebinary.Its outputs include a folder another script builds
The entry lists
wasm/**as an output, butbuild:nativedoes not buildwasm/.build:wasmbuilds it, from../stack-auth-wasm. So turbo stores whateverwasm/holds whenbuild:nativeends, and a later cache hit can restore a stale copy.Fix
If a workflow will run this task through turbo, add
$TURBO_ROOT$/packages/stack-auth/**, the rootCargo.tomland the rootCargo.lockto its inputs, as thestash#buildentry does, and removewasm/**from its outputs. If nothing will, delete the entry.