Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document the interpretation of compat ranges in registries #1349

Merged
merged 4 commits into from
Jun 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/src/compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ The format of the version specifier is described in detail below.
!!! info
Use the command `compat` to edit the compat entries in the Pkg REPL, or manually edit the project file.

!!! info
The rules below apply to the `Project.toml` file; for registries, see [Registry Compat.toml](@ref).

## Version specifier format

Similar to other package managers, the Julia package manager respects [semantic versioning](https://semver.org/) (semver).
Expand Down
35 changes: 35 additions & 0 deletions docs/src/registries.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,41 @@ pkg> registry up
Registries automatically update once per session when a package operation is performed so it
rarely has to be done manually.

## Registry format

In a registry, each package gets its own directory; in that directory
are the following files: `Compat.toml`, `Deps.toml`, `Package.toml`,
and `Versions.toml`.
The formats of these files are described below.

### Registry Compat.toml

The `Compat.toml` file has a series of blocks specifying version
numbers, with a set of dependencies listed below. For example,
part of such a file might look like this:

```toml
["0.8-0.8.3"]
DependencyA = "0.4-0.5"
DependencyB = "0.3-0.5"

["0.8.2-0.8.5"]
DependencyC = "0.7-0"
```

Dependencies that are unchanged across a range of versions are grouped
together in these blocks. The interpretation of these ranges is given by the comment after each line below:

```toml
"0.7-0.8" # [0.7.0, 0.9.0)
"0.7-0" # [0.7.0, 1.0.0)
"0.8.6-0" # [0.8.6, 1.0.0)
"0.7-*" # [0.7.0, ∞)
```

So for this package, versions `[0.8.0, 0.8.3]` depend on versions `[0.4.0, 0.6.0)` of `DependencyA` and version `[0.3.0, 0.6.0)` of `DependencyB`.
Meanwhile, it is also true that versions `[0.8.2, 0.8.5]` require specific versions of `DependencyC` (so that all three are required for versions `0.8.2` and `0.8.3`).

### Registry flavors

The default Pkg Server (`pkg.julialang.org`) offers two different "flavors" of registry.
Expand Down