haskell-ide-engine icon indicating copy to clipboard operation
haskell-ide-engine copied to clipboard

Consider supplying a hie vscode devcontainer

Open alanz opened this issue 4 years ago • 6 comments

See https://code.visualstudio.com/remote-tutorials/containers/how-it-works

"The remote container extension uses the files in the .devcontainer folder, namely devcontainer.json and an optional Dockerfile or docker-compose.yml, to create your dev containers.

First your image is built from the supplied Docker file or image name. Then a container is created and started using some of the settings in the devcontainer.json. Finally your Visual Studio Code environment is installed and configured again according to settings in the devcontainer.json.

Once all of this is done, your local copy of Visual Studio Code connects to the Visual Studio Code Server running inside of your new dev container."

This can potentially help out with the install/getting started scenario

alanz avatar Nov 14 '19 10:11 alanz

Is this the same as #1429 ?

alanz avatar Nov 19 '19 21:11 alanz

Not at all, as this issue is a VSCode-specific feature and #1429 is an alternative installation procedure.

nponeccop avatar Nov 21 '19 15:11 nponeccop

Greetings! I recently learned about devcontainers, and I've attempted my own. To my huge surprise - it works really well! It now takes about 4 minutes to go from 0 to a working IDE! I've put it here: https://github.com/hmemcpy/haskell-hie-devcontainer

For this, however, I needed to build a docker image containing HIE and GHC 8.6.5. It took a while to build, so I decided to pre-build one and publish it on the hub: https://hub.docker.com/r/hmemcpy/hie

It significantly decreases the initial build time. If interested, I would be happy to contribute this to the official HIE repositories!

hmemcpy avatar Jan 29 '20 16:01 hmemcpy

I also just learned that Microsoft could list it on their repo, and it will be available inside VSCode gallery automatically! Nothing to manually install (well, other than Docker). This could be a game-changer :)

image

hmemcpy avatar Jan 29 '20 16:01 hmemcpy

I'm new to the topic and might be missing something. But apparently HIE is catered for stack and cabal project configurations i.e. to be be a true game changer vscode-hie docker image must include preinstalled cabal and stack?

However they are not included and it's not easy to fix since image is based on linux distribution that is not supported by Haskell stack as of today: https://github.com/hmemcpy/haskell-hie-devcontainer/issues/3

Is world still waiting for a vscode HIE docker image that would have everything preinstalled?

P.S. There's a pull request to work around it but it is in limbo:
I'll give it a try.... https://github.com/hmemcpy/haskell-hie-devcontainer/pull/4 UPD : didn't work trying other forks... none worked (I'm running Windows 10)

DunetsNM avatar Apr 28 '20 23:04 DunetsNM

Finally found a recent image (3 months old as of now) in the hub that has it all prebuilt including stack and just worked with VSCode (at least at first glance):

https://hub.docker.com/r/luvemil/haskell-ide-engine (update: it's actually a fork of https://hub.docker.com/r/ciantic/haskell-ide-engine/dockerfile which also adds a user "jack", but I played with it as root) home page https://www.github.com/luvemil/haskell-ide-engine

  • It is rather big but builds quickly (subject to download time) and has everything work comfortably with GHC 8.6.5.
  • for new project with latest resolver (lts-15.10) stack also pulled and bootstrapped GHC 8.8.3 with no issues
  • ~~at least one feature is not fully functional e.g. suggestion to add dependency doesn't edit package.yaml. However I saw it working in other env so it could be related to older revision of haskell-ide-engine included in the image. Looks solid otherwise~~ update: it does work, I just incorrectly put .devcontainer one level up from my project directory

Hope it will help someone.

DunetsNM avatar Apr 29 '20 04:04 DunetsNM