rules_scala icon indicating copy to clipboard operation
rules_scala copied to clipboard

Add compiler source download integrity values

Open mbland opened this issue 5 months ago • 1 comments
trafficstars

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.py to generate scala/private/macros/compiler_sources_integrity.bzl. Refactored code from scripts/update_protoc_integrity.py into scripts/lib/update_integrity.py for reuse by the new script.

  • Adds test/shell/test_compiler_sources_integrity.sh and adds it to test_rules_scala.sh. Adds the test/compiler_sources_integrity repo 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_tests from test_helper.sh that 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.

mbland avatar Jun 15 '25 22:06 mbland