It can be very useful to have an example when setting up your first headless build. It occurs to me that there is a growing number of relatively simple examples: the pde.build junit tests.
The org.eclipse.pde.build.tests project can be checked out of cvs from dev.eclipse.org/cvsroot/eclipse/org.eclipse.pde.build.tests. The main test suite is PDEBuildTestSuite.
If you run the tests with the vm argument pde.build.noCleanup=true then the tests will run without deleting any files and you can then go take a look at the setup for each test.
Not every test is a full build, but many are. Generally the tests consist of generating some features and plugins, then generating the build.properties and allElements.xml configuration files and then running the build.
Of particular interest would be the generation of the build.properties file. This is done by loading the template file and then setting just a handful of the properties. See BuildConfiguration.getBuilderProperties(IFolder). This should give a good idea of what properties you need to change for your build.
*Edit 1/28/08 : The "pde.build.noCleanup" argument was added on 1/23/08, you must use a build N20080124-0010 or newer. The first I-Build containing these changes will be I20080129.
Wednesday, January 23, 2008
Friday, January 18, 2008
On Building Cycles
One of the enhancements I am considering for pde.build in 3.4 is partial handling of cycles.
The latest idea is allowing a cycle that contains at least one binary bundle. The presence of the binary bundle could be enough to break the cycle and allow us to compile the remaining bundles.
Consider the following:
Where we have a cycle between B, C, and D. If C is binary and does not need to be compiled, we may be able to compile the remaining bundles in the order A, D, B, E.
However, there are cases where this would not work. It could be that allowing this wouldn't actually help and would simply be giving people rope to hang themselves with.
If you have an opinion on this, please go comment on the bug and give the patches there a try.
The latest idea is allowing a cycle that contains at least one binary bundle. The presence of the binary bundle could be enough to break the cycle and allow us to compile the remaining bundles.
Consider the following:
A <- B <- C <- D <- E
----------^
Where we have a cycle between B, C, and D. If C is binary and does not need to be compiled, we may be able to compile the remaining bundles in the order A, D, B, E.
However, there are cases where this would not work. It could be that allowing this wouldn't actually help and would simply be giving people rope to hang themselves with.
If you have an opinion on this, please go comment on the bug and give the patches there a try.
Thursday, October 04, 2007
Selecting Plug-in Versions in a Headless Product Build
As Pascal likes to say: "PDE.Build is an onion." Don't be afraid to reach in and savor those inner layers. Here is an example:
We support building from a .product file. Generally, people base their product files on a list of plug-ins. There is currently no way to specify plug-in versions in the product file. If you have a requirement on a specific version of some bundle and for some reason there are multiple versions in your target, then you may be stuck with pde.build choosing the wrong version for you.
In a product build, a container feature is generated based on the contents of the .product file and the build is run using this generated feature. Features can specify the versions of the plug-ins they want to include, or they can specify "0.0.0" which means any version. They can also specify a version like "3.2.1.qualifier" which means any version starting with "3.2.1". (Though beware of this bug). The generated feature simply specifies "0.0.0" for each plug-in from the .product file.
PDE.Build provides an eclipse.idReplacer ant task. It uses this task to replace versions in the feature.xml with the actual versions that are built. It is easy to imagine using this task to modify the generated feature.xml to specify the plug-in versions you want before fetching or generating scripts.
In your customTarges.xml preFetch (or preGenerate) task, do something like this:
We support building from a .product file. Generally, people base their product files on a list of plug-ins. There is currently no way to specify plug-in versions in the product file. If you have a requirement on a specific version of some bundle and for some reason there are multiple versions in your target, then you may be stuck with pde.build choosing the wrong version for you.
In a product build, a container feature is generated based on the contents of the .product file and the build is run using this generated feature. Features can specify the versions of the plug-ins they want to include, or they can specify "0.0.0" which means any version. They can also specify a version like "3.2.1.qualifier" which means any version starting with "3.2.1". (Though beware of this bug). The generated feature simply specifies "0.0.0" for each plug-in from the .product file.
PDE.Build provides an eclipse.idReplacer ant task. It uses this task to replace versions in the feature.xml with the actual versions that are built. It is easy to imagine using this task to modify the generated feature.xml to specify the plug-in versions you want before fetching or generating scripts.
In your customTarges.xml preFetch (or preGenerate) task, do something like this:
Beware of this bug in 3.3.0, and this bug in 3.3.1.
<eclipse.idReplacer
featureFilePath="${buildDirectory}/features/org.eclipse.pde.build.container.feature/feature.xml"
selfVersion="1.0.0"
featureIds=""
pluginIds="org.eclipse.foo:0.0.0,1.3.0.qualifier,org.bar:0.0.0,3.2.0.qualifier," />
Thursday, September 13, 2007
Eclipse launcher is losing its head
The Eclipse launcher has always required a graphics library (ie GTK, Motif) to show error messages and display the splash screen. It can't even start if the library is not found. This is a problem for people who have headless Eclipse applications that run in places without such luxuries.
I raised a bug to track this issue. Though I should point out that bug is incorrect in its description of the launcher's linking: the launcher is dynamically linked to the graphics libraries, (not statically linked as the bug says). The problem is that these dependencies are resolved at loadtime, not runtime. The fix is to load the graphics libraries at runtime using dlopen and lookup all the functions we need to call using dlsym.
I have created launchers for GTK and Motif that do this and attached them in bugzilla. These changes require more testing before I release them to CVS. People should try them out and give feedback on the bug.
One thing to note is that the Motif version is using a DT_RPATH tag to help find the libXm.so.2 library that ships on linux in the root of Eclipse. Most of what I've read suggests this is obsolete and not a good idea, so that will probably change.
I raised a bug to track this issue. Though I should point out that bug is incorrect in its description of the launcher's linking: the launcher is dynamically linked to the graphics libraries, (not statically linked as the bug says). The problem is that these dependencies are resolved at loadtime, not runtime. The fix is to load the graphics libraries at runtime using dlopen and lookup all the functions we need to call using dlsym.
I have created launchers for GTK and Motif that do this and attached them in bugzilla. These changes require more testing before I release them to CVS. People should try them out and give feedback on the bug.
One thing to note is that the Motif version is using a DT_RPATH tag to help find the libXm.so.2 library that ships on linux in the root of Eclipse. Most of what I've read suggests this is obsolete and not a good idea, so that will probably change.
Thursday, August 23, 2007
PDE Build Slides from EclipseCon 2007
The slides we (Sonia Dimitrov, Pascal Rapicault, and myself) presented at EclipseCon 2007 are now posted online. We're only about 6 months late putting them up.
They are attached to the Eclipsezilla entry for the tutorial. If you want to run the examples, you will need the Eclipse SDK and the RCP delta-pack. The examples were tested against an old integration build which is no longer available, but using 3.3 should work just fine.
They are attached to the Eclipsezilla entry for the tutorial. If you want to run the examples, you will need the Eclipse SDK and the RCP delta-pack. The examples were tested against an old integration build which is no longer available, but using 3.3 should work just fine.
Thursday, July 26, 2007
Greasemonkey: Making the internet slightly less annoying
One of the more annoying memes I've seen on some blogs is the use of "Canadia" instead of "Canada". The level of annoyance has finally risen high enough to overcome a certain level of laziness on my part. So I downloaded Greasemonkey and wrote my first JavaScript.
I'm sure it is not the best script ever written, but I now feel like I've done my part to make the internet a better place.
I'm sure it is not the best script ever written, but I now feel like I've done my part to make the internet a better place.
// ==UserScript==
// @name Canadia
// @description Change "Canadia" to "Canada"
// @include *
// ==/UserScript==
(function() {
var expression, replacement, regex, textnodes, node, s;
expression = "([Cc]anad)ia([^n]|$)";
replacement = "$1a$2";
regex = new RegExp(expression, 'g');
textnodes = document.evaluate( "//body//text()", document, null,
XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
for (var i = 0; i < textnodes.snapshotLength; i++) {
node = textnodes.snapshotItem(i);
s = node.data;
s = s.replace(regex, replacement);
node.data = s;
}
})();
Wednesday, May 02, 2007
Eclipse and the Console
Starting in the warmup to 3.3M7 there is a second launcher on Windows: eclipsec.exe.
The Eclipse launchers in 3.3 have had issues with various aspects of the console on Windows. See some bugs: 146807, 167310, 168726, and 173962.
All of our problems came from the fact that the eclipse.exe was linked as a UI application and not a console application. In 3.2, the console behaviour was tied to using java.exe instead of javaw.exe, but starting in 3.3 M5, the vm is loaded in the eclipse process using the JNI Invocation API.
So just like javaw/java, we now have eclipse/eclipsec. Eclipsec.exe is linked as a console application so that the OS handles allocating the console for us. Using eclipsec.exe does not imply any default arguments, so you still need to specify things like -console and -consoleLog.
The Eclipse launchers in 3.3 have had issues with various aspects of the console on Windows. See some bugs: 146807, 167310, 168726, and 173962.
All of our problems came from the fact that the eclipse.exe was linked as a UI application and not a console application. In 3.2, the console behaviour was tied to using java.exe instead of javaw.exe, but starting in 3.3 M5, the vm is loaded in the eclipse process using the JNI Invocation API.
So just like javaw/java, we now have eclipse/eclipsec. Eclipsec.exe is linked as a console application so that the OS handles allocating the console for us. Using eclipsec.exe does not imply any default arguments, so you still need to specify things like -console and -consoleLog.
Monday, April 23, 2007
Equinox launcher & Swing
The equinox launcher starts the Java VM using the JNI invocation API. Because we are such good friends with SWT (and also because it is easier) the VM was always started on the first thread. This turns out not to be so good when you want to run Swing on the Mac. There was a conversation about it over on EclipseZone.
So I fixed the bug (181698) today by adding a new option to the launcher "--launcher.secondThread". Use it if you want swing to work. This option can be compared to the -XstartOnFirstThread for the java launcher.
So I fixed the bug (181698) today by adding a new option to the launcher "--launcher.secondThread". Use it if you want swing to work. This option can be compared to the -XstartOnFirstThread for the java launcher.
Tuesday, March 27, 2007
Source Feature generation with PDE/Build
One of the cool features in PDE/Build is the generation of source features and plug-ins. This is perhaps one of those features that leads towards the "black magic" reputation that we seem to have.
Recently the CDT SDK builds have been missing their source. The source features and plug-ins exist, but they just didn't contain any src.zips. After some investigation, it seems that a long standing bug in pde.build has risen to the surface. It has always been there, it was just hidden by bug 114150 which was fixed in M6.
The workaround for the CDT is simple: just make sure that in the SDK feature, the generated org.eclipse.cdt.source feature is included after the org.eclipse.cdt feature upon which it is based.
Unfortunately, I'm sure that the fix in pde.build will be a bit harder.
Recently the CDT SDK builds have been missing their source. The source features and plug-ins exist, but they just didn't contain any src.zips. After some investigation, it seems that a long standing bug in pde.build has risen to the surface. It has always been there, it was just hidden by bug 114150 which was fixed in M6.
The workaround for the CDT is simple: just make sure that in the SDK feature, the generated org.eclipse.cdt.source feature is included after the org.eclipse.cdt feature upon which it is based.
Unfortunately, I'm sure that the fix in pde.build will be a bit harder.
Monday, February 05, 2007
EclipseCon 2007
As everyone knows, EclipseCon 2007 is March 5-8. I will be presenting a long tutorial on PDE Build with Pascal Rapicault and Sonia Dimitrov. I will also be giving a short talk on the new launcher story.
I even got a pretty little graffic:
I even got a pretty little graffic:
Friday, February 02, 2007
Feature Version Suffixes in PDE/Build
This week I released a patch from David Olsen which is a significant change to how pde/build calculates feature version suffixes. The details are in bug 157049, as well, the problems outlined in bug 162020 are fixed as a consequence.
The biggest thing to note is that the major, minor and service segments are now included in the calcuation. This covers the case when a plugin decrements its qualifier and increments, for example, the service number.
These changes will be in 3.3 M5. There may be cases where these changes could cause a one-time decrease in the version suffix, so builders picking up these changes are advised to increment their feature qualifiers.
The biggest thing to note is that the major, minor and service segments are now included in the calcuation. This covers the case when a plugin decrements its qualifier and increments, for example, the service number.
These changes will be in 3.3 M5. There may be cases where these changes could cause a one-time decrease in the version suffix, so builders picking up these changes are advised to increment their feature qualifiers.
Tuesday, December 19, 2006
Equinox Launchers and SWT splash screens
The Eclipse Integration build I20061219-1300 has the new Equinox launchers in it. Read all about them on the wiki, and in my email to the Eclipse-dev mailing list.
This will allow for some potentially cool things to happen in the splash screen.
I have been slowly going crazy getting this stuff working on all the different platforms. There are still problems on linux.x86_64, linux.ppc, and aix.ppc.
This will allow for some potentially cool things to happen in the splash screen.
I have been slowly going crazy getting this stuff working on all the different platforms. There are still problems on linux.x86_64, linux.ppc, and aix.ppc.
Thursday, December 14, 2006
Everybody's doing it
All the cool people are doing it, and if I'm ever going to be famous I suppose I should start too.
So this is my blog, I wonder if anybody will actually read it.
So this is my blog, I wonder if anybody will actually read it.
Subscribe to:
Posts (Atom)