lacostej edited a comment on Bug JENKINS-24874

I would like to implement a fix for this with something like

diff --git a/src/main/java/au/com/rayh/XCodeBuilder.java b/src/main/java/au/com/rayh/XCodeBuilder.java
index 5be9898..3ca1cc3 100644
--- a/src/main/java/au/com/rayh/XCodeBuilder.java
+++ b/src/main/java/au/com/rayh/XCodeBuilder.java
@@ -32,6 +32,7 @@ import hudson.Launcher;
 import hudson.model.AbstractBuild;
 import hudson.model.AbstractProject;
 import hudson.model.BuildListener;
+import hudson.model.TaskListener;
 import hudson.tasks.BuildStepDescriptor;
 import hudson.tasks.Builder;
 import hudson.util.CopyOnWriteList;
@@ -51,6 +52,7 @@ import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
 import java.util.UUID;
+import java.util.concurrent.TimeUnit;
 
 /**
  * @author Ray Hilton
@@ -478,7 +480,8 @@ public class XCodeBuilder extends Builder {
                 commandLine.add("-project");
                 commandLine.add(xcodeProjectFile);
             }
-            returnCode = launcher.launch().envs(envs).cmds(commandLine).stdout(listener).pwd(projectRoot).join();
+            // xcode 6 can timeout upon listing the environment. Let's use a default harcoded timeout.
+            returnCode = launcher.launch().envs(envs).cmds(commandLine).stdout(listener).pwd(projectRoot).start().joinWithTimeout(10, TimeUnit.SECONDS, listener);
             if (returnCode > 0) return false;
         }
         listener.getLogger().println(Messages.XCodeBuilder_DebugInfoLineDelimiter());

(it would require an adapted listener to handle the error appropriately and display a tip.

But I am unable to create a case so far.

I tested the following on the command line:

me@here ~/ echo $DEVELOPER_DIR
/Applications/Xcode6.0.1.app/Contents/Developer 
me@here ~/  xcodebuild -version
Xcode 6.0.1
Build version 6A317
me@here ~/ xcodebuild -list 
Information about project "Unity-iPhone":
    Targets:
        Unity-iPhone
        Unity-iPhone Tests

    Build Configurations:
        Release
        Debug

    If no build configuration is specified and -scheme is not passed then "Release" is used.

    Schemes:
        Unity-iPhone
me@here ~/ mv ./Unity-iPhone.xcodeproj/xcshareddata/xcschemes/Unity-iPhone.xcscheme ..
me@here ~/ xcodebuild -list 
Information about project "Unity-iPhone":
    Targets:
        Unity-iPhone
        Unity-iPhone Tests

    Build Configurations:
        Release
        Debug

    If no build configuration is specified and -scheme is not passed then "Release" is used.

    This project contains no schemes.
me@here ~/ mv ../Unity-iPhone.xcscheme ./Unity-iPhone.xcodeproj/xcshareddata/xcschemes/
me@here ~/ mv ./Unity-iPhone.xcodeproj/xcshareddata ..
me@here ~/ xcodebuild -list 
Information about project "Unity-iPhone":
    Targets:
        Unity-iPhone
        Unity-iPhone Tests

    Build Configurations:
        Release
        Debug

    If no build configuration is specified and -scheme is not passed then "Release" is used.

    This project contains no schemes.
me@here ~/ xcodebuild -list -project Unity-iPhone.xcodeproj
Information about project "Unity-iPhone":
    Targets:
        Unity-iPhone
        Unity-iPhone Tests

    Build Configurations:
        Release
        Debug

    If no build configuration is specified and -scheme is not passed then "Release" is used.

    This project contains no schemes.

So I am unable to get xcodebuild -list to hang even if I remove the whole ./Unity-iPhone.xcodeproj/xcshareddata/

Any tip ?

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to