Skip to content

pharo-pkg/pakbot

Repository files navigation

Image of Pakbot

Pakbot package manager Build Status

Pakbot is a lightweitgh package manager for Smalltalk.

What are the motivations behind Pakbot?

  • Dependencies expressed at the package level. We want that each package describes its own dependencies in a synthetic way.
  • Dependencies as first-class objects, so that tools can use them to offer added value
  • Better handling of platform-specific packages. In big project with a lot of dependencies that could be run on various platforms (e.g. Seaside), the description of platform-specific dependendies leads to wide specification, hard to maintain. Cargo tries to solve this problem by providing a low-coupling dependency to manage this kind of dependencies.
  • Support update strategies through the use of semantic versionning
  • Provide a central place to publis package versions and provide a web site on top of it to query on available packages (something similar to https://packagist.org/).

Cargo big picture

Cargo big picture

Pakbot basics

Pakbot is a package manager. It automates the process of installing, upgrading and removing Smalltalk programs and libraries for a Smalltalk image in a consistent manner. A package manager deals with packages, distributions of software. Pakbot deals with Projects containing metadata and packages, such as the software's name, description of its purpose, version number, vendor, and a list of dependencies necessary for the software to run properly.

Projects

Projects are the unit of distribution of a software. It is the minimal artefact you can load. Pakbot defines 3 kind of packages:

  • package unit: it represents a piece of code in a specific version. It has dependencies.
  • package assembly: it represents a set of package units or package assemblies. It is useful to group a coherent set of packages all together. Assemblies do not have dependencies.
  • virtual package: they are there to manage smoothly platform-specific packages. A virtual package is a special kind of package. It has only a name, a version and a description (you can define here the contract implied by the virtual package). Some concrete packages (units) will provide them, some others will require them. They offer low-coupling in dependencies description but have to be used carefully (no formal contract, just rely on the package name and version). This concept comes from the [Debian distribution] (http://www.linuxtopia.org/online_books/linux_system_administration/debian_linux_guides/debian_linux_faq/ch-pkg_basics.en_007.html). Pakbot packages

Loading projects

You can ask Pakbot to load one or many projects. Pakbot will select adequate project versions according to your platform attributes and already installed projects. The package selection is called the solving of the user query. It results in getting back Pakbot load instructions that is an object representing the list of projects to load in order. Pakbot load instructions are serializable so that they can be used for off-line loading for example.

Updating projects

Pakbot relies on semantic versioning to determine compatibility between versions of a package. It implies that only a major version change could break the backward-compatibility of a project. In other words, a patch version update (e.g. 1.2.0 => 1.2.1) or a minor version update (e.g. 1.2.1 => 1.3) should be compitable with packages working with the previous version. So, it is important that developers update the version number of a package with care by asking himself some questions:

  • did I make incompatible API changes? If yes, a major version increment is needed.
  • did I introduce new functionalities without breaking backward-compatibility?. If yes, a minor version increment is needed.
  • did I fix a bug in a backward-compatible way? If yes, a patch version increment is needed. In development mode, to avoid to publish a new package version to share your code with users or developers, you can use a special suffix (e.g. 2.1-dev) to tag a version as a development version. Pakbot will allow you to override this version in the Pakbot package repository. It means that you will be able to publish many times the same version with possibly different code.

How to use Pakbot?

Pakbot comes with an API inspired by the one available in the latest versions of Metacello.

Install Pakbot

Metacello new 
	repository: 'github://pharo-pkg/pakbot/repository';
	baseline: 'Pakbot';
	load

Publish a package

When you are done with the development phase (including testing) of your functionality, you are ready to share this new version to your users. Ensure that

  • you saved your code to your prefered Source Code Management system,
  • the package metadata are up to date: package name, version number, source code repository, package dependencies, package description, etc. Once done, you can publish your package to the Pakbot repository.