Sign in Join
Wiki copytemporary

Packaging System and dividing FPC - Lazarus into packages

Introduction

FPC is quite a large body of source, and the organisation of the source is a constant problem, with immense effects on release engineering, deployment and packaging. On this page I try to describe some of the problems involved with how FPC is packaged. This is not a constant situation, it evolves as new packages, dependencies and insights are acquired.

This page is updated for the changes in early 2008 when fcl was split up into packages, and all packages (fv + fcl subpkgs + extra + base) reside in packages/ and have an own dependance system for build order.

Order of building

Besides merely splitting up the source into packages, there is also a dependency and order-of-building problem. Currently, the order of compilation is split up in certain generations:

  1. rtl-compiler-rtl-compiler-rtl-compiler (the cycle)
  2. RTL
  3. packages/( a collection of packages)
  4. IDE / utils

Note, when packages in packages/ have dependancies on other packages, then the makefile(.fpc) in packages must be also fixed, to allow smooth paralel compilation.

Requirements

Tips

External Library Dependencies

One should be careful where packages are put that have external libraries as dependencies, this because other packages that don't require the dependency on the lib itself, acquire it because they use some parts of a package that requires it.

Examples:

This gets even more important if we start bundling packages into dynamic libs. If we would stuff all units in one big lib (which is easiest from a deployment and maintenance view), this big shared lib would have three dozen library dependencies, from Oracle to little things like X widget sets.

Breaking the dependency cycle

If you have a package that must be relatively early in the hierachy, but there is a dependency on a library that is only sideways relevant, then you have a problem. There are several general solutions:

Outer RTL

From time to time one sees the term "Outer RTL" on the FPC lists. The "Outer RTL" is a phrase coined in discussions about decreasing the size of the current RTL that is compiled 4 times in every build process. This mainly to decrease build time and thus make compiler development less annoying. Essentially it means that all units not required by the compiler should move out of the current RTL package.

Some of these units can move to independant packages. Outer RTL is a name for a package that is more or less what remains. E.g.:

To my knowledge, the only reason against this approach is the inflation of the word "RTL". People might expect units in package RTL to be the same as specified in the manual of TP/BP or Delphi for "RTL". (as far as that exists, and the packaging isn't merely due to layout of the respective source trees). I find this reasoning highly doubtful, since we already break compability with Delphi/TP in much, much more complex ways, for such utter minor detail to be a serious enough source of confusion to complicate the buildprocess for it.

Try to offer as much sourcecode as possible per compiler invocation

Offering the compiler binary as much source as possible in one go is very important for performance because: This also goes for multiple "main" files. If a project has multiple .exe's, the compiler should be able to compile them in one run.

Documentation of the new package system

 20:13 < Synopsis> oliebol: there is no docs about fppkg
 20:13 < Synopsis> oliebol: the docs are the source :)
 20:14 < Synopsis> see compiler/utils/fppkg.pp and rtl/common/fpmkunit.pp

Performance

Besides ease of use, a good package system and design could speed up building significantly. Specially if we somehow can get a tool that "lives" during the entire build process (preferably the compiler), due to caching .ppu's etc, speed improvements could be made.

This is also a possibility for dual core to shine.

Planning

To get the packaging working fully, the following steps are envisioned:

  1. get building working
  2. get installing working
  3. get packaging working
  4. decide on repository layout
  5. local repository setup
  6. design upload (=filecopy) to local repository
  7. design download (=filecopy) from local repository
  8. integrate network stuff
  9. remote repository
  10. signing of packages

From the Free Pascal wiki, page "Packaging System and dividing FPC - Lazarus into packages", as it stood on 2014-07-23 after a change by BigChimp, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.

Revision 1, last changed by WikiArchive .

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.