radian-software / straight.el

🍀 Next-generation, purely functional package manager for the Emacs hacker.
MIT License
2.71k stars 150 forks source link

straight.el as a dep manager for a build tool #342

Open Fuco1 opened 5 years ago

Fuco1 commented 5 years ago

I've been a long time Cask user and I quite like its simplicity when it comes to setting load paths, running binaries (tests, linters...).

However there is many issues with how it works with dependencies. Since Cask tries to support package.el, git cloning and other things it only works "sort of"... in many cases dependencies are broken or not resolved at all, recompilations are broken...

straight.el with its git-first approach seems to pretty much solve all the issues: pinning, resolving to hashes, fetching different branches or tags...

It reminded me very much of the situation in Haskell land where we have stack and cabal and I got thinking maybe we could build a build tool around straight.

For a start what I would want is to have something like:

  1. Have some manifest file for version pinning. straight already seems to have this.
  2. Have ability to download and install the packages in a way that is project-independent so that there is no shadowing. I believe straight can already do this since it operates on git hashes and this is therefore referentially transparent. Ideally they would go to the project directory so they can be independently edited.
  3. <tool> exec <shell command> - this would run the shell command with the EMACSLOADPATH and PATH set so that all the packages and executables are properly resolved.
  4. Have simple command-line interface for use in CI stacks/local development, so things like:
    • <tool> install
    • <tool> update
    • some introspection commands such as <tool> loadpath to produce the load path, <tool> path to produce the path, <tool> files to get the package files and so on.

I would still keep straight.el as pure dep management tool since it's doing that well and not mix it to also be a build tool (maybe a mistake Cask made early on).

wedens commented 5 years ago

What you describe sounds pretty much like nix. example of pretty complex emacs configuration using nix. typical configuration will be much simpler.

Fuco1 commented 5 years ago

@wedens Yea, that's another good example. I never really got into nix but I am a huge fanboy.

raxod502 commented 5 years ago

I think this is a good idea; see also #100.