Problem: several GAP packages have external dependencies that one has to install in order to use them. But packages have no systematic way of specifying that in a way that could be used by automated tools (there is the ExternalConditions but it is at best a hint for humans).
As a result, e.g. the GAP package distribution hardcodes a list of such dependencies. For the GitHub Workflow actions we also could benefit from such a list; and in our INSTALL.md we provide some some additional hard curated information about packages.
Solving this in general is a fiendishly difficult problem and I have no ambitions to do that.
My goal is rather to solve this for, let's say, the ubuntu-latest and macos-latest runners on GitHub, and maybe a bit beyond: "most" Debian/Ubuntu systems, "most" macOS systems using Homebrew, and perhaps a few bonus Linux distros thrown in (e.g. Fedora).
This can be done by simply encoding the package names that need to be installed in each case. Here is my proposal for how that could look. Specifically I am thinking of adding something like this to the Dependencies record in PackageInfo.g for various packages. This is the entry for example package:
# for packages that need external software, besides the purely descriptive
# `ExternalConditions` we also offer the following, which gives an
# actionable description of needed external software at least for some
# package distributions.
# If present this must be a record. The keys specify the package manager.
# For Linux distributions, it uses the Distributor IDs as provided by
# `lsb_release -i`. For Homebrew on macOS, use "Homebrew".
#
# Each of these then maps to a list of package descriptors. Each package
# descriptor is a list of strings. The first string is the name of a system
# package to be installed. The others are reserved for future usage (e.g. to
# specify minimal package versions)
NeededSystemPackages := rec(
#Homebrew := [["somepackage"]],
#Debian := [["libsomepackage-dev"]],
#Ubuntu := [["libsomepackage-dev"]],
#Fedora := [["somepackage-devel"]],
),
This is how it would look for curlInterface (CC @ChrisJefferson)
NeededSystemPackages := rec(
Homebrew := [["curl"]],
Debian := [["libcurl4-openssl-dev"]],
Ubuntu := [["libcurl4-openssl-dev"]],
Fedora := [["curl-devel"]],
),
Goals:
Optional bonus goals:
In addition I think these lists will also be helpful for downstream packagers -- even if you package this for, say, FreeBSD, and thus can't use the package names directly, it still gives you a fairly good idea about what is needed
Non-goals:
- trying to solve this for "every distro"
- defining some kind of "universal package identifier"
- trying to have this work
- trying to make this bullet proof -- e.g. if a distro renames a package, it's not immediately clear what to d. I suggest we worry about that when/if it happens...
- deal with any kind of optional / conditional dependency
Assuming we agree on this or a variation, some things need to be done:
Note that an alternative pre-proposal exists in gap-system/PackageDistro#1211 but I don't see how to implement what is proposed there without a lot more work than what I suggest here; and the added benefit of that is unclear to me. As far as I can tell, under the hood the proposed tooling resorts to a hardcoded list of package names in various distributions anyway (but I might be wrong on that). That said, I'd be open to such a "better" (?) solution if someone wants to work on it; but in the meantime my proposal is meant to provide precisely what we need for the PackageDistro and also for some other tooling (e.g. gap-actions for workflows) while being fairly easy to implement.
Problem: several GAP packages have external dependencies that one has to install in order to use them. But packages have no systematic way of specifying that in a way that could be used by automated tools (there is the
ExternalConditionsbut it is at best a hint for humans).As a result, e.g. the GAP package distribution hardcodes a list of such dependencies. For the GitHub Workflow actions we also could benefit from such a list; and in our
INSTALL.mdwe provide some some additional hard curated information about packages.Solving this in general is a fiendishly difficult problem and I have no ambitions to do that.
My goal is rather to solve this for, let's say, the
ubuntu-latestandmacos-latestrunners on GitHub, and maybe a bit beyond: "most" Debian/Ubuntu systems, "most" macOS systems using Homebrew, and perhaps a few bonus Linux distros thrown in (e.g. Fedora).This can be done by simply encoding the package names that need to be installed in each case. Here is my proposal for how that could look. Specifically I am thinking of adding something like this to the
Dependenciesrecord inPackageInfo.gfor various packages. This is the entry forexamplepackage:This is how it would look for
curlInterface(CC @ChrisJefferson)Goals:
Optional bonus goals:
In addition I think these lists will also be helpful for downstream packagers -- even if you package this for, say, FreeBSD, and thus can't use the package names directly, it still gives you a fairly good idea about what is needed
Non-goals:
Assuming we agree on this or a variation, some things need to be done:
ValidatePackageInfoto validate itNote that an alternative pre-proposal exists in gap-system/PackageDistro#1211 but I don't see how to implement what is proposed there without a lot more work than what I suggest here; and the added benefit of that is unclear to me. As far as I can tell, under the hood the proposed tooling resorts to a hardcoded list of package names in various distributions anyway (but I might be wrong on that). That said, I'd be open to such a "better" (?) solution if someone wants to work on it; but in the meantime my proposal is meant to provide precisely what we need for the PackageDistro and also for some other tooling (e.g. gap-actions for workflows) while being fairly easy to implement.