How does this sound?

Plans for PackageManager 2.0

Michael Young

PackageManager history

  • Before 2018: Install new packages by hand
    • download, extract, autoconf, configure, make
  • PackageManager started in GAP Days Fall 2018
  • PackageManager 1.6.2 released yesterday

Current functionality

  • Install/remove packages in one line
  • Handles dependencies
  • Compiles automatically
  • Allows multiple sources
    • Package name
    • Archive URL
    • Version control repo
    • PackageInfo.g file

Current problems

  1. Uses rudimentary package list
  2. Distracting function names
  3. Messy system of options/interactivity

Problem 1. Package list

  • Current package list: a csv file of package names with links to PackageInfo files
    • Only retrieves latest released version
    • Need to download to discover dependencies
    • No central check for new versions

New package list

  • Plan: start using gap-system/PackageDistro
    • Structured json with all data from PackageInfo files
    • Accepted after careful checking
    • latest as well as a version for each GAP release
  • Advantages:
    • Single resource (110kB) with all required info
    • Can be cached
    • Stability
    • Trivial to track release for a GAP version

Problem 2. Function names

  • PackageManager provides InstallPackage, which dispatches to:
    • InstallPackageFromName
    • InstallPackageFromHg
    • InstallPackageFromArchive
    • InstallPackageFromInfo
    • InstallPackageFromGit
  • Each has its own argument-checking, options and bugs
  • These all call each other internally
  • We also have UpdatePackage which does the same thing

Simpler function names

  • InstallPackageFrom* are already deprecated for users
  • Make UpdatePackage a synonym
  • Use InstallPackage for everything

Problem 3. Options/interactivity

Some use of interactivity

gap> UpdatePackage("io");
#I  io version 4.6.0 will be installed, replacing 4.5.4
#I  Saved archive to /tmp/tm7r5Ug7/io-4.6.0.tar.gz
Remove old version of io at /home/user/.gap/pkg/io-4.5.4 ? [y/N] y
true

Some use of options

InstallPackage("digraphs" : keepDirectory);

Some use of optional parameters

InstallPackage("example", true);

Some use of global variables

PKGMAN_SetCustomPackageDir("~/Desktop/gap/pkg");

New options records

  • Introduce cascading system of options records
  • On calling a function, behaviour is determined by:
    1. Options record passed to function
    2. Global options record configurable by user
    3. Default options
gap> SetPackageManagerOption("distroVersion", "latest");
gap> SetPackageManagerOption("interactive", false);
gap> InstallPackage("semigroups", rec(version := "5.6.0"));
  • Some behaviour interactive by default
    • Option to disable interactivity entirely

InstallPackage
kind of input
VC repo
package name
packageinfo/archive url
Compute dependency graph
Download and unpack marked
Mark unsatisfied requirements
Mark available upgrades
opt getLatest
no
yes
Compile all in graph
Download and unpack
Inspect dependencies
Clone or pull
Make doc

How does that sound?

  • Work has started in dev-2.0 branch
  • Not too late to change decisions

PackageManager