-
-
Notifications
You must be signed in to change notification settings - Fork 644
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds excludes
field to jvm_artifact
targets
#14715
Adds excludes
field to jvm_artifact
targets
#14715
Conversation
# Building wheels and fs_util will be skipped. Delete if not intended. [ci skip-build-wheels] # Rust tests and lints will be skipped. Delete if not intended. [ci skip-rust]
It doesn't look like we need to amend Please correct me if this is not actually correct. |
"This does not prevent this artifact from being included in the resolve as a dependency " | ||
"of other artifacts that depend on it, and is currently intended as a way to resolve " | ||
"version conflicts in complex resolves.\n\n" | ||
"These values are passed directly to Coursier, and if specified incorrectly will show a " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be possible to do some rudimentary sanity checking of this value, if defined, but given we don't actually implement the parse algorithm ourselves, there are limits here.
The Coursier error message is actually quite bad when parses fail (you get java.lang.String@0xetc
representations instead of the actual string values in the exception logs). I'll report (and patch?!) that upstream, where we can probably get a more reasonable error message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -320,9 +353,12 @@ async def prepare_coursier_resolve_info( | |||
|
|||
to_resolve = chain(no_jars, resolvable_jar_requirements) | |||
|
|||
digest = await Get(Digest, MergeDigests([jar_files.snapshot.digest, excludes_digest])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
excludes_digest
is usually empty, I'm not sure if it's worth making this merge conditional for performance, but the code is cleaner if we always run, even in no-op cases.
…to None. # Rust tests and lints will be skipped. Delete if not intended. [ci skip-rust] # Building wheels and fs_util will be skipped. Delete if not intended. [ci skip-build-wheels]
# Rust tests and lints will be skipped. Delete if not intended. [ci skip-rust] # Building wheels and fs_util will be skipped. Delete if not intended. [ci skip-build-wheels]
src/python/pants/jvm/target_types.py
Outdated
@@ -168,6 +168,19 @@ class JvmProvidesTypesField(StringSequenceField): | |||
) | |||
|
|||
|
|||
class JvmArtifactExcludeDependenciesField(StringSequenceField): | |||
alias = "exclude_dependencies" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This equivalent field in Pants v1 was called excludes
. exclude_dependencies
seems wordy. Any reason to not use the same name as from v1?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it wasn't immediately clear to me what we would be excluding, but if we're happy with excludes
we can go with it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I've made that change)
# Rust tests and lints will be skipped. Delete if not intended. [ci skip-rust] # Building wheels and fs_util will be skipped. Delete if not intended. [ci skip-build-wheels]
exclude_dependencies
field to jvm_artifact
targetsexcludes
field to jvm_artifact
targets
# Rust tests and lints will be skipped. Delete if not intended. [ci skip-rust] # Building wheels and fs_util will be skipped. Delete if not intended. [ci skip-build-wheels]
Adds
exclude_dependencies
, which accepts unversioned coordinates to exclude as transitive dependencies of that artifact. This is passed to Coursier's--local-excludes-file
at resolve time, so it's excluded in the lockfile. Consequently, we also add excludes to the metadata string for lockfiles.Closes #13683.