This issue proposes the introduction of dependency package sets (similar to stackage resolver) for use in Juvix Package.juvix.
Definitions
A package set is a collection of package versions and a Juvix compiler version that are known to work together.
A registry is a git repository that hosts versioned package sets.
Use case
Currently users must specify the versions of each dependency explicitly in the Package.juvix file. This is the most flexible way of supporting dependency versions. However the core packages that we maintain (e.g stdlib, containers, test) are updated to work together and with the latest compiler. This information is not known to the user. This issue proposes to bundle together versions of the core packages that are known to work together into a package-set that the user can depend on in the Package.juvix file.
We (the Juvix team) would maintain an official registry for ease of use. Users could also define their own package set if desired.
The existing method of declaring dependencies individually would be maintained.
PackageDescription.V3
Existing Package.juvix files will remain unchanged and they will work the same as before. To use a package set users must opt in to PackageDescription.V3. A draft of this module is available.
Package examples
Package declaration with default / official registry and extra dependencies that are not specified in the registry.
The metadata directory contains information about each package that are common to every version, for example its location:
test.yaml
location:
github:
org: anoma
repo: juvix-test
The package-set directory contains a file for each package-set version that lists the supported compiler version and the supported versions of each package. The version of each package refers to the git ref at the corresponding location defined in the packages metadata file.
Thanks to @janmasrovira for help with the design.
This issue proposes the introduction of dependency package sets (similar to stackage resolver) for use in Juvix
Package.juvix
.Definitions
A package set is a collection of package versions and a Juvix compiler version that are known to work together.
A registry is a git repository that hosts versioned package sets.
Use case
Currently users must specify the versions of each dependency explicitly in the
Package.juvix
file. This is the most flexible way of supporting dependency versions. However the core packages that we maintain (e.g stdlib, containers, test) are updated to work together and with the latest compiler. This information is not known to the user. This issue proposes to bundle together versions of the core packages that are known to work together into a package-set that the user can depend on in the Package.juvix file.PackageDescription.V3
Existing
Package.juvix
files will remain unchanged and they will work the same as before. To use a package set users must opt in toPackageDescription.V3
. A draft of this module is available.Package examples
Package declaration with default / official registry and extra dependencies that are not specified in the registry.
Package declaration with a custom registry location.
Package Registry
The definition of a package set is stored in a package registry. This is a git repository with the following structure:
The metadata directory contains information about each package that are common to every version, for example its location:
test.yaml
The package-set directory contains a file for each package-set version that lists the supported compiler version and the supported versions of each package. The version of each package refers to the git ref at the corresponding location defined in the packages metadata file.
0.1.0.yaml
Default registry
As described above a default registry location would be built into the compiler, for example we could host it at "https://github.com/anoma/juvix-registry".
Users may define a custom registry location in the
Package.juvix
or override the default registry location using a compiler flag:For example:
overridingDependencies
andextraDependencies
fieldsThe
extraDependencies
field is to declare dependencies that are not present in the package-set.The
overridingDependencies
field is to declare a dependency which overrides an existing dependency in the package-set.Behaviour
If a package registry is used, juvix will resolve dependencies against the registry's package-set.
The following error cases apply:
PackageDescription
defaultPackage
The behaviour of
defaultPackage
will not change. That is, it creates aPackage
that depends only on thedefaultStdlib
bundled with the compiler.