Ensure that the pom classifier isn't always downloaded#1251
Merged
Conversation
jin
approved these changes
Sep 18, 2024
0da1fb2 to
213ac8f
Compare
This reverts commit 213ac8f. Turns out that we can't use skylib here.
airlock-confluentinc Bot
pushed a commit
to confluentinc/rules_jvm_external
that referenced
this pull request
Sep 19, 2024
Contributor
|
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 |
Contributor
|
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):] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1250