(sigil build deps)
(sigil build deps) - Dependency Resolution
This library provides dependency graph construction and resolution for building packages in the correct order.
Example usage: (define packages (workspace-load-packages ws ws-dir)) (define graph (build-dependency-graph packages)) (define order (topological-sort graph)) ;; order is a list of package names in build order
Exports
package-direct-depsprocedureExtract direct dependency names from a package Returns a list of package name strings
package-all-depsprocedureExtract all dependency names from a package (including dev-dependencies) Returns a list of package name strings
dependency-nameprocedureGet the name from a dependency (handles different dep types)
git-url-to-nameprocedureExtract package name from git URL
build-dependency-graphprocedureBuild a dependency graph from a list of packages Input: alist of (package-name . package) pairs Optional: include-dev-deps? - if #t, includes dev-dependencies Returns: alist of (package-name . (list of dep-names)) Only includes deps that are in packages-alist (filters out external deps that aren't part of this build, like internal workspace deps of redirected packages)
dedupe-external-against-workspaceprocedureDedupe external (from-git / from-path) packages against workspace members.
When a workspace member shares a name with an external dep loaded transitively (typical shape: extracted package's from-git ref to a sibling that is still resident in the consumer's workspace), the merged packages-alist ends up with two entries under the same name. That breaks topological-sort (length comparison fires a spurious "Dependency cycle detected") and causes find-package-path to resolve to the cached external copy instead of the workspace source.
Policy: workspace member always wins. If the fetched copy declares a different version, emit a warning and proceed with the workspace version.
Inputs: workspace-packages: alist of (name . package) for workspace members external-packages: alist of (name . package) for from-git/from-path deps external-paths: alist of (name . path) for the same external deps
Returns: (deduped-external-packages . deduped-external-paths)
warn-on-version-mismatchprocedureEmit a warning when a workspace package and a fetched external copy declare different versions. Silent when either side has no version field or the versions match.
get-build-orderprocedureGet build order for all packages in a workspace Optional: include-dev-deps? - if #t, includes dev-dependencies Returns list of package names in build order (dependencies first)
get-build-order-forprocedureGet build order for a specific package and its dependencies Optional: include-dev-deps? - if #t, includes dev-dependencies Returns list of package names needed to build target (in order)
topological-sortvariable(No description)
topological-sort-fromvariable(No description)
detect-cyclesvariable(No description)
has-cycle?variable(No description)