Closed shs96c closed 2 months ago
Not exactly sure how it happens, but I think this change results in duplicated symlink creation, which obviously fails. It seems duplicated entries appear in amended_deps
.
I tried this patch and it worked:
diff --git a/private/rules/coursier.bzl b/private/rules/coursier.bzl
index 530a90b..28e3746 100644
--- a/private/rules/coursier.bzl
+++ b/private/rules/coursier.bzl
@@ -954,6 +954,8 @@ def rewrite_files_attribute_if_necessary(repository_ctx, dep_tree):
# `pinned_maven_install`. Oh well, let's just do this the manual way.
if dep["file"].endswith(".pom"):
jar_path = dep["file"].removesuffix(".pom") + ".jar"
+ if is_dep(jar_path, amended_deps):
+ continue
if repository_ctx.path(jar_path).exists:
dep["file"] = jar_path
@@ -963,6 +965,12 @@ def rewrite_files_attribute_if_necessary(repository_ctx, dep_tree):
return dep_tree
+def is_dep(jar_path, deps):
+ for dep in reversed(deps):
+ if jar_path == dep.get("file", None):
+ return True
+ return False
+
def remove_prefix(s, prefix):
if s.startswith(prefix):
return s[len(prefix):]
Closes #1250