From 469be53ea9ca15079d82693ffcb64b9eef77c4ec Mon Sep 17 00:00:00 2001 From: Carl Gay Date: Wed, 21 Feb 2024 17:28:51 -0500 Subject: [PATCH] validate-catalog: Don't check dev dependencies See comment in diffs for details. Fixes #40 --- sources/pacman/catalog.dylan | 7 ++++++- sources/pacman/deps.dylan | 25 ++++++++++++------------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/sources/pacman/catalog.dylan b/sources/pacman/catalog.dylan index b477689..49c44b7 100644 --- a/sources/pacman/catalog.dylan +++ b/sources/pacman/catalog.dylan @@ -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; diff --git a/sources/pacman/deps.dylan b/sources/pacman/deps.dylan index bbd3930..f7a2f22 100644 --- a/sources/pacman/deps.dylan +++ b/sources/pacman/deps.dylan @@ -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 if dependencies can't be resolved due to circularities, // conflicting constraints, or if they are simply missing from the catalog. @@ -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. //