Much ado about scripting, Linux & Eclipse: card subject to change

Showing posts with label packaging. Show all posts
Showing posts with label packaging. Show all posts

2009-09-07

Re-Return to Athena

Thanks to Miles for taking the time to slap Athena into submission on his local system - frequent and regular stress testing is what's going to make this facade over PDE bridge the gap between today and the far-flung future (namely B3).

Because he took the time to itemize his concerns / problems / gotchas, I thought I'd take the time to explain why these happen... and which are bugs vs. features. Speaking of bugs and features, Athena has a handy New & Noteworthy wiki page which I update about once a month. If you've never seen the N&N, it's here.

# skipPack=true is useful if you want to test locally. I found that the update manager does not work with pak'd jars when running locally. Perhaps P2 is relying on something on the web server side..?
If p2 isn't properly unpacking pack'd jars, the problem is either: you're using a JDK with pack200 bugs (like Sun 1.6), or you have jars which should never be packed. How can you exclude jars from packing? See JarProcessor Options.
# The build scripts appear to be simply searching for the occurrence of strings to determine wether a given map entry type is being used. They do not appear to respect the comment lines. I guess I should file a bug report on this one -- it cost a bit of time because I have a dodgy SVN setup on my home laptop. I'm actually still not sure what is going on with that (and does the mysterious Java 134 error msg have anything to do with it) but I'm trying to learn not to fix things for which I have a work-around, i.e. if ti works on a different machine, just use that instead!
The purpose of the collectMapTypes task is to simply know what types of maps are being used so that warnings can be echoed to the user if appropriate. If you use SVN on linux, there's a good chance you'll get this message:
[echo] If you get a SIGSEGV or Java Result: 134 when fetching from SVN, remove 
[echo] subversion-javahl and svnkit to force PDE to use commandline svn client.
Why? Because it's a pain in the butt to debug, and at least having a message in the build log gives you some tea leaves to read. I favour documentation over performance in this case.
# There is a somewhat lengthy description at http://wiki.eclipse.org/Common_Build_Infrastructure/Getting_Started of how to setup your local build to use a local cache CVS site but I'm not sure what scenario that would really be helpful in. I just use COPY and it works fine. I suppose that using the CVS approach might excercie some issues that you wouldn't run into with a plain COPY. And I'm not sure wether the local build copies over the binary files or not. If it does, you could get different build results if say your local environment happens to place some artifacts in the copied directories that aren't cleaned out by the PDE build. Not going to worry about it!
A more useful scenario is to take a dump of a CVS, SVN, or Git tree, and point your build at that folder using localSourceCheckoutDir=/path/to/full/source/tree/root in your build.properties file. Then it'll build against that local source cache instead of having to fetch from the repo. Once you have the dump of the repo, from Eclipse do File > Import > Existing projects, and you can have those same projects compilable/editable in your workspace. You can also use Eclipse (eg., with Subversive, Subclipse, eGit) to update the cache before doing a build.
# A useful hack when building locally is to pack up your difficult dependency(s) into a zip file and refer to them in your dependencyURL. It doesn't matter what you use for the URL, because it will use the cached file instead. For example, GEF3D doesn't yet have a build or update site. (We've been collaborating a bit on this so hopefully the build I've got working will help them get one up soon.) So instead of solving the the SVN stuff right away, I put that off until everything else worked. So I created a zip and added an entry for http://download.eclipse.org/tools/gef/fake/gef3d.zip. You have to be careful to have your zip file packaged up correctly or it won't work. That's easy to get wrong..your file structure needs to conform to the standard structure, i.e. eclipse/plugins/some.plugin. On the other hand, you have to be careful to remove these fake dependencies when you begin testing the real fetched versions! The fetch part then fails silently; your build succeeds but using the previously downloaded files.
I generally add comments (TODO, FIXME) in my build.properties to mark temporary hacks, or use a new file, like build.properties.local.hack so I'm not breaking the server-friendly version. (Just make sure you tell build.xml which build.properties file to use, if not the default one -- and DON'T CHECK IN the changed file.)
# But in any case getting the SVN map file right has been a major headache. Again, the only reason I want this is to grab the GEF3D sources, but I can't seem to let this one go as it seems that it should be so easy. The Athena build seems to mangle things in the fetch script; or perhaps this is a PDE Build issue. So I tried the sourceforge style entry and after a couple of hours of fiddling (see below) I found a magic incantation that seems to work -- plugin@org.eclipse.draw3d=SVN,trunk,http://dev.eclipse.org/svnroot/technology/org.eclipse.gef3d,,org.eclipse.draw3d@HEAD
@HEAD is optional; you only need to specify a tag if it's not the HEAD of the branch or trunk. Here's a sample SVN map.
# It would be super nice if there were a built-in dependency analyzer so that one could find the root plugin issues easily. As it is, if you have a bad dependency you get the whole tree and you have to walk the tree by hand to find out the root cause. Overall I think this is another demonstration of the ultimate weakness of the standard build systems out there. They are by nature linear (batch) approaches and so usually you can't do post hoc or inline analysis of issues. There is no semantic information in logs! You end up having to parse them back if you want to do any useful analysis. In a parallel lifetime, I would love to work on a simple semantic logging system that would allow structured analysis of this sort.
I believe the Buckminster guys are doing work in this area, so this may make its way into B3.
# Here is something else that I would love to do given time. The map files are pretty well structured - it would be nice to whip up a quick XText editor that would at least check syntax and more ambitiously provide a mechanism for hooking in semantic checks -- wouldn't it be nice if you could check that that SVN url is correct while editing the map file itself?!
Add that to the wishlist for B3!
# I'm still not sure how Athena determines what goes in the sdk vs. runtime vs. example zips so for now I'm just building the examples manually. Anyone come across documentation for this?
This arbitrary allocation of files is done in common.releng/tools/scripts/buildAllHelper.xml, lines 1063-1097, and is only done if the build.steps entry 'buildZips' is enabled. This behaviour is as far as I'm concerned deprecated, but in place simply to ease transition for existing builds using the old Common Modeling Build to the Athena Common Build. IMHO, no one needs these zips - you only need an update site zip. If you don't like what's in the zips, you can omit the 'buildZips' step and package your own zips by hand, eg:
 <zip destfile="${buildDirectory}/${buildLabel}/${SDKZip}" update="true">
   <zipfileset src="${buildDirectory}/${buildLabel}/${allZip}" dirmode="775" filemode="664" excludes="**/*.pack.gz, **/pack.properties, **/features/*.jar, **/${domainNamespace}.*.all*, **/${domainNamespace}.*.all*/**" />
 </zip>

