Skip to content
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

Fails on Windows with Guava 32.0.0 #737

Open
Bananeweizen opened this issue Jun 1, 2023 · 5 comments
Open

Fails on Windows with Guava 32.0.0 #737

Bananeweizen opened this issue Jun 1, 2023 · 5 comments
Labels
bug Create a report to help us improve

Comments

@Bananeweizen
Copy link

Run Jenkins 2.407 with the Artifactory plugin containing this code, on a Windows machine. That leads to exceptions because some methods in Guava 32.0.0 simply don't work anymore on Windows. Older versions of Jenkins core contained Guava 31.x and therefore work fine.

Jenkins bug: https://issues.jenkins.io/browse/JENKINS-71375
Guava change describing the non-working behavior: google/guava@3dfe363

The Jenkins core developers recommend removing Guava from Jenkins plugins. I support that opinion.

@Bananeweizen Bananeweizen added the bug Create a report to help us improve label Jun 1, 2023
@basil
Copy link

basil commented Jun 6, 2023

Suggest the following patch:

diff --git a/build-info-extractor/src/main/java/org/jfrog/build/extractor/clientConfiguration/util/DependenciesDownloaderHelper.java b/build-info-extractor/src/main/java/org/jfrog/build/extractor/clientConfiguration/util/DependenciesDownloaderHelper.java
index f74280ba..a1210ac7 100644
--- a/build-info-extractor/src/main/java/org/jfrog/build/extractor/clientConfiguration/util/DependenciesDownloaderHelper.java
+++ b/build-info-extractor/src/main/java/org/jfrog/build/extractor/clientConfiguration/util/DependenciesDownloaderHelper.java
@@ -1,6 +1,6 @@
 package org.jfrog.build.extractor.clientConfiguration.util;
 
-import com.google.common.io.Files;
+import java.nio.file.Files;
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.io.IOUtils;
 import org.apache.commons.lang3.BooleanUtils;
@@ -245,7 +245,7 @@ public class DependenciesDownloaderHelper {
     protected Map<String, String> downloadFileConcurrently(final String uriWithParams, long fileSize, final String fileDestination, String filePath)
             throws Exception {
         String[] downloadedFilesPaths;
-        File tempDir = Files.createTempDir();
+        File tempDir = Files.createTempDirectory(null).toFile();
         String tempPath = tempDir.getPath() + File.separatorChar + filePath;
         try {
             downloadedFilesPaths = doConcurrentDownload(fileSize, uriWithParams, tempPath);

@cpovirk
Copy link

cpovirk commented Jun 7, 2023

As the Guava developer responsible for this, I apologize for the trouble. I endorse the patch above, and I am working to fix this in Guava for anyone who isn't in a position to make such changes.

@cpovirk
Copy link

cpovirk commented Jun 9, 2023

The Guava fix is released for anyone who needs it: https://github.com/google/guava/releases/tag/v32.0.1

@cpovirk
Copy link

cpovirk commented Jul 13, 2023

Even with the Guava fix in place, we got another report of trouble from a Jenkins user with a slightly unusual setup (specifically, running as a Windows service). There may still be something that we can do about it on the Guava side, but if JFrog can apply the patch above, that would definitely solve that part of the problem.

@yahavi
Copy link
Member

yahavi commented Jul 13, 2023

Thanks for the information, @cpovirk.
Are you interested in making a contribution by submitting a pull request to address this problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Create a report to help us improve
Projects
None yet
Development

No branches or pull requests

4 participants