-
-
Notifications
You must be signed in to change notification settings - Fork 646
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
[internal] Unify JVM thirdparty resolves #13771
Merged
stuhood
merged 4 commits into
pantsbuild:main
from
stuhood:stuhood/unify-thirdparty-resolves
Dec 1, 2021
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md). | ||
# Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
|
||
jvm_artifact( | ||
name="jackson-databind", | ||
group="com.fasterxml.jackson.core", | ||
artifact="jackson-databind", | ||
# NB: Keep in sync with all other `3rdparty/jvm/com/fasterxml/jackson` libraries. | ||
# See https://github.com/pantsbuild/pants/issues/13767 for how this might be deduped. | ||
version="2.12.4", | ||
) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md). | ||
# Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
|
||
jvm_artifact( | ||
name="jackson-datatype-jdk8", | ||
group="com.fasterxml.jackson.datatype", | ||
artifact="jackson-datatype-jdk8", | ||
# NB: Keep in sync with all other `3rdparty/jvm/com/fasterxml/jackson` libraries. | ||
# See https://github.com/pantsbuild/pants/issues/13767 for how this might be deduped. | ||
version="2.12.4", | ||
) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md). | ||
# Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
|
||
jvm_artifact( | ||
name="javaparser-symbol-solver-core", | ||
group="com.github.javaparser", | ||
artifact="javaparser-symbol-solver-core", | ||
version="3.23.0", | ||
) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md). | ||
# Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
|
||
jvm_artifact( | ||
name="circe-generic", | ||
group="io.circe", | ||
artifact="circe-generic_2.13", | ||
version="0.14.1", | ||
) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md). | ||
# Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
|
||
jvm_artifact( | ||
name="scalameta", | ||
group="org.scalameta", | ||
artifact="scalameta_2.13", | ||
version="4.4.30", | ||
packages=["scala.meta.**"], | ||
) |
File renamed without changes.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,12 @@ | ||
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md). | ||
# Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
|
||
python_sources(dependencies=[":java_src"]) | ||
python_sources(dependencies=[":java_resources"]) | ||
resources(name="java_resources", sources=["*.java", "java_parser.lockfile"]) | ||
python_tests(name="tests", timeout=240) | ||
|
||
resources(name="java_src", sources=["*.java"]) | ||
|
||
# | ||
# Targets for developing on the Java parser outside of engine rules. | ||
# | ||
|
||
java_sources( | ||
name="javaparser", | ||
compatible_resolves=[ | ||
"pants_java_parser", | ||
], | ||
dependencies=[ | ||
# Update in concert with `java_parser_artifact_requirements`. | ||
# TODO: Move these definitions to thirdparty, and add to the thirdparty mapping to | ||
# enable inference. | ||
":com.github.javaparser_javaparser-symbol-solver-core", | ||
":com.fasterxml.jackson.core_jackson-databind", | ||
":com.fasterxml.jackson.datatype_jackson-datatype-jdk8", | ||
], | ||
) | ||
|
||
jvm_artifact( | ||
name="com.github.javaparser_javaparser-symbol-solver-core", | ||
group="com.github.javaparser", | ||
artifact="javaparser-symbol-solver-core", | ||
version="3.23.0", | ||
) | ||
|
||
jvm_artifact( | ||
name="com.fasterxml.jackson.core_jackson-databind", | ||
group="com.fasterxml.jackson.core", | ||
artifact="jackson-databind", | ||
version="2.12.4", | ||
) | ||
|
||
jvm_artifact( | ||
name="com.fasterxml.jackson.datatype_jackson-datatype-jdk8", | ||
group="com.fasterxml.jackson.datatype", | ||
artifact="jackson-datatype-jdk8", | ||
version="2.12.4", | ||
name="java_parser", | ||
compatible_resolves=["java_parser"], | ||
) |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,13 @@ | ||
# Copyright 2021 Pants project contributors (see CONTRIBUTORS.md). | ||
# Licensed under the Apache License, Version 2.0 (see LICENSE). | ||
|
||
python_sources(dependencies=[":scala_sources"]) | ||
python_sources(dependencies=[":scala_resources"]) | ||
resources(name="scala_resources", sources=["*.scala", "scala_parser.lockfile"]) | ||
|
||
python_tests(name="tests", timeout=240) | ||
|
||
resources(name="scala_sources", sources=["*.scala"]) | ||
# Targets for developing on the Scala parser outside of engine rules. | ||
scala_sources( | ||
name="scala_parser", | ||
compatible_resolves=["scala_parser"], | ||
) |
6 changes: 6 additions & 0 deletions
6
src/python/pants/backend/scala/dependency_inference/ScalaParser.scala
This file contains 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
Oops, something went wrong.
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.
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 think it would probably be a better example to have all of the
com.fasterxml.jackson
declarations in the same file -- from a maintenance point of view, the versions of these packages are usually kept in lockstep, and having to change a version in multiple files seems obtuse.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.
Yea, there's an interesting tradeoff there right now which I think that we can maybe remove via #13767: it's not possible to share a variable between different BUILD files without a macro. Allowing macros to be declared hierarchically would help to keep these from going out of sync.
But from experience with a thirdparty layout that had exceptions to the
org
/group
-as-hierarchy (Twitter had ~1k direct thirdparty deps): folks ended up confused about where to put things, and so you ended up with multiple copies of some libraries in parent/child directories. If anything, I'd love to be able to enforce it, although that probably goes too far for casual usage.I'll ... add a comment for now.
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's unfortunate that Jackson has such a fine-grained group structure, which still doesn't make a whole lot of sense to me, tbqh. It really doesn't lend itself well to this multiple files situation.