Do's and Do not's about p2

4,265 views
3,993 views

Published on

This presentation goes over the things you should know not do with p2 and proposes a bet

Published in: Technology
2 Comments
4 Likes
Statistics
Notes
  • In #19 slide p2 doesn't let you use http protocol in -source option, example:
    Source location (http://download.eclipse.org/egit/updates/site.xml) must be a valid file-system path.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • In #8 and #9 slides talks about use .qualifiers for all IUs and the forceContextQualifier will replaces all your bundles. ¿It's not preferable to only change the bundles that changes?
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total views
4,265
On SlideShare
0
From Embeds
0
Number of Embeds
13
Actions
Shares
0
Downloads
31
Comments
2
Likes
4
Embeds 0
No embeds

No notes for slide

Do's and Do not's about p2

  1. 1. p2, your savior or your Achilles heel? Everything an Eclipse team needs to know about p2!<br />R. Ian Bull<br />Pascal Rapicault<br />
  2. 2. Alternate Titles<br />10 reasons we closed your p2 bugs as INVALID?<br />10 ways to get booted from the p2 mailing list!<br />10 excuses why we didn’t buy you a beer <br />p2, 10 common pitfalls and how to avoid them.<br />3/21/2011<br />2<br />
  3. 3. #1Move / remove files on disk<br />Leading cause of p2 failures: developers tampering with plugins/ folder<br />If you no longer need a pluginDO NOT REMOVE IT BY HAND<br />Do not move, unzip or change a plug-in in your plugins/ directory<br />3/21/2011<br />3<br />
  4. 4. Instead:Let p2 manage your install<br />Other plug-ins may depend on it<br />If a plug-in is no longer needed, p2 will remove it<br />Run the Garbage Collector manually if you want<br /># ./eclipse –application org.eclipse.equinox.p2.garbagecollector.application<br />3/21/2011<br />4<br />
  5. 5. #2 Unzip your plug-ins over Eclipse<br />Do you provide a zip file for your plugins?<br />Do you instruct your users to unzip over eclipse<br />We don’t like you! (And we will sabotage your wiki page  )<br />3/21/2011<br />5<br />
  6. 6. Instead:Provide a repository<br />Repositories can be zipped and downloaded!<br />Users can simply point to the compressed repository to properly install your plug-in<br />Avoid the use of drop-ins too<br />3/21/2011<br />6<br />
  7. 7. #3Replace published content<br />Never publish different content with the same version number!<br />Do not make a change and use the same version number<br />Do not build plug-ins as Foo v1.0.0.HEAD<br />You’ll never know what your user runs.<br />3/21/2011<br />7<br />
  8. 8. Remember: Version / ID pairs are immutable<br />If the Version / ID has not changed, the content hasn’t changed!<br />Always publish new metadata and artifacts for each code change<br />Use .qualifiers for all bundles / plug-ins and features<br />If you can’t rebuild everything, provide patches to deliver surgical updates<br />3/21/2011<br />8<br />
  9. 9. Reuse:Tips and Tricks<br />Context repositories<br />Qualifier replacement / bundle reuse<br />forceContextQualifier: Replaces the qualifier of all your bundles (use build timestamp)<br />Feature patches:<br />http://help.eclipse.org/helios/index.jsp?topic=/org.eclipse.pde.doc.user/guide/tools/project_wizards/new_feature_patch.htm<br />(or google: eclipse p2 feature patch) <br />3/21/2011<br />9<br />build.properties:repoBaseLocation=${buildDirectory}/inputRepositoriestransformedRepoLocation=${buildDirectory}/transformedRepo<br />
  10. 10. #4 Alter a released repository<br />“Release” repositories are serious stuffs!<br />People will refer to them from their repo to avoid duplicating your content<br />People will refer to them from their build<br />Removing content from a “release” repo is a felony!<br />3/21/2011<br />10<br />
  11. 11. Instead:Be mindful of your users / repos<br />Preserve content at the same URL<br />If you put out bad bytes, publish a new version. Don’t remove the old one ! <br />Append new version to existing repo.<br />Disk is cheap, users not patient (and they’ll blame p2).<br />For this, use p2 composite repositories.<br />Define clear retention policies<br />For example, the policies for the SDKhttp://wiki.eclipse.org/Eclipse_Project_Update_Sites<br />3/21/2011<br />11<br />
  12. 12. #5Don’t categorize things<br />p2 only shows what’s been categorized<br />Repository designers are responsible for designing their categories<br />Classic consumer / producer problem<br />3/21/2011<br />12<br />
  13. 13. Remember:Category tricks<br />Use categories !<br />The category publisher is here to help<br />Use composite repositories where one of the repo carry the categories<br />Use meaningful name, and use the description. The feature name is shorter than a tweet.<br />3/21/2011<br />13<br />
  14. 14. #6Ignore your version ranges<br />Specify a strict dependency on 3.6.1 and wonder why your users can’t install on 3.6.2?<br />Most illegible p2 error messages are a result of poorly set version ranges<br />3/21/2011<br />14<br />
  15. 15. Instead:Consider your version ranges <br />Version your packages, bundles and features<br />Use version ranges for dependencies:<br />Up-to by not including [3.6.0, 3.7.0) <br />Unbounded lower [0.0.0, 3.7.0)<br />Unbounded higher 2.0<br />Strict Versions [3.6.1, 3.6.1]<br />You need to know what the producer does. <br />3/21/2011<br />15<br />
  16. 16. #7Don’t USE API<br />If you find yourself reaching into internals, ask yourself why?<br />If you manually write to the bundles.info file, ask yourself why?<br />If you edit content.xml / artifacts.xml by hand, ask yourself why?<br />Two problems when you don’t use API:<br />We could break you<br />You could break you<br />3/21/2011<br />16<br />
  17. 17. Instead:Be mindful of what you use<br />Look for provisional API (if real API doesn’t exist)<br />Ask on the p2-mailing list<br />3/21/2011<br />17<br />
  18. 18. #8Use the Metadata generator<br />If you are using the Metadata generator… sorry  (org.eclipse.equinox.p2.metadata.generator)<br />Deprecated two years ago<br />Removed for Indigo<br />3/21/2011<br />18<br />
  19. 19. Instead:Use the Publisher<br />Publisher Applications & Ant Tasks<br />Publish from an Update Site<br />Publish from Features / Bundles<br />Publish from a Product<br />Publish categories<br /># ./eclipse -application org.eclipse.equinox.p2.publisher.UpdateSitePublisher -metadataRepositoryfile:///repo<br />-artifactRepository file:///repo-source http://foo/site.xml-compress-publishArtifacts<br />3/21/2011<br />19<br />
  20. 20. #9Use legacy update sites<br />Legacy update sites don’t include complete metadata<br />Features are downloaded before any dependency resolution can occur<br />Big lag at install time.<br />We will blame you for all p2’s performance problems <br />3/21/2011<br />20<br />
  21. 21. Instead:Use a real build tool <br />PDE Build, Tycho and derivatives (Athena, Buckminster, etc.) all provide facilities to build p2 repositories.<br />If you can’t change your build technology, at lease use the Update Site Publisher.<br />3/21/2011<br />21<br />
  22. 22. #10Spell it P2 <br />I don’t call your project Mylin, έMF, or BERT<br />3/21/2011<br />22<br />
  23. 23. Remember:The project is:<br />p2<br />3/21/2011<br />23<br />
  24. 24. Useful links<br />http://wiki.eclipse.org/Equinox_p2<br />http://wiki.eclipse.org/Equinox/p2/Getting_Started<br />http://wiki.eclipse.org/Equinox/p2/Publisher<br />http://aniefer.blogspot.com/2008/06/example-headless-build-for-rcp-product.html<br />3/21/2011<br />24<br />

×