Debugging the build process

From Aptana Development

This page describes how to debug a failed build.

Contents

Introduction

You can use two methods to debug a failed build. The first method is to use a "build failed" email to troubleshoot the failure. The second method is to use Eclipse.

Instructions

From a "Build Failed" Email

To debug a failed build via email:

  1. Click on the link to view the cruisecontrol site for the particular build that failed.
  2. If the error is anything _but_ a compile error, generally the actual problem is listed at the bottom of the Errors/Warnings list. An example:
    1. Can't clobber writable file /usr/local/work/checkout/triggers/deploy/build.xml
    2. Can't clobber writable file /usr/local/work/checkout/triggers/deploy/deploy.properties
  3. Otherwise, you will see an error like this:
    1. usr/local/work/checkout/ide/trunk/com.aptana.ide.builder.all/com.aptana.ide.builder.rcp/plugins/com.aptana.ide.js.core/build.xml:56: Compile failed; see the compiler error output for details
  4. Click on the "XML Log File" link, and look for "ERROR in". The two most common errors are:
    1. File not checked in
    2. Classpath not set correctly
  5. Make the appropriate changes and re-check in the file.
  6. Alternately, you may look at the actual build output. For the current build, use the following link:
    1. http://build.aptana.com/update/
    2. Then click on {branchname}/com.aptana.ide.builder.all/com.aptana.ide.builder.rcp
    3. Then choose features or plugins (depending on what broke)
    4. Finally choose the particular folder of the item that failed (com.aptana.ide.js.core in this case)
    5. Inside that folder you will find a temp.folder with a temp.log. This is the actual build file.

Using Eclipse to debug a failed build

In Eclipse (Works with perforce)

The other best way:

  1. Check out all projects under the IDE, and open up com.aptana.ide.rcp/ide.product.
  2. Choose to "Export this product". You can choose the default options, though you may have to specify a archive directory or folder on disk.
  3. If the build fails, open up the log file (it will tell you where it placed it). By and large, the errors are generally classpath compile issues.

In Eclipse (Does not work with Perforce)

  1. Check out all projects into your workspace under /products/ide/trunk. There are one or two that you don't need, but it's easiest to just do it this way.
  2. Checkout the project org.eclipse.pde.build from /products/ide/trunk
  3. Right-click on the file scripts/build.xml
  4. Select Run As Ant Build...
    • Image:eclipse_debug_run_as.png
  5. Update the JRE to run in the JRE of the IDE
    • Image:eclipse_debug_run_jre.png
  6. Update the build properties to match that show below. The main one is:
${workspace_loc:com.aptana.ide.builder.rcp}
    • Image:eclipse_debug_run_pde.png
  1. Click "Run". An errors will be shown in the console window.

A possible error is shown below:

 BUILD FAILED
 C:\workspace_local\org.eclipse.pde.build\scripts\build.xml:25: The following error occurred while executing this line:
 C:\workspace_local\org.eclipse.pde.build\scripts\build.xml:90: The following error occurred while executing this line:
 C:\workspace_local\halon.builder.ide\customTargets.xml:8: The following error occurred while executing this line:
 C:\workspace_local\org.eclipse.pde.build\scripts\genericTargets.xml:137: The following error occurred while executing this line:
 C:\eclipse.build\assemble.halon.feature.ide.wrapper.all.xml:4: The following error occurred while executing this line:
 C:\workspace_local\com.aptana.ide.builder.rcp\customTargets.xml:22: The following error occurred while executing this line:
 C:\eclipse.build\assemble.com.aptana.feature.rcp.wrapper.win32.win32.x86.xml:179: java.lang.RuntimeException: java.lang.RuntimeException: Error 40

In this case, you can look at "C:\eclipse.build\assemble.com.aptana.feature.rcp.wrapper.win32.win32.x86.xml", line 179 to see what the culprit problem is. In this case, it's:

<eclipse.brand root="${eclipse.base}/win32.win32.x86/${collectingFolder}" icons="${basedir}/plugins\aptana.ide\content\aptana.ico" name="${launcherName}" os="${os}"		/>

It looks as if Eclipse can't handle something about the icon file--in this case that it has a Vista-sized 256 x 256 px icon. Removing that fixed the build.

Using ANT (Does not work with Perforce)

  1. Open a command prompt
  2. Make sure you have ECLIPSE_HOME set as an environment variable. If not, you can set it via: set ECLIPSE_HOME=c:\Program Files\Eclipse
  3. Type svn checkout http://build.aptana.com/svn/products/ide/trunk/com.aptana.ide.builder.all c:\builder (where c:\builder is the temporary directory you want to build into)
  4. Type cd c:\builder (or the directory you specified)
  5. Type build.
  6. If any errors happen, they may appear on the command line or in a log file. For true debugging, the Eclipse method is preferred.
  7. The built files will appear in c:\builder\output

Related Topics


Aptana Developer Home