• Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Blocker Blocker
    • xcode-plugin
    • SLES 11 SP2 for jenkins Server
      Mac OS X Mavericks with xcode 6 on build machine

      We have several components to build in one Jenkins job calling the xCode plugin several times
      The first two builds work, however the 3rd instance of the build gets stuck after the clean and never gets to the build step
      First build:
      [openssl-ios] $ /usr/bin/xcodebuild -version
      Xcode 6.0.1
      Build version 6A317
      Cleaning build directory: /Users/Jenkins/Ansible/Mobile3rdParty/openssl-ios/build/Release-iphoneos
      ===========================================================
      == Available provisioning profiles
      [openssl-ios] $ /usr/bin/security find-identity -p codesigning -v
      1) A0C22EDB47D2DFC413DCD56967B86D28B1374342 "Developer ID Application: Siemens Enterprise Communications GmbH & Co. KG"
      2) C19DB47077CAC502936224069C5218D77D163404 "iPhone Developer: Simon Hall (BDNNEYZ3AQ)"
      3) F25A1E6F9A4774208A8C590C1953493BDEE6F005 "iPhone Distribution: Siemens Enterprise Communications, Inc."
      3 valid identities found
      == Available SDKs
      [openssl-ios] $ /usr/bin/xcodebuild -showsdks
      OS X SDKs:
      OS X 10.9 -sdk macosx10.9

      iOS SDKs:
      iOS 8.0 -sdk iphoneos8.0

      iOS Simulator SDKs:
      Simulator - iOS 8.0 -sdk iphonesimulator8.0

      == Available schemes
      [openssl-ios] $ /usr/bin/xcodebuild -list -project openssl.xcodeproj
      Information about project "openssl":
      Targets:
      crypto
      ssl

      Build Configurations:
      Debug
      Release
      Distribution

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

      Schemes:
      crypto
      ssl
      ===========================================================
      Going to invoke xcodebuild:target: ALL, sdk: DEFAULT, project: openssl.xcodeproj, configuration: Release, clean: YES, archive:NO, symRoot: DEFAULT, configurationBuildDir: DEFAULT, codeSignIdentity: DEFAULT
      [openssl-ios] $ /usr/bin/xcodebuild -alltargets -project openssl.xcodeproj -configuration Release clean build
      === CLEAN TARGET crypto OF PROJECT openssl WITH CONFIGURATION Release ===

      Second build:
      Cleaning build directory: /Users/Jenkins/Ansible/Mobile3rdParty/ZipArchive/build/Release-iphoneos
      ===========================================================
      == Available provisioning profiles
      [ZipArchive] $ /usr/bin/security find-identity -p codesigning -v
      1) A0C22EDB47D2DFC413DCD56967B86D28B1374342 "Developer ID Application: Siemens Enterprise Communications GmbH & Co. KG"
      2) C19DB47077CAC502936224069C5218D77D163404 "iPhone Developer: Simon Hall (BDNNEYZ3AQ)"
      3) F25A1E6F9A4774208A8C590C1953493BDEE6F005 "iPhone Distribution: Siemens Enterprise Communications, Inc."
      3 valid identities found
      == Available SDKs
      [ZipArchive] $ /usr/bin/xcodebuild -showsdks
      OS X SDKs:
      OS X 10.9 -sdk macosx10.9

      iOS SDKs:
      iOS 8.0 -sdk iphoneos8.0

      iOS Simulator SDKs:
      Simulator - iOS 8.0 -sdk iphonesimulator8.0

      == Available schemes
      [ZipArchive] $ /usr/bin/xcodebuild -list -project ZipArchive.xcodeproj
      Information about project "ZipArchive":
      Targets:
      ZipArchive

      Build Configurations:
      Debug
      Distribution
      Release

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

      Schemes:
      ZipArchive
      ===========================================================
      Going to invoke xcodebuild:target: ZipArchive, sdk: DEFAULT, project: ZipArchive.xcodeproj, configuration: Release, clean: YES, archive:NO, symRoot: DEFAULT, configurationBuildDir: DEFAULT, codeSignIdentity: DEFAULT
      [ZipArchive] $ /usr/bin/xcodebuild -target ZipArchive -project ZipArchive.xcodeproj -configuration Release clean build
      === CLEAN TARGET ZipArchive OF PROJECT ZipArchive WITH CONFIGURATION Release ===

      Third build:
      Cleaning build directory: /Users/Jenkins/Ansible/Mobile3rdParty/WebRTC/trunk/build/Release-iphoneos
      ===========================================================
      == Available provisioning profiles
      [trunk] $ /usr/bin/security find-identity -p codesigning -v
      1) A0C22EDB47D2DFC413DCD56967B86D28B1374342 "Developer ID Application: Siemens Enterprise Communications GmbH & Co. KG"
      2) C19DB47077CAC502936224069C5218D77D163404 "iPhone Developer: Simon Hall (BDNNEYZ3AQ)"
      3) F25A1E6F9A4774208A8C590C1953493BDEE6F005 "iPhone Distribution: Siemens Enterprise Communications, Inc."
      3 valid identities found
      == Available SDKs
      [trunk] $ /usr/bin/xcodebuild -showsdks
      OS X SDKs:
      OS X 10.9 -sdk macosx10.9

      iOS SDKs:
      iOS 8.0 -sdk iphoneos8.0

      iOS Simulator SDKs:
      Simulator - iOS 8.0 -sdk iphonesimulator8.0

      == Available schemes
      [trunk] $ /usr/bin/xcodebuild -list -project all.xcodeproj
      Information about project "all":
      Targets:
      All

      Build Configurations:
      Debug
      Profile
      Release

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

      Build is stuck
      It is called with configuration Release and target All but never kicks off the real build

      Let me know if I need to provide more information

          [JENKINS-24874] Xcode plugin hangs when using xcode6

          handy wang added a comment -

          The solution which Johanna Wolf mentioned works for me, thanks a lot lot lot lot lot lot lot lot lot lot lot lot lot! Really, help for me!

          handy wang added a comment - The solution which Johanna Wolf mentioned works for me, thanks a lot lot lot lot lot lot lot lot lot lot lot lot lot! Really, help for me!

          Michael Loo added a comment -

          Awesome, that worked for me as well

          Michael Loo added a comment - Awesome, that worked for me as well

          lacostej added a comment - - edited

          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 ?

          lacostej added a comment - - edited 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 ?

          lacostej added a comment - - edited

          And I also tried building through jenkins to check if this was a stream consumption issue.

          lacostej added a comment - - edited And I also tried building through jenkins to check if this was a stream consumption issue.

          Raphael Couto added a comment -

          We are trying to automate a cordova a build. Cordova ios project do not have scheme files/dir.

          xcodebuild -list "hangs".

          Raphael Couto added a comment - We are trying to automate a cordova a build. Cordova ios project do not have scheme files/dir. xcodebuild -list "hangs".

          lacostej added a comment -

          Raphael, are you able to either

          • give me a reproducible project (or access to one) (preferred)
          • test some custom builds of the plugin ?

          lacostej added a comment - Raphael, are you able to either give me a reproducible project (or access to one) (preferred) test some custom builds of the plugin ?

          Raphael Couto added a comment -

          lacostej,

          Any cordova project (hello word) you can use.
          You need to install node, npm, and cordova (sudo npm -g install cordova)
          Create a project:
          cordova create testproj (this will create a hello word project)

          We use plugin "Workspace Cleanup Plugin" enabled.

          First step of build: shell execute:

          "
          export PATH=$PATH:/usr/local/bin:/App/android-sdk-macosx/tools:/App/android-sdk-macosx/platform-tools:/App/apache-ant-1.9.4/bin
          cordova platform add ios
          cordova prepare ios
          "

          Next build step is xcode-plugin.

          Raphael Couto added a comment - lacostej, Any cordova project (hello word) you can use. You need to install node, npm, and cordova (sudo npm -g install cordova) Create a project: cordova create testproj (this will create a hello word project) We use plugin "Workspace Cleanup Plugin" enabled. First step of build: shell execute: " export PATH=$PATH:/usr/local/bin:/App/android-sdk-macosx/tools:/App/android-sdk-macosx/platform-tools:/App/apache-ant-1.9.4/bin cordova platform add ios cordova prepare ios " Next build step is xcode-plugin.

          Raphael Couto added a comment -

          Raphael Couto added a comment - I've tested https://github.com/timothy-volvo/xcode-plugin No success.

          Raphael Couto added a comment - - edited

          lacostej,

          I've forked the project at github (https://github.com/raphaelquati/xcode-plugin), and tested your patch (you wrote in early comments).
          I've made little changes in the code.

          Now the build is working.

          I've created an pull request.

          Raphael Couto added a comment - - edited lacostej, I've forked the project at github ( https://github.com/raphaelquati/xcode-plugin ), and tested your patch (you wrote in early comments). I've made little changes in the code. Now the build is working. I've created an pull request.

          lacostej added a comment -

          I merged the PR and am ready to release 1.4.8. I can't right now because of some infra issues on artifactory.

          I also updated the WIKI.

          Raphael thanks!

          lacostej added a comment - I merged the PR and am ready to release 1.4.8. I can't right now because of some infra issues on artifactory. I also updated the WIKI. Raphael thanks!

            Unassigned Unassigned
            rkarbas Reinhard Karbas
            Votes:
            3 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: