SlideShare a Scribd company logo
1 of 24
Download to read offline
p2, your savior
or your Achilles
heel?
Everything an
Eclipse team
needs to know
about p2!
R. Ian Bull
Pascal Rapicault
2               3/21/2011




Alternate Titles
 10 reasons we closed your p2 bugs as INVALID?
 10 ways to get booted from the p2 mailing list!
 10 excuses why we didn’t buy you a beer 


 p2,   10 common pitfalls and how to avoid them.
3                      3/21/2011



#1
Move / remove files on disk
 Leading   cause of p2 failures:
       developers tampering with plugins/ folder
 If
   you no longer need a plugin DO NOT
  REMOVE IT BY HAND
 Do not move, unzip or change a plug-in in
  your plugins/ directory
4                   3/21/2011



Instead:
Let p2 manage your install
 Other   plug-ins may depend on it
 If a plug-in is no longer needed, p2 will
  remove it
     Run the Garbage Collector manually if you
      want




 # ./eclipse –application 
 org.eclipse.equinox.p2.garbagecollector.application
5                 3/21/2011



#2
Unzip your plug-ins over Eclipse
 Do  you provide a zip file for your plugins?
 Do you instruct your users to unzip over
  eclipse
     We don’t like you! (And we will sabotage
      your wiki page  )
6               3/21/2011



Instead:
Provide a repository
 Repositories can be zipped and
  downloaded!
 Users can simply point to the compressed
  repository to properly install your plug-in

 Avoid    the use of drop-ins too
7                  3/21/2011



#3
Replace published content
 Neverpublish different content with the
  same version number!
     Do not make a change and use the same
      version number
     Do not build plug-ins as Foo v1.0.0.HEAD

 You’ll   never know what your user runs.
8                    3/21/2011




Remember:
Version / ID pairs are immutable
 If
   the Version / ID has not changed, the
  content hasn’t changed!

 Always  publish new metadata and
  artifacts for each code change
      Use .qualifiers for all bundles / plug-ins and
       features

 If
   you can’t rebuild everything, provide
  patches to deliver surgical updates
9                        3/21/2011



Reuse:
Tips and Tricks
   Context repositories
 build.properties:
 repoBaseLocation=${buildDirectory}/inputRepositories
 transformedRepoLocation=${buildDirectory}/transformedRepo


   Qualifier replacement / bundle reuse
     forceContextQualifier: Replaces the qualifier of all
      your bundles (use build timestamp)

   Feature patches:
      http://help.eclipse.org/helios/index.jsp?topic=/org.eclips
      e.pde.doc.user/guide/tools/project_wizards/new_featur
      e_patch.htm
      (or google: eclipse p2 feature patch) 
10                    3/21/2011



#4
Alter a released repository
 “Release”     repositories are serious stuffs!
    People will refer to them from their repo to
     avoid duplicating your content
    People will refer to them from their build

 Removing      content from a “release” repo
 is a felony!
11                     3/21/2011



Instead:
Be mindful of your users / repos
   Preserve content at the same URL

   If you put out bad bytes, publish a new version.
    Don’t remove the old one !
       Append new version to existing repo.
         Disk is cheap, users not patient (and they’ll blame p2).
       For this, use p2 composite repositories.

   Define clear retention policies
       For example, the policies for the SDK
        http://wiki.eclipse.org/Eclipse_Project_Update_Sites
12               3/21/2011



#5
Don’t categorize things
 p2 only shows what’s been categorized
 Repository designers are responsible for
  designing their categories
 Classic consumer / producer problem
13                   3/21/2011



Remember:
Category tricks
 Use   categories !
    The category publisher is here to help
    Use composite repositories where one of
     the repo carry the categories

 Usemeaningful name, and use the
 description. The feature name is shorter
 than a tweet.
14                  3/21/2011



#6
Ignore your version ranges
 Specify
        a strict dependency on 3.6.1 and
 wonder why your users can’t install on
 3.6.2?
    Most illegible p2 error messages are a result
     of poorly set version ranges
15               3/21/2011



Instead:
Consider your version ranges
 Version your packages, bundles and
  features
 Use version ranges for dependencies:
     Up-to by not including [3.6.0, 3.7.0)
     Unbounded lower [0.0.0, 3.7.0)
     Unbounded higher 2.0
     Strict Versions [3.6.1, 3.6.1]


 You   need to know what the producer does.
16              3/21/2011



#7
Don’t USE API
 If you find yourself reaching into internals,
  ask yourself why?
 If you manually write to the bundles.info
  file, ask yourself why?
 If you edit content.xml / artifacts.xml by
  hand, ask yourself why?

 Two    problems when you don’t use API:
      We could break you
      You could break you
17                 3/21/2011



Instead:
Be mindful of what you use
 Look   for provisional API (if real API doesn’t
  exist)
 Ask on the p2-mailing list
18                     3/21/2011



#8
Use the Metadata generator
 If
   you are using the Metadata
  generator… sorry 
     (org.eclipse.equinox.p2.metadata.generator)
      Deprecated two years ago
      Removed for Indigo
19                  3/21/2011



Instead:
Use the Publisher
 Publisher   Applications & Ant Tasks
     Publish from an Update Site
     Publish from Features / Bundles
     Publish from a Product
     Publish categories
 # ./eclipse -application
 org.eclipse.equinox.p2.publisher.UpdateSitePublisher
 -metadataRepository file:///repo
 -artifactRepository file:///repo
 -source http://foo/site.xml
 -compress
 -publishArtifacts
20                3/21/2011



#9
Use legacy update sites
 Legacyupdate sites don’t include
 complete metadata
     Features are downloaded before any
      dependency resolution can occur


 Biglag at install time.
 We will blame you for all p2’s
  performance problems 
21                3/21/2011



Instead:
Use a real build tool
 PDE  Build, Tycho and derivatives (Athena,
  Buckminster, etc.) all provide facilities to
  build p2 repositories.
 If you can’t change your build
  technology, at lease use the Update Site
  Publisher.
22                3/21/2011



#10
Spell it P2 
I   don’t call your project Mylin, έMF, or BERT
23   3/21/2011



Remember:
The project is:
24                   3/21/2011




Useful links
   http://wiki.eclipse.org/Equinox_p2
   http://wiki.eclipse.org/Equinox/p2/Getting_Started
   http://wiki.eclipse.org/Equinox/p2/Publisher
   http://aniefer.blogspot.com/2008/06/example-
    headless-build-for-rcp-product.html

More Related Content

What's hot

L0016 - The Structure of an Eclipse Plug-in
L0016 - The Structure of an Eclipse Plug-inL0016 - The Structure of an Eclipse Plug-in
L0016 - The Structure of an Eclipse Plug-inTonny Madsen
 
Building Eclipse Plugins
Building Eclipse PluginsBuilding Eclipse Plugins
Building Eclipse PluginsLiran Zelkha
 
Eclipse plug in development
Eclipse plug in developmentEclipse plug in development
Eclipse plug in developmentMartin Toshev
 
PDE Good Practices
PDE Good PracticesPDE Good Practices
PDE Good PracticesAnkur Sharma
 
Jenkins introduction
Jenkins introductionJenkins introduction
Jenkins introductionGourav Varma
 
Tycho Tutorial (EclipseCon 2012)
Tycho Tutorial (EclipseCon 2012)Tycho Tutorial (EclipseCon 2012)
Tycho Tutorial (EclipseCon 2012)jsievers
 
Automating the consumption of Eclipse for internal use
Automating the consumption of Eclipse for internal useAutomating the consumption of Eclipse for internal use
Automating the consumption of Eclipse for internal usePascal Rapicault
 
Eclipse RCP Overview @ Rheinjug
Eclipse RCP Overview @ RheinjugEclipse RCP Overview @ Rheinjug
Eclipse RCP Overview @ RheinjugLars Vogel
 
Using Go in DevOps
Using Go in DevOpsUsing Go in DevOps
Using Go in DevOpsEficode
 
Large scale automation with jenkins
Large scale automation with jenkinsLarge scale automation with jenkins
Large scale automation with jenkinsKohsuke Kawaguchi
 
Log management (elk) for spring boot application
Log management (elk) for spring boot applicationLog management (elk) for spring boot application
Log management (elk) for spring boot applicationVadym Lotar
 
What's new in Eclipse Mars
What's new in Eclipse MarsWhat's new in Eclipse Mars
What's new in Eclipse MarsLakshmi Priya
 
Eclipse in Telemedicine and Health Care - A Success Story with RCP and RAP
Eclipse in Telemedicine and Health Care - A Success Story with RCP and RAPEclipse in Telemedicine and Health Care - A Success Story with RCP and RAP
Eclipse in Telemedicine and Health Care - A Success Story with RCP and RAPRalf Sternberg
 
Peering Inside the Black Box: A Case for Observability
Peering Inside the Black Box: A Case for ObservabilityPeering Inside the Black Box: A Case for Observability
Peering Inside the Black Box: A Case for ObservabilityVMware Tanzu
 
Building GPE: What We Learned
Building GPE: What We LearnedBuilding GPE: What We Learned
Building GPE: What We Learnedrajeevdayal
 
The Build System of Commercial RCP Application A Case Study
The Build System of Commercial RCP Application A Case StudyThe Build System of Commercial RCP Application A Case Study
The Build System of Commercial RCP Application A Case Studygustavoeliano
 

What's hot (20)

L0016 - The Structure of an Eclipse Plug-in
L0016 - The Structure of an Eclipse Plug-inL0016 - The Structure of an Eclipse Plug-in
L0016 - The Structure of an Eclipse Plug-in
 
Building Eclipse Plugins
Building Eclipse PluginsBuilding Eclipse Plugins
Building Eclipse Plugins
 
Eclipse plug in development
Eclipse plug in developmentEclipse plug in development
Eclipse plug in development
 
PDE Good Practices
PDE Good PracticesPDE Good Practices
PDE Good Practices
 
Jenkins introduction
Jenkins introductionJenkins introduction
Jenkins introduction
 
Maven 3 / Tycho
Maven 3 / TychoMaven 3 / Tycho
Maven 3 / Tycho
 
PDE builds or Maven
PDE builds or MavenPDE builds or Maven
PDE builds or Maven
 
Tycho Tutorial (EclipseCon 2012)
Tycho Tutorial (EclipseCon 2012)Tycho Tutorial (EclipseCon 2012)
Tycho Tutorial (EclipseCon 2012)
 
Automating the consumption of Eclipse for internal use
Automating the consumption of Eclipse for internal useAutomating the consumption of Eclipse for internal use
Automating the consumption of Eclipse for internal use
 
Eclipse RCP Overview @ Rheinjug
Eclipse RCP Overview @ RheinjugEclipse RCP Overview @ Rheinjug
Eclipse RCP Overview @ Rheinjug
 
Using Go in DevOps
Using Go in DevOpsUsing Go in DevOps
Using Go in DevOps
 
Large scale automation with jenkins
Large scale automation with jenkinsLarge scale automation with jenkins
Large scale automation with jenkins
 
Log management (elk) for spring boot application
Log management (elk) for spring boot applicationLog management (elk) for spring boot application
Log management (elk) for spring boot application
 
What's new in Eclipse Mars
What's new in Eclipse MarsWhat's new in Eclipse Mars
What's new in Eclipse Mars
 
Eclipse in Telemedicine and Health Care - A Success Story with RCP and RAP
Eclipse in Telemedicine and Health Care - A Success Story with RCP and RAPEclipse in Telemedicine and Health Care - A Success Story with RCP and RAP
Eclipse in Telemedicine and Health Care - A Success Story with RCP and RAP
 
Peering Inside the Black Box: A Case for Observability
Peering Inside the Black Box: A Case for ObservabilityPeering Inside the Black Box: A Case for Observability
Peering Inside the Black Box: A Case for Observability
 
Eclipse IDE
Eclipse IDEEclipse IDE
Eclipse IDE
 
Building GPE: What We Learned
Building GPE: What We LearnedBuilding GPE: What We Learned
Building GPE: What We Learned
 
The Build System of Commercial RCP Application A Case Study
The Build System of Commercial RCP Application A Case StudyThe Build System of Commercial RCP Application A Case Study
The Build System of Commercial RCP Application A Case Study
 
Maven
MavenMaven
Maven
 

Similar to p2, your savior or your achilles heel? Everything an Eclipse team needs to know about p2

Do's and Do not's about p2
Do's and Do not's about p2Do's and Do not's about p2
Do's and Do not's about p2Pascal Rapicault
 
Aleksandr Kutsan "Managing Dependencies in C++"
Aleksandr Kutsan "Managing Dependencies in C++"Aleksandr Kutsan "Managing Dependencies in C++"
Aleksandr Kutsan "Managing Dependencies in C++"LogeekNightUkraine
 
Digital Fabrication Studio v.0.2: Information
Digital Fabrication Studio v.0.2: InformationDigital Fabrication Studio v.0.2: Information
Digital Fabrication Studio v.0.2: InformationMassimo Menichinelli
 
Version Control Training - First Lego League
Version Control Training - First Lego LeagueVersion Control Training - First Lego League
Version Control Training - First Lego LeagueJeffrey T. Pollock
 
Composer the Right Way - MM16NL
Composer the Right Way - MM16NLComposer the Right Way - MM16NL
Composer the Right Way - MM16NLRafael Dohms
 
Yocto vs. Debian white paper
Yocto vs. Debian white paperYocto vs. Debian white paper
Yocto vs. Debian white paperMads Doré
 
Digital Fabrication Studio.02 _Information @ Aalto Media Factory
Digital Fabrication Studio.02 _Information @ Aalto Media FactoryDigital Fabrication Studio.02 _Information @ Aalto Media Factory
Digital Fabrication Studio.02 _Information @ Aalto Media FactoryMassimo Menichinelli
 
Makefile
MakefileMakefile
MakefileIonela
 
Mining Component Repositories for Installability Issues
Mining Component Repositories for Installability IssuesMining Component Repositories for Installability Issues
Mining Component Repositories for Installability IssuesRoberto Di Cosmo
 
