replit / upm

⠕ Universal Package Manager - Python, Node.js, Ruby, Emacs Lisp.
https://repl.it
Other
1.06k stars 91 forks source link

Add support for Haskell (Stack) #49

Open ode opened 4 years ago

ode commented 4 years ago

I'm working on haskell(stack) support on my repo.

Stack works differently than most other package management tools. Instead of giving a version to each dependency, Stack uses curated sets to packages that work well together as "resolvers". packages not on stack can be specified with versions.

Stack therefore uses a minimum of two files: one for configuration and version specification of non-stackage packages and one for listing all dependencies. Additionally, one file for storing sha256 sums of the packages to ensure safe builds. a reference

I've listed the first file (stack.yaml) as lockfile and second (project.cabal) as the specfile. While they are close, they do not fit into the traditional idea of lockfiles and specfiles. Therefore, ListSpecFile will return package names only without version and ListLockFile will return some packages names along with version. What side-effects will this have?

Also, I need to know how repl.it's package manager UI uses the upm add command: with or without the version specification provided by PkgInfo.

blast-hardcheese commented 10 months ago

Hey! Pardon the delay in response, I'm trying to work through the languishing issues here.

What I'm gathering is that there may need to be the concept of specfile and lockfile groups, at the very least an array of possible lockfile and specfile locations, since from a cursory glance at the documentation there's a stack.yaml at the project root, and then a *.cabal for each package defined inside a project.

This doesn't sound too onerous, other than the --upgrade argument to a number of commands just deletes whatever lockfile you have specified, which seems like it could cause some problems. Can the cabal files be regenerated from the stack.yaml in all cases?