From aab3aff529d98080e386dd30bf9879bdabc0e7b4 Mon Sep 17 00:00:00 2001 From: timothy Date: Thu, 11 Apr 2024 10:44:09 +0700 Subject: [PATCH] fix: bazel 7.2.0 issue --- scala/workers/deps/DepsRunner.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scala/workers/deps/DepsRunner.scala b/scala/workers/deps/DepsRunner.scala index 8b3a86d0..1d5ac16c 100644 --- a/scala/workers/deps/DepsRunner.scala +++ b/scala/workers/deps/DepsRunner.scala @@ -92,6 +92,7 @@ object DepsRunner extends WorkerMain[Unit]: val depLabel = group.label.tail match case label if label.startsWith("@@//") => label.drop(2) case label if label.startsWith("@//") => label.drop(1) + case label if label.startsWith("@@") => label.drop(1) case label => label depLabelsMap.put(depLabel, group.jars.toSet) @@ -118,13 +119,12 @@ object DepsRunner extends WorkerMain[Unit]: val unusedWhitelist = workArgs.unusedWhitelist.map(_.tail) usedPaths .diff(Set.concat(directLabels, unusedWhitelist).flatMap(depLabelToPaths)) - .flatMap { path => + .flatMap: path => pathToLabel.get(path) match case res @ None => System.err.println(s"Warning: There is a reference to $path, but no dependency of $label provides it") res case res => res - } else Nil for depLabel <- add do println(s"Target '$depLabel' is used but isn't explicitly declared, please add it to the deps.")