-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Update Guava to 31.1
.
#14942
Update Guava to 31.1
.
#14942
Conversation
Main motivation is to be able to use the new `ImmutableMap.Builder#buildKeepingLast`. Jars were downloded from Maven Central: * https://repo1.maven.org/maven2/com/google/guava/guava/31.1-jre/ * https://repo1.maven.org/maven2/com/google/guava/guava-testlib/31.1-jre/ This is the same as commit 5d55643, but I'm doing it as a GitHub PR rather than a Gerrit change, so that way we can run it through the CI pipeline and figure out why it didn't work (5d55643 was reverted in b9bfde8).
Main motivation is to be able to use the new `ImmutableMap.Builder#buildKeepingLast`. Jars were downloded from Maven Central: * https://repo1.maven.org/maven2/com/google/guava/guava/31.1-jre/ * https://repo1.maven.org/maven2/com/google/guava/guava-testlib/31.1-jre/ This is the same as commit 5d55643, but I'm doing it as a GitHub PR rather than a Gerrit change, so that way we can run it through the CI pipeline and figure out why it didn't work (5d55643 was reverted in b9bfde8).
Hi Alex and Kevin. Looks like some GitHub automation added you because I modified Just a heads up that this PR isn't complete yet. If my modification to that |
third_party/BUILD
Outdated
@@ -499,7 +499,10 @@ distrib_java_import( | |||
# For bootstrapping JavaBuilder | |||
distrib_jar_filegroup( | |||
name = "guava-jars", | |||
srcs = ["guava/guava-31.0.1-jre.jar"], | |||
srcs = [ | |||
"guava/failureaccess-1.0.1.jar", |
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.
You probably need to split this into two filegroups
filegroup(
name = "guava-jar",
srcs = ["guava/guava-31.1-jre.jar"],
)
filegroup(
name = "guava-failureaccess-jar",
srcs = ["guava/guava-31.1-jre.jar"],
)
distrib_jar_filegroup(
name = "guava-jars",
srcs = [
":guava-jar",
":guava-failureaccess-jar",
],
enable_distributions = ["debian"],
)
Then you can add them separately above:
"--classpath_entry $(location //third_party:guava-jar) " +
"--classpath_entry $(location //third_party:guava-failureaccess-jar) " +
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.
Experimentally, it seems like it's not necessary to do literally that. 6fbe89e
passes CI. Is that commit fine? And do I really need to have used distrib_jar_filegroup
for the new //third_party:guava-failureaccess-jar
?
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.
Also, if srcs
in :guava-jars
has more than one element then we run into the issue mentioned in b98be959
.
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 see, it looks good. Using distrib_jar_filegroup
is for the Bazel Debian build to switch to system installed libraries easily (eg. /usr/share/java/guava.jar
), it's better to keep this pattern in case we want to package a new Bazel for Debian.
`//src/test/java/com/google/devtools/build/android/desugar:desugar_guava_at_head` working. Let's see if CI likes this. If so, I'll explain my understanding of what's going on here based on the discussion with coworkers today.
Okay, @meteorcloudy Is the restriction mentioned in #14357 (comment) still a thing? If so, I will need to do 3 PRs: One to add a new |
Yes, #14357 (comment) is still true, what you described sounds good to me! |
@cushon and @michajlo figured this out. Guava 31.1 newly contains google/guava@46093e2. They verified that code causes the Desugaring step at
InternalFutureFailureAccess , whereas it previously didn't need that class. So we now need to make sure Desugar has the jar containing that class on its classpath.
|
My sequence of changes needs to involve 5 commits. @katre advised me to do 5 separate PRs, so that he can vet and merge each one separately. So I'll close this one and then mail those out. |
This is commit 1/5 for #14942 (comment).
`//src/test/java/com/google/devtools/build/android/desugar:desugar_guava_at_head`. This is commit 2/5 for #14942 (comment).
`//src/test/java/com/google/devtools/build/android/desugar:desugar_guava_at_head`. This is commit 2/5 for #14942 (comment).
Main motivation is to be able to use the new `ImmutableMap.Builder#buildKeepingLast`. Jars were downloded from Maven Central: * https://repo1.maven.org/maven2/com/google/guava/guava/31.1-jre/ * https://repo1.maven.org/maven2/com/google/guava/guava-testlib/31.1-jre/ This is commit 3/5 for #14942 (comment).
Main motivation is to be able to use the new `ImmutableMap.Builder#buildKeepingLast`. Jars were downloded from Maven Central: * https://repo1.maven.org/maven2/com/google/guava/guava/31.1-jre/ * https://repo1.maven.org/maven2/com/google/guava/guava-testlib/31.1-jre/ This is commit 3/5 for #14942 (comment).
This is commit 1/5 for #14942 (comment).
…st/java/com/google/devtools/build/android/desugar:desugar_guava_at_head`. This is commit 2/5 for #14942 (comment). Closes #14961. PiperOrigin-RevId: 432507064
Main motivation is to be able to use the new `ImmutableMap.Builder#buildKeepingLast`. Jars were downloded from Maven Central: * https://repo1.maven.org/maven2/com/google/guava/guava/31.1-jre/ * https://repo1.maven.org/maven2/com/google/guava/guava-testlib/31.1-jre/ This is commit 3/5 for #14942 (comment). Closes #14962.
This is commit 4/5 for #14942 (comment). Closes #14963. PiperOrigin-RevId: 432530027
Main motivation is to be able to use the new
ImmutableMap.Builder#buildKeepingLast
.Jars were downloded from Maven Central:
This is the same as commit 5d55643, but I'm doing it as a GitHub PR
rather than a Gerrit change, so that way we can run it through the CI
pipeline and figure out why it didn't work (5d55643 was reverted in
b9bfde8).