Go dependency management tool experiment (deprecated)
Перейти к файлу
Sam Boyer 36739eacd5 Add data cache to projectManager (no persist yet) 2016-03-31 12:38:08 -04:00
vendor/github.com/Masterminds/semver Set up travis 2016-03-17 12:53:32 -04:00
.travis.yml Set up travis 2016-03-17 12:53:32 -04:00
LICENSE Initial commit 2016-03-14 23:33:42 -04:00
README.md Note the alignment 2016-03-31 12:17:35 -04:00
bestiary_test.go Track versions in VersionQueue, not ProjectAtoms 2016-03-31 01:25:23 -04:00
constraints.go Rename Constraint methods to 'Admits' 2016-03-30 13:52:27 -04:00
errors.go New, better naming scheme 2016-03-31 01:10:09 -04:00
flags.go Remove detritus, unexport some things 2016-03-17 12:45:36 -04:00
glide.lock Set up glide 2016-03-17 11:17:47 -04:00
glide.yaml Set up glide 2016-03-17 11:17:47 -04:00
project_manager.go Add data cache to projectManager (no persist yet) 2016-03-31 12:38:08 -04:00
result.go New, better naming scheme 2016-03-31 01:10:09 -04:00
selection.go New, better naming scheme 2016-03-31 01:10:09 -04:00
solve_test.go New, better naming scheme 2016-03-31 01:10:09 -04:00
solver.go Track versions in VersionQueue, not ProjectAtoms 2016-03-31 01:25:23 -04:00
source_manager.go Add data cache to projectManager (no persist yet) 2016-03-31 12:38:08 -04:00
types.go New, better naming scheme 2016-03-31 01:10:09 -04:00
version.go Add data cache to projectManager (no persist yet) 2016-03-31 12:38:08 -04:00
version_queue.go Add data cache to projectManager (no persist yet) 2016-03-31 12:38:08 -04:00

README.md

vsolver

vsolver is a specialized SAT solver, designed as an engine for Go package management. The initial plan is integration into glide, but vsolver could be used by any tool interested in fully solving the package management problem.

NOTE - vsolver is super-extra-much not functional yet :)

The current implementation is based heavily on the solver used in Dart's pub package management tool. Significant changes are planned to suit Go's particular constraints; in pursuit of those, we also may refactor to adapt from a more fully general SAT-solving approach.

Assumptions

Package management is far too complex to be assumption-less. vsolver tries to keep its assumptions to the minimum, supporting as many situations as is possible while still maintaining a predictable, well-formed system.

  • Go 1.6, or 1.5 with GO15VENDOREXPERIMENT = 1. While the solver mostly doesn't touch vendor directories themselves, it's basically insane to try to solve this problem without them.
  • A manifest-and-lock approach to tracking project manifest data. The solver takes manifest (and, optionally, lock)-type information as inputs, and produces lock-type information as its output. (An implementing tool gets to decide whether these are represented as one or two files).
  • A project concept, where projects comprise the set of Go packages in a rooted tree on the filesystem. (Generally, the root should be where the manifest/lock are, but that's up to the tool.) Happily, thats the same set of packages that a vendor/ directory covers.
  • You don't manually change what's under vendor/ - leave it up to the vsolver-driven tool.

Yes, we also think it'd be swell if we didn't need metadata files. We love the idea of Go packages as standalone, self-describing code. Unfortunately, though, that idea goes off the rails as soon as versioning and cross-project/repository dependencies happen, because universe alignment is hard.

Some folks are against using a solver in Go - even just the concept. Their reasons for it often include things like "(Tool X) uses a solver and I don't like that tools UX!" or "It seems complicated, and idiomatic Go things are simple!" But thats just shooting the messenger. Dependency resolution is a well-understood, NP-complete problem. Its that problem thats the enemy, not solvers. And especially not this one! Its a friendly solver - one that aims for transparency in the choices it makes, and the resolution failures it encounters.

Features

Yes, most people will probably find most of this list incomprehensible right now. We'll improve/add explanatory links as we go!

  • Actually working/passing tests
  • Dependency constraints based on SemVer, branches, and revisions. AKA, "all the ways you might depend on Go code now, but coherently organized."
  • Bi-modal analysis (project-level and package-level)
  • Specific sub-package dependencies
  • Enforcing an acyclic project graph (mirroring the Go compiler's enforcement of an acyclic package import graph)
  • On-the-fly static analysis (e.g. for incompatibility assessment, type escaping)
  • Optional package duplication as a conflict resolution mechanism
  • Faaaast, enabled by aggressive caching of project metadata
  • Lock information parameterized by build tags (including, but not limited to, GOOS/GOARCH)
  • Non-repository root and nested manifest/lock pairs

Note that these goals are not fixed - we may drop some as we continue working. Some are also probably out of scope for the solver itself, but still related to the solver's operation.