Exercise 03: Diagnosing Build Failures

What This Exercise Is About

As a project evolves, there are many things that can be done that will break a build. Most can be caught in your development workspace, and as PDE evolves more and more are added. This exercise will explore a few scenarios which can cause build breakages.


What You Should Be Able To Do

At the end of the lab, you should be able to:

Required Materials

Exercise Instructions

This exercise is carried out entirely using the Eclipse Software Development Kit (SDK) version 3.4M5 with the Eclipse Modeling Framework (EMF) 2.4M5 installed into it. The exercise instructions refer to this product as either Eclipse or as "the workbench."

These instructions are located in your workspace, in the Build_Workshop/Exercise03_BuildFailures folder.


Directions

Step A: Compare before and after scenarios

  1. Switch to the Plug-in Development perspective, if not already there.
    1. Select Window -> Open Perspective -> Other... -> Plug-in Development.

    NOTE: Importing Build_Workshop\Exercise03_BuildFailures\exercise_03.psf will overwrite your work from Exercise 2. If you want to keep your work, select the org.eclipse.jet.releng project you created and hit F2 or SHIFT-ALT-R (rename) before the next step.

  2. In the Package Explorer view, right-click the file Build_Workshop\Exercise03_BuildFailures\exercise_03.psf and select Import Project Set.... If prompted to overwrite, click Yes To All.
  3. If you prefer, you can also use the Import -> Existing Projects into Workspace method from Exercises 01 and 02, using Solution03.zip.
  4. For each of the following scenarios, there will be three pieces of information to review:
    1. Build log -- note the error message that is produced
    2. Broken code -- note the CVS branch/tag, file, line number & error
    3. Corrected code -- note the CVS branch/tag and how that version differs from the broken version
  5. To compare the two versions of code, open the History view.
    1. Select Window -> Show View -> Other... -> Team -> History.
  6. If you imported from existing projects (Cheat) instead of checking out directly from CVS, you may have to connect the projects to CVS in order to be able to compare versions.
    1. Select a plugin or feature project.
    2. Right-click and select Team -> Share Project...
    3. If you're lucky, all you'll need to do is then click Finish. If not, continue below.
    4. Select CVS. Hit Next.
    5. Select Use existing repository location and pick :pserver:anonymous@buildbox:/home/cvs if listed.
      (If not listed, select Create a new repository and hit Next to add that repository location.)
      Hit Next.
    6. Select Use an existing module and browse for the correct folder.
      For example, the org.eclipse.jet project should be shared with org.eclipse.m2t/org.eclipse.jet/plugins/org.eclipse.jet.
      Hit Next.
    7. Enter the tag xercise_03. If necessary, hit Refresh Tags or Configure Tags... to search for the tag, then hit Next.
    8. Hit Finish if you can. If you can't, and the Project Explorer changes such that the project now lists xercise_03 [buildbox] next to the project name, you can hit Cancel.
  7. To remove all the files that apparently need to be checked in, you'll need to overwrite the local files with those from CVS.
    1. For each shared project, right-click and select Replace With -> Latest from Branch xercise_03, then hit OK.
  8. Compare a shared file with another version in CVS.
    1. Select a shared file (eg., org.eclipse.jet/META-INF/MANIFEST.MF), then right-click and select Compare With -> History.
    2. Resize or move the History view until you can see the two versions you want to compare.
    3. Select them both, then right-click and select Compare with Each Other.
  9. There are four scenarios to explore below, each with two tags each to compare in CVS.

  1. MANIFEST.MF requirement range is too restrictive

  2. SDK feature does not include sources

  3. Wrong tag/branch in map file

  4. Tests broken

Summary

You have learned how to diagnose and repair several build problems. For even more examples, see:

If you encounter any other problems not listed here or in the wiki, please don't hesitate to contribute your experiences and your tips, to help your fellow release engineers and Eclipse.