(For those unfamiliar with the story of the Re-Return, you need to watch HIMYM, S1E15.)

2009-05-22

Use Your Metadata, Vol. 2 [Update]

Wednesday I went off on a bit of a G'n'R-fueled rant about metadata, documentation, and the shotgun blues. Today, I'd like to focus on something more positive.

As Pascal blogged the other day, the new p2 is almost done and is ready for tire-kicking. Some new features I personally like include:

  1. a new p2.director app / task, which includes support for installing multiple IUs (feature.groups) in the same step and finally has commandline help
  2. a new p2.repo2runnable ant task, used to convert an update site zip to the old-school unpacked "runnable" features/plugins format so that one day we will be able to throw away all those extra zips.

    UPDATE, 2009-06-02: repo2runnable now works as a commandline application too, thanks to Andrew's fix. Wiki updated.
  3. Composite Repo, Mirroring and Slicing Tasks - haven't tried these yet, but they look like they'll be very handy for one day replacing the hack that is buildUpdateSite.sh for our Modeling Project composite repos with something more robust and easily maintainable.

I'm also impressed that there is new, current documentation regarding the above tasks, as well on the new Publisher which replaces the Metadata Generator.

Will this release be p2's salvation?


click to zoom

Well, I'm split on the new default behaviour in the update UI, such that when you add a new update site p2 won't by default search ALL your other listed sites. This is a great performance gain if you're installing a new self-contained feature, but a pain if you're installing something like VE which depends on EMF and GEF, and you don't already have those deps installed. Simple workaround is to just pick the "all sites" entry in the dropdown.

I'm also waiting to see if there will be something better done about recovery from slow/incomplete mirrors.

But other than these minor concerns, I'd say YES. With lots more commandline and ant toys available, p2 is certainly maturing. And with more people adopting its use and spinning p2 repo zips, more testing is being done, and more use cases are being covered.

So... get in the ring, and go a few rounds with p2. It's worth the battle. :)

2008-11-02

Request For Comment: The End Of SDO?

Four months ago, I started a discussion about simplifying the EMF download experience. Consensus appears to be that we should keep the EMF-SDO-XSD "All-in-one" SDK zip, perhaps more.

Now, a new proposal is in the works: removing SDO from the EMF build, and from this year's coordinated release, Galileo. The source would still be in CVS, but we'd stop providing SDO binaries. This would also mean the much-loved* EMF-SDO-XSD "All-in-one" SDK zip would be renamed to EMF-XSD "All-in-one" SDK, but would otherwise continue as is.

For more on this topic see:

EMF 2.5 - Simplified Downloads (bug 240223)
Remove SDO from Galileo (bug 251402)
Consider improvements to the termination process (bug 249408)

To voice your opinion, please post your feedback in any or all of the three bugs linked above.

Thanks!

2008-07-09

