daml/pre-commit/platform-independence-check.sh
Moisés Ackerman 4794454a70
Platform independence pre-check (#17955)
* Rename //bazel_tools:match-{cabal=>golden}-file

* Generate and check hash file for contents of //compiler/damlc/tests:platform-independence.dar

* Add pre-commit hook to test //compiler/damlc/tests:platform-independence-dar-hash-file-matches

* Print info when //bazel_tools:match-golden-file fails

* platform-independence-dar-check pre-commit hook runs depending on env var

* Skip platform-independence-check if RUN_PLATFORM_INDEPENDENCE_CHECK is unset

* Document dar_hash_file rules

* move platform-independence-checks warning to .envrc

* implement generate_dar_hash_file genrule in python

in particular, this allows us to produce the same output on all platforms

* fix windows

* Update rules_daml/daml.bzl

* bytes.replace does not operate in place
2023-12-07 18:18:24 +01:00

10 lines
315 B
Bash
Executable File

#!/usr/bin/env bash
# Copyright (c) 2023 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
set -euo pipefail
if [ "$RUN_PLATFORM_INDEPENDENCE_CHECK" = "yes" ]; then
bazel test //compiler/damlc/tests:platform-independence-dar-hash-file-matches
fi