Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-17457

get a "non-existing directory" problem when making an IPA after building a workspace.

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • xcode-plugin
    • None
    • Xcode 4.6.1

      I'm using cocoapods for dependency management. It requires that apps get build using a workspace file, instead of a regular project file. And it adds a "Pods" project into that workspace, which is used by my app.

      So, in my xcode settings in the Jenkins job, the only things I set are the "schema" and "workspace" settings. It builds the app just fine, but the "Build IPA" step fails.

      The message that I get is:
      Cannot remove *.ipa files from a non-existing directory: /Users/jenkins/.jenkins/jobs/myapp/workspace/build/-iphoneos

      So, it appears that it expects my app to exist in a directory named "build", relative to my project. And since I'm not specifying configuration, there's no "Release" in front of the "-iphoneos" part of the path.

      So, is there anything I can do to fix this?

          [JENKINS-17457] get a "non-existing directory" problem when making an IPA after building a workspace.

          Dan Morrow created issue -
          Dan Morrow made changes -
          Link New: This issue is related to JENKINS-17455 [ JENKINS-17455 ]

          david clark added a comment -

          I am having a similar issue. I am not using cocoapods, and I have specified a value for configuration, but I have set it to ${Environment} a variable that I set earlier. The message that I get is:

          Cannot remove *.ipa files from a non-existing directory: /Users/Shared/Jenkins/Home/jobs/HotelSearch_iPhone_stage/workspace/build/${Environment}-iphoneos

          Environment is set to Stage and the directory /Users/Shared/Jenkins/Home/jobs/HotelSearch_iPhone_stage/workspace/build/Stage-iphoneos does exist.

          BTW: for your issue Dan, as a workaround, what happens if you do just specify Release for configuration? Does it break the workspace build?

          david clark added a comment - I am having a similar issue. I am not using cocoapods, and I have specified a value for configuration, but I have set it to ${Environment} a variable that I set earlier. The message that I get is: Cannot remove *.ipa files from a non-existing directory: /Users/Shared/Jenkins/Home/jobs/HotelSearch_iPhone_stage/workspace/build/${Environment}-iphoneos Environment is set to Stage and the directory /Users/Shared/Jenkins/Home/jobs/HotelSearch_iPhone_stage/workspace/build/Stage-iphoneos does exist. BTW: for your issue Dan, as a workaround, what happens if you do just specify Release for configuration? Does it break the workspace build?

          lacostej added a comment -

          Could you try with 1.3.3 ? Variable expansion was improved.

          lacostej added a comment - Could you try with 1.3.3 ? Variable expansion was improved.

          Wil Ferrel added a comment - - edited

          I have received this error also with version 1.4.1 has this been addressed or is there a workaround?

          Build directory does not exist at /Users/Shared/Jenkins/Home/jobs/xxxxxxx/workspace/build/Release-iphoneos. Potential configuration
          

          This is a project using Cocoapods. If I deselect build ipa the build succeeds.

          any suggestions @lacostej

          Wil Ferrel added a comment - - edited I have received this error also with version 1.4.1 has this been addressed or is there a workaround? Build directory does not exist at /Users/Shared/Jenkins/Home/jobs/xxxxxxx/workspace/build/Release-iphoneos. Potential configuration This is a project using Cocoapods. If I deselect build ipa the build succeeds. any suggestions @lacostej

          Esteban Bouza added a comment - - edited

          I am having the same issue building a project with Cocoapods. @Wil Ferrel as a workaround what you can do meanwhile is to set "Build output directory" to ${WORKSPACE}/build/
          This will place the built product in a location the XCode plugin can find later for the ipa.

          Esteban Bouza added a comment - - edited I am having the same issue building a project with Cocoapods. @Wil Ferrel as a workaround what you can do meanwhile is to set "Build output directory" to ${WORKSPACE}/build/ This will place the built product in a location the XCode plugin can find later for the ipa.

          lacostej added a comment -

          A project exhibiting the issue

          lacostej added a comment - A project exhibiting the issue
          lacostej made changes -
          Attachment New: JENKINS-17457.zip [ 28171 ]

          lacostej added a comment - - edited

          Here are my findings so far:

          1. if we don't specify the -configuration argument, as the plugin doesn't try to infer xcodebuild defaults configuration for the command line, the plugin creates an invalid buildDirectory
          2. we could try to extract this information from the project/workspace, but I haven't managed to get xcodebuild to behave as it says it should when building a project without specifying the configuration (I mailed the xcode-users list about it for clarification, the conversation will appear on http://lists.apple.com/archives/xcode-users/2014/Dec/index.html)
          3. if you don't specify the BUILD_CONFIGURATION_DIR, xcode will build under some temporary directory that isn't under jenkins workspace (DerivedData etc). So even if jenkins created (mkdir) the missing default directory given "default configuration (infered) + buildPlatform" it isn't searching for the build apps under the right directory
            List<FilePath> apps = buildDirectory.list(new AppFileFilter());
          4. the ipa directory will be under the build configuration dir

          I have to think about it more, but I think the simplest is to force the user to specify the BUILD_CONFIGURATION_DIR when selecting the generate IPA option or provide a good default. I am not sure why the other case (let xcode use his own DerivedData dirs) would be useful.

          lacostej added a comment - - edited Here are my findings so far: if we don't specify the -configuration argument, as the plugin doesn't try to infer xcodebuild defaults configuration for the command line, the plugin creates an invalid buildDirectory we could try to extract this information from the project/workspace, but I haven't managed to get xcodebuild to behave as it says it should when building a project without specifying the configuration (I mailed the xcode-users list about it for clarification, the conversation will appear on http://lists.apple.com/archives/xcode-users/2014/Dec/index.html ) if you don't specify the BUILD_CONFIGURATION_DIR, xcode will build under some temporary directory that isn't under jenkins workspace (DerivedData etc). So even if jenkins created (mkdir) the missing default directory given "default configuration (infered) + buildPlatform" it isn't searching for the build apps under the right directory List<FilePath> apps = buildDirectory.list(new AppFileFilter()); the ipa directory will be under the build configuration dir I have to think about it more, but I think the simplest is to force the user to specify the BUILD_CONFIGURATION_DIR when selecting the generate IPA option or provide a good default. I am not sure why the other case (let xcode use his own DerivedData dirs) would be useful.
          lacostej made changes -
          Link New: This issue is duplicated by JENKINS-12635 [ JENKINS-12635 ]

            Unassigned Unassigned
            dmorrow Dan Morrow
            Votes:
            8 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated: