Skip to content

Commit

Permalink
validate-catalog: Don't check dev dependencies
Browse files Browse the repository at this point in the history
See comment in diffs for details.

Fixes #40
  • Loading branch information
cgay committed Feb 21, 2024
1 parent e2fcc4a commit 469be53
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
7 changes: 6 additions & 1 deletion sources/pacman/catalog.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,12 @@ define function validate-catalog
end;
for (package in packages)
for (release in package.package-releases)
resolve-release-deps(cat, release, dev?: #t, cache: cache);
// We pass `dev?: #f` here because it is valid for a package to have a
// dependency on itself if it is an active package _during
// development_. Since a workspace can have multiple active packages we
// can't pass the correct set of `actives` to ignore here.
// https://github.com/dylan-lang/pacman-catalog/issues/40
resolve-release-deps(cat, release, dev?: #f, cache: cache);
end;
end;
end function;
Expand Down
25 changes: 12 additions & 13 deletions sources/pacman/deps.dylan
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,12 @@ define function resolve-release-deps
resolve-deps(cat, deps, dev-deps, actives, cache: cache)
end function;

// Resolve `release` to a set of releases it depends on, using `cat` as the world of
// potential releases. `release` itself is not included in the result. `active` maps
// package names to releases that are "active" in the current workspace and therefore
// should be treated specially. If any package encountered during resolution has a
// dependency on one of the active packages, that dependency is ignored since the active
// package will be used during the build process anyway. The returned deps do not include
// the active releases.
// Resolve a set of dependencies to a set of specific releases, using `cat` as the world
// of potential releases. `actives` maps package names to releases that are active in the
// current workspace and therefore should be treated specially. If any package
// encountered during resolution has a dependency on one of the active packages, that
// dependency is ignored since the active package will be used during the build process
// anyway. The returned deps do not include the active releases.
//
// Signal <dep-error> if dependencies can't be resolved due to circularities,
// conflicting constraints, or if they are simply missing from the catalog.
Expand All @@ -113,13 +112,13 @@ end function;
// "providing repeatable builds by preferring the lowest possible specified version of
// any package".
//
// We are given a release that needs to be built. This is the root of a graph. Its deps
// form the second layer of a graph. The releases that match those deps form the third
// level of the graph, and the deps of those releases form the fourth, etc. So we have a
// graph in which the layers alternate between potential releases and their deps. This
// tree gets big fast. The result for any given release is memoized.
// We are given the deps of a release that needs to be built. That release is the root of
// a graph. Its deps form the second layer of a graph. The releases that match those deps
// form the third level of the graph, and the deps of those releases form the fourth,
// etc. So we have a graph in which the layers alternate between potential releases and
// their deps. This tree gets big fast. The result for any given release is memoized.
//
// Each dep specifies only its minimum required version, e.g., P 1.2.3. These are
// Each dep specifies only its minimum required version, e.g., P@1.2.3. These are
// semantic versions so if two dependencies on P specify different major versions it is
// an error.
//
Expand Down

0 comments on commit 469be53

Please sign in to comment.