Free Pascal Compiler has released full dynamic package support, allowing developers to create and install components, controls, and Lazarus extensions without rebuilding the entire IDE, according to an announcement on getlazarus.org.

Dynamic packages function as standard shared library files for Linux, Windows, and macOS, containing compiler-generated metadata that can be inspected using new RTL units. The implementation includes runtime mechanisms for safely preserving thread variables and managing dynamic types like strings and dynamic arrays between programs and packages.
The feature enables two deployment approaches: bundling everything into a single executable, or dividing the program into multiple dynamic packages that can be replaced while the program runs, creating a plugin system.
Several restrictions apply to dynamic packages. Unit names contained in a package cannot match the package name itself—the system automatically appends “Package” to the generated Pascal source file. For example, a package called “ElectroTools.lpk” generates a source file named “ElectroToolsPackage.pas.” Unit names must also be unique across all packages; conflicting unit names require either selecting which package to install or renaming units. Dynamic packages are larger than standard shared libraries because they contain a complete metadata map, and stripping a package removes the metadata required for it to function as a dynamic package.
The Lazarus IDE includes several enhancements to support dynamic packages. A new progress window notifies developers when packages are being rebuilt after source code changes. A new Packages window, docked on the right by default, displays recently opened packages and persists between sessions. When developers click Compile in a package window, associated controls and components update within seconds, significantly accelerating development cycles compared to rebuilding the entire IDE.
Package management improvements include the ability to add or remove packages without requiring an IDE rebuild. Package options now include IDE Integrations settings that restrict packages to specific platforms or widget sets. Developers can also convert forms or frames into installable controls automatically added to the component palette.
A new RTL unit, DynPkgTypes.pas, provides functions for loading, enumerating, searching, and unloading packages at runtime using standard RTTI information. The complete changes to FPC and Lazarus have been committed to GitLab in a branch named “dynamic packages.”
Key facts
- Dynamic packages allow installing IDE components and extensions without rebuilding the entire IDE
- Packages function as standard shared library files for Linux, Windows, and macOS with compiler-generated metadata
- Unit names must be unique across packages and cannot match the package name
- A new RTL unit (DynPkgTypes.pas) enables runtime package inspection and manipulation using RTTI
- Lazarus IDE includes a progress window, Packages window, and faster compilation for package changes
