mirror of
https://github.com/ipetkov/crane.git
synced 2024-11-29 10:42:21 +03:00
15 lines
410 B
Nix
15 lines
410 B
Nix
|
{ writeShellScript
|
||
|
}:
|
||
|
|
||
|
# A rustc wrapper which can conditionally refuse to re-build crates.
|
||
|
# Useful for testing that artifact caching isn't somehow broken
|
||
|
writeShellScript "rustc-wrapper" ''
|
||
|
# Let through any cargo introspection calls
|
||
|
if [[ -z "''${__CRANE_DENY_COMPILATION:-}" || "''${2:-}" == "-vV" || "''${4:-}" == "___" ]]; then
|
||
|
exec "$@"
|
||
|
fi
|
||
|
|
||
|
>&2 echo "recompilation forbiden: $*"
|
||
|
exit 1
|
||
|
''
|