SVN Usage & Best Practices
SVN Usage & Best PracticesSVN Usage & Best Practices
SVN Usage & Best PracticesAshraf Fouad
 
7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins UsersAndrew Bayer
 
"How to Use Bazel to Manage Monorepos: The Grammarly Front-End Team’s Experie...
"How to Use Bazel to Manage Monorepos: The Grammarly Front-End Team’s Experie..."How to Use Bazel to Manage Monorepos: The Grammarly Front-End Team’s Experie...
"How to Use Bazel to Manage Monorepos: The Grammarly Front-End Team’s Experie...Fwdays
 
Hot deployments with distillery
Hot deployments with distilleryHot deployments with distillery
Hot deployments with distilleryJeffrey Chan
 
Implementing xpages extension library
Implementing xpages extension libraryImplementing xpages extension library
Implementing xpages extension librarydominion
 
eBPF — Divulging The Hidden Super Power.pdf
eBPF — Divulging The Hidden Super Power.pdfeBPF — Divulging The Hidden Super Power.pdf
eBPF — Divulging The Hidden Super Power.pdfSGBSeo
 
Composer the right way - NomadPHP
Composer the right way - NomadPHPComposer the right way - NomadPHP
Composer the right way - NomadPHPRafael Dohms
 
Composer the right way - SunshinePHP
Composer the right way - SunshinePHPComposer the right way - SunshinePHP
Composer the right way - SunshinePHPRafael Dohms
 

Similar to p2, your savior or your achilles heel? Everything an Eclipse team needs to know about p2 (20)

Do's and Do not's about p2
Do's and Do not's about p2Do's and Do not's about p2
Do's and Do not's about p2
 
Aleksandr Kutsan "Managing Dependencies in C++"
Aleksandr Kutsan "Managing Dependencies in C++"Aleksandr Kutsan "Managing Dependencies in C++"
Aleksandr Kutsan "Managing Dependencies in C++"
 
Digital Fabrication Studio v.0.2: Information
Digital Fabrication Studio v.0.2: InformationDigital Fabrication Studio v.0.2: Information
Digital Fabrication Studio v.0.2: Information
 
Version Control Training - First Lego League
Version Control Training - First Lego LeagueVersion Control Training - First Lego League
Version Control Training - First Lego League
 
Composer the Right Way - MM16NL
Composer the Right Way - MM16NLComposer the Right Way - MM16NL
Composer the Right Way - MM16NL
 
Yocto vs. Debian white paper
Yocto vs. Debian white paperYocto vs. Debian white paper
Yocto vs. Debian white paper
 
Digital Fabrication Studio.02 _Information @ Aalto Media Factory
Digital Fabrication Studio.02 _Information @ Aalto Media FactoryDigital Fabrication Studio.02 _Information @ Aalto Media Factory
Digital Fabrication Studio.02 _Information @ Aalto Media Factory
 
Makefile
MakefileMakefile
Makefile
 
Mining Component Repositories for Installability Issues
Mining Component Repositories for Installability IssuesMining Component Repositories for Installability Issues
Mining Component Repositories for Installability Issues
 
SVN Basics
SVN BasicsSVN Basics
SVN Basics
 
SVN Usage & Best Practices
SVN Usage & Best PracticesSVN Usage & Best Practices
SVN Usage & Best Practices
 
7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users7 Habits of Highly Effective Jenkins Users
7 Habits of Highly Effective Jenkins Users
 
"How to Use Bazel to Manage Monorepos: The Grammarly Front-End Team’s Experie...
"How to Use Bazel to Manage Monorepos: The Grammarly Front-End Team’s Experie..."How to Use Bazel to Manage Monorepos: The Grammarly Front-End Team’s Experie...
"How to Use Bazel to Manage Monorepos: The Grammarly Front-End Team’s Experie...
 
Using svn
Using svnUsing svn
Using svn
 
Hot deployments with distillery
Hot deployments with distilleryHot deployments with distillery
Hot deployments with distillery
 
Implementing xpages extension library
Implementing xpages extension libraryImplementing xpages extension library
Implementing xpages extension library
 
eBPF — Divulging The Hidden Super Power.pdf
eBPF — Divulging The Hidden Super Power.pdfeBPF — Divulging The Hidden Super Power.pdf
eBPF — Divulging The Hidden Super Power.pdf
 
What's new in p2 (2009)?
What's new in p2 (2009)?What's new in p2 (2009)?
What's new in p2 (2009)?
 
Composer the right way - NomadPHP
Composer the right way - NomadPHPComposer the right way - NomadPHP
Composer the right way - NomadPHP
 
Composer the right way - SunshinePHP
Composer the right way - SunshinePHPComposer the right way - SunshinePHP
Composer the right way - SunshinePHP
 

p2, your savior or your achilles heel? Everything an Eclipse team needs to know about p2

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