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

All CVS modules are added as child directories of the job's working directory when specifing a relative path for an ANT build file

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: cvs-plugin
    • Labels:
      None
    • Environment:
      Platform: All, OS: Windows XP
    • Similar Issues:

      Description

      I've created a new Hudson job in 1.220 and added 2 CVS modules to it and I've
      specified an ANT-based build with a specific, relative path for the ANT file:

      CVS modules are: com.profidatalab.nightbird com.xnife.build

      The ANT build file is specified as: com.xnife.build/build.xml

      When I execute the build, it fails with the following console output:

      started
      [workspace] $ cvs -Q -z3 -
      d :pserver:automatedtestuser:automatedtestpassword@cvs:/cvsrepos co -P -D
      "Tuesday, June 3, 2008 10:16:44 AM UTC" com.profidatalab.nightbird
      com.xnife.build
      cvs checkout: dying gasps from cvs unexpected
      $ no changes detected
      [com.xnife.build] $ cmd.exe /C '"ant.bat -file build.xml && exit %%ERRORLEVEL%
      %"'
      The directory name is invalid
      FATAL: command execution failed.Maybe you need to configure the job to choose
      one of your Ant installations?
      java.io.IOException: Cannot run program "cmd.exe" (in directory "C:\Documents
      and Settings\dis\.hudson\jobs\xnife\workspace\com.profidatalab.nightbird
      \com.xnife.build"): CreateProcess error=267, The directory name is invalid
      at java.lang.ProcessBuilder.start(Unknown Source)
      at hudson.Proc$LocalProc.<init>(Proc.java:104)
      at hudson.Proc$LocalProc.<init>(Proc.java:82)
      at hudson.Launcher$LocalLauncher.createLocalProc(Launcher.java:291)
      at hudson.Launcher$LocalLauncher.launch(Launcher.java:282)
      at hudson.Launcher.launch(Launcher.java:120)
      at hudson.Launcher.launch(Launcher.java:72)
      at hudson.tasks.Ant.perform(Ant.java:179)
      at hudson.model.Build$RunnerImpl.build(Build.java:130)
      at hudson.model.Build$RunnerImpl.doRun(Build.java:105)
      at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:231)
      at hudson.model.Run.run(Run.java:762)
      at hudson.model.Build.run(Build.java:85)
      at hudson.model.ResourceController.execute(ResourceController.java:70)
      at hudson.model.Executor.run(Executor.java:82)
      Caused by: java.io.IOException: CreateProcess error=267, The directory name is
      invalid
      at java.lang.ProcessImpl.create(Native Method)
      at java.lang.ProcessImpl.<init>(Unknown Source)
      at java.lang.ProcessImpl.start(Unknown Source)
      ... 15 more
      finished: FAILURE

      It has failed to start the cmd.exe program in the following directory: C:
      \Documents and Settings\dis\.hudson\jobs\xnife\workspace
      \com.profidatalab.nightbird\com.xnife.build

      This directory is nonsense. Rather than finding the ANT build file relative to
      the job's working directory, Hudson has added BOTH CVS modules as
      subdirectories.

      I require 2 modules because one of them contains generic build scripts that I
      will require for pre and post build steps and the other is specific to what's
      being built.

      I really like what I've seen and read about Hudson, but this seems a very basic
      bug. Is there a workaround for this problem?

        Attachments

          Activity

          Hide
          kohsuke Kohsuke Kawaguchi added a comment -

          Ah, I think I understand what's going on. Indeed this is horrible.

          This is because you specified "com.xnife.build/build.xml" in the build script.
          See, Hudson designates .../workspace/ as the workspace for you job, and it does
          check out your two modules side-by-side, as
          .../workspace/com.profidatalab.nightbird and .../workspace/com.xnife.build. So
          far so good.

          Now, because you specified nightbird as the first module name, Hudson assumes
          that your build script is relative from this module. This is probably a bad idea
          in retrospect, but can't really change it because of the compatibility.

          And then you specified com.xnife.build/build.xml, so now Hudson is combining
          them all and trying to execute
          .../workspace/com.profidatalab.nightbird/com.xnife.build/build.xml.

          So the work around for you is to specify "../com.xnife.build/build.xml as the
          build script.

          Now the real question is how to fix this. I can detect this situation and report
          an error in more user friendly way as the first step. OTOH, to fix the real
          cause of this would require a breaking change, and that's costly, too.

          Hmm...

          Show
          kohsuke Kohsuke Kawaguchi added a comment - Ah, I think I understand what's going on. Indeed this is horrible. This is because you specified "com.xnife.build/build.xml" in the build script. See, Hudson designates .../workspace/ as the workspace for you job, and it does check out your two modules side-by-side, as .../workspace/com.profidatalab.nightbird and .../workspace/com.xnife.build. So far so good. Now, because you specified nightbird as the first module name, Hudson assumes that your build script is relative from this module. This is probably a bad idea in retrospect, but can't really change it because of the compatibility. And then you specified com.xnife.build/build.xml, so now Hudson is combining them all and trying to execute .../workspace/com.profidatalab.nightbird/com.xnife.build/build.xml. So the work around for you is to specify "../com.xnife.build/build.xml as the build script. Now the real question is how to fix this. I can detect this situation and report an error in more user friendly way as the first step. OTOH, to fix the real cause of this would require a breaking change, and that's costly, too. Hmm...
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in hudson
          User: : kohsuke
          Path:
          trunk/hudson/main/core/src/main/java/hudson/tasks/Ant.java
          http://fisheye4.cenqua.com/changelog/hudson/?cs=9840
          Log:
          [FIXED JENKINS-1782] Let Hudson try to auto-correct the error when the user assumes the wrong root for the relative path. This often happens because of the poor choice in the default location when multiple modules are checked out. In 1.222.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in hudson User: : kohsuke Path: trunk/hudson/main/core/src/main/java/hudson/tasks/Ant.java http://fisheye4.cenqua.com/changelog/hudson/?cs=9840 Log: [FIXED JENKINS-1782] Let Hudson try to auto-correct the error when the user assumes the wrong root for the relative path. This often happens because of the poor choice in the default location when multiple modules are checked out. In 1.222.
          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in hudson
          User: : kohsuke
          Path:
          trunk/hudson/main/core/pom.xml
          trunk/hudson/main/core/src/main/java/hudson/tasks/Ant.java
          trunk/www/changelog.html
          http://fisheye4.cenqua.com/changelog/hudson/?cs=10145
          Log:
          JENKINS-1782 take the -f option into account.
          See http://www.nabble.com/ant-compatibility-issue-tt17849430.html

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in hudson User: : kohsuke Path: trunk/hudson/main/core/pom.xml trunk/hudson/main/core/src/main/java/hudson/tasks/Ant.java trunk/www/changelog.html http://fisheye4.cenqua.com/changelog/hudson/?cs=10145 Log: JENKINS-1782 take the -f option into account. See http://www.nabble.com/ant-compatibility-issue-tt17849430.html

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            stevendick stevendick
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: