haskell / ghcup-hs

https://www.haskell.org/ghcup/
GNU Lesser General Public License v3.0
266 stars 79 forks source link

`ghcup provision` (or `ghcup setup-env`) etc. #989

Open hasufell opened 5 months ago

hasufell commented 5 months ago

To discuss: instead of running ghcup install ghc 9.2.8 && ghcup install ghc 9.4.8 && ... one could imagine a way to declaratively specify the whole toolchain setting and let ghcup execute that description as a whole, e.g.

GHC: [9.2.8, 9.4.8*, 9.6.3]
Stack: [latest*]
Cabal: [latest*]
HLS: [recommended*]

or some-such. There's some design-space to explore (e.g. where to read the data/file from), whether to support some form of .ghcup file in PWD, etc.

runeksvendsen commented 5 months ago

As discussed privately with @hasufell: note that whatever DSL the above example is parsed into would also be useful for https://github.com/haskell/ghcup-hs/issues/64. In the integration test, we could imagine a test case that installs the above tools/versions and asserts something about the resulting environment, and in that context it would be useful to have a DSL for expressing a set of tools to install/set.

runeksvendsen commented 4 months ago

One could also imagine a new command ghcup shell which drops the user into a shell in which the tools specified by .ghcup are available (ie. instead of installing them globally).