Request For Comment: Will Anyone Miss All Those EMF Zips?

With the advent of p2 and the smaller EMF features introduced in EMF 2.3, the EMF team is evaluating if the All-In-One, Runtime (3), Sourcedoc (3) & Examples Zips are still meaningful and useful to consuming teams, projects, and products. We'd like to reduce those 8 zips down to a single archived update site zip.

For more on this topic see:

EMF 2.5 - Simplified Downloads

To voice your opinion (be it 'I need that/those zip(s)!' or 'I'm good with using Update'), please post your feedback in bug 240223.

Thanks!

2008-03-20

EclipseCON 2008: News from the collective

In no particular order, here's what I've learned from this year's con:

  • p2 is going to rock (though it's unfortunate that Pascal's slides aren't online yet -- hint, hint!). While my first view of it was a bit disappointing, the new story -- including backwards compatibility for existing Update Manager sites, the ability to generate the new metadata from the old stuff & shared bundle pools (akin to C:\Program Files\Common Files or /usr/share/) to improve the functional-but-hackish alternatives -- promises to make things not just different, but better.

  • Modeling is not just alive and well, it's everywhere!

  • While some people have Planet-blog-photo-angst, it's not enough to stop the onslaught diversity. :)

  • ant4eclipse looks like a possible stripped-down approach to pde/basebuilder, for tiny projects like the microcomponents planned for Nexus or the stuff on Eclipse Spaces. Something to explore, anyway.

  • The Modeling build has lots of room for improvement -- some great suggestions have been logged and added to my list, including the use of JET to templatize and wizardize creation of new .releng projects. The same should be said about my tutorial, which I think would have benefited from a more overarching introduction before the hands-on work began.

  • The Google Summer of Code 2008 is just around the corner. Have a great idea you want to see built at Eclipse, but don't have time to do it yourself? Suggest it and mentor a student instead!

  • Martin Taal has some great new web-based form UI functionality that I'd love to use for the UIs I do (eg., for builds or for Dash).

  • I'd also like to start playing with BIRT in Dash, and not just to earn an animated t-shirt, since I think that ship has, sadly, already sailed.

  • TaskTop, or Mylyn on steroids, is pretty damn cool as a way of integrating everything I do into one UI. Because of networking issues w/ linux this week, I've only been able to test it with Windows... which means, sadly, the embedded browser experience sucks a little because it's IE, not Firefox. Still, the idea of having a context for web and local files I'm working on all in one trackable, toggleable interface, with connections to GMail and Google Calendar makes the whole thing very slick. If the linux experience is as good or better, it's only a matter of time before I buy a copy. $60 is pretty reasonable for something that will, ultimately, support Mylyn's continued growth. (Though you don't get a "Friends of Mylyn" logo.)

  • WinXP + Eclipse + Flock + Pidgin + Cisco VPN client = BSOD, even though Windows Loves Java, apparently. (To be fair, this one was the Cisco VPN client's fault.)

  • I want an IBM Access Connections for Linux. Switching between the Hyatt wifi network and the Eclipsecon network via text file updates and shell scripts sucks elephant balls compared to just magically switching networks with no effort. Am I missing something? Is there some better x-, k-, or gnu-based app I could be using?

  • I should be using Platform Releng Packager instead of custom-packing zips after signing them. I recall vaguely hearing about this last year, but haven't had a use for it until now, with Master Features and signed builds.

  • It's possible to generate test coverage documentation from JUnit using Bumblebee.

  • If your project doesn't already define a How To Contribute document, it should.

  • Using the Autopin tweaklet with Mylyn is probably a bad idea, as it introduces a lot of manual labour (pinning tabs by hand). This has been preventing me from getting the most out of Mylyn.

  • Denis & Karl have outed me as being not one person but an array of clones. I'm just not sure how to define the syntax for identifying which clone is which... suggestions? (This is clone #1, or $nick[0], nick:0.) The process is still imperfect, but I hope to be able to open source it one day. If you're curious about how it's done, all I can say is that it involves division by zero.
Thanks to everyone at this year's con -- planners & attendees alike. We[] had a blast.

2008-01-25

Building Change

Seems everyone's talking about change these days. Hell, people are even ranting about the way media is changing.

But real issues aside, in part two of this series, I'd like to briefly mention two changes happening closer to home, here in releng-land:

  • EMF, SDO, and XSD are now being packaged a little differently. Consider this a little social experiment to see who, if anyone, still uses zips to get their downloads, rather than using Update Manager. Do you like the new "sourcedoc" zips? Feel free to let us know what you think (here, on IRC in #eclipse-modeling, or in the newsgroups).
  • GEF is now being built by the Common Modeling Build, the first (of many, I'm sure) projects to come over to the dark side. Will DSDP or VE be next? Time will tell.