diff --git a/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDelegatorFunction.java b/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDelegatorFunction.java index aa92bfd1a6db34..a8e2a081455c60 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDelegatorFunction.java +++ b/src/main/java/com/google/devtools/build/lib/rules/repository/RepositoryDelegatorFunction.java @@ -507,14 +507,15 @@ static String unescape(String str) { private static class DigestWriter { private final Path markerPath; private final Rule rule; - private final Map markerData; + // not just Map<> to signal that iteration order must be deterministic + private final TreeMap markerData; private final String ruleKey; DigestWriter(BlazeDirectories directories, RepositoryName repositoryName, Rule rule) { ruleKey = computeRuleKey(rule); markerPath = getMarkerPath(directories, repositoryName.getName()); this.rule = rule; - markerData = Maps.newHashMap(); + markerData = Maps.newTreeMap(); } byte[] writeMarkerFile() throws RepositoryFunctionException {