rules_scala
rules_scala copied to clipboard
Add compiler source download integrity values
Description
Eliminates the "canonical reproducible form" warnings that often appear for users that enable compiler dependency tracking. Fixes #1743.
Emits a detailed error message if the configured Scala version is unknown to rules_scala, and isn't provided by a
scala_deps.compiler_srcjar object. This message provides guidance on how to create a suitable scala_deps.compiler_srcjar object.
Details:
-
Adds
scripts/update_compiler_sources_integrity.pyto generatescala/private/macros/compiler_sources_integrity.bzl. Refactored code fromscripts/update_protoc_integrity.pyintoscripts/lib/update_integrity.pyfor reuse by the new script. -
Adds
test/shell/test_compiler_sources_integrity.shand adds it totest_rules_scala.sh. Adds thetest/compiler_sources_integrityrepo for use by the new test suite. The test suite is fast due to the test repo only containing an alias to@scala_compiler_sources//:src. -
Fixes a problem with the regex in
run_testsfromtest_helper.shthat prevented the test skipping mechanism from working.
Motivation
This eliminates an annoying warning for users, while providing improved build integrity. Win/win!
The refactoring of common code into scripts/lib eliminated a lot of potential duplication. It's also exposed a common pattern for generating download integrity files for different artifacts.