crane/checks/rustc-wrapper.nix
Ivan Petkov c97a0c0d83
feature: incremental zstd mode (#398)
---------

Co-authored-by: Dawid Ciężarkiewicz <dpc@dpc.pw>
2023-10-17 19:30:35 -07:00

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
''