-
Notifications
You must be signed in to change notification settings - Fork 1.4k
haskell - change devcontainer to use GHCup #1478
Conversation
I'd love to get a review from the people involved in #685 @jneira @stuartpike @eitsupi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you need to make some modifications to be consistent with other definitions.
(Note that I am not a haskell user and can only advise on general Dockerfile writing)
@eitsupi thanks for the feedback! Changes:
Can you take another look? |
Totally agree with the approach, ghcup is the way to go nowadays. F.e. hls is using ghccup as its primary channel of distribution. |
There is discussion over at Haskell about how the community may get confused over ghcup stack and cable haskell-infra/www.haskell.org#191 I believe we need to understand who the remote docker container audience is before moving away from a general image maintained by Haskell. Is the direction to focus on general Haskell learning or a production ready build environment? |
@stuartpike |
I for one would like to develop Haskell apps on an iPad on GitHub Codespaces. The approach in this PR looks pretty good, since it installs both Cabal and Stack into the container. Using GHCup is sort of an implementation detail here, especially for Stack users, as they don’t need to care about GHCup at all. Stack will just do its thing. |
When you use the container via a terminal type 'ghci' and you get the 'Prelude' command, that is how I started this open source container to get a minimal installation which can be enhance as needed. As I've said previously, need to know the target audience to enhance this container. There will be many scenarios and possible solutions. |
Since this is the Because of the change to the Haskell extension, the current status quo no longer works for this goal. Having a Dockerfile here that does not work ends up misleading people, so I think we should fix this. I'm not sure how to proceed to get a decision so we can move forward with this or some other solution. (edit: removed duplicated sentence) |
@stuartpike there's no controversy about installation method in the Haskell community anymore. Cabal vs stack is an orthogonal topic. GHCup allows to install either of them. |
So the container has ghci and cabal installed and for use of stack just enter in the terminal 'stack ghci' What type of development are you wanting to do with this?
|
There is no difference in use case for stack and cabal. |
The README in this repo says:
I read "starting point" and I think of something that helps beginners as much as possible out-of-the-box, assuming expert users can figure out what environment they want and customize their Dockerfile however they want. The Dockerfile is copied to each git repo, and the Docker image is built from scratch every time a user creates a Codespace anyway, so the cost for a user to change they env is minimal. I could change the template to add |
Dear all, I’m using and contributing to Haskell for about 11 years. Lately I’ve been helping Cabal maintenance. I came here from a Cabal issue where the author was complaining about the defunct Haskell devcontainer. The approach of this PR is a perfectly sane one from today's Haskell development perspective, and, most importantly, it fixes the currently defunct container. I, as a part of the Cabal team, join the representatives of the other critical Haskell infrastructure projects — @jneira, an HLS (the Haskell Language Server) developer, and @hasufell, the primary GHCUp developer, — in asking you, respected devcontainers maintainers, to get this PR merged. Please, let me know, what else people with Haskell expertise can provide you with. The question about “scenarios this can be used in” doesn’t look productive and only invites the obvious answer: any. Any moderately complicated pure Haskell project can be covered by the current approach. The only kind of exception I can think of is huge projects like GHC (the Haskell compiler itself) that are not purely Haskell and are not built with Cabal or Stack. But that’s an expected omission (and I’m not really sure that it is indeed an exception: maybe you can make it work). Please, let’s be constructive and try to narrow down the questions to something actionable. Otherwise, we’ll have this PR linger on for many more months than it should be. Really, it should have been merged back in May, so that maintainers of projects like Cabal, HLS, GHCUp don’t get persistent reports about defunct containers. |
Okay so over to Microsoft to merge as I don’t have the power to merge into Microsoft’s branch. |
Thanks for opening! As a heads up, our team has been actively focused on an updated plan for community contributions and this repo moving forward, which we've now outlined in this issue: #1589. This includes moving to a couple new repos for images (https://github.com/devcontainers/images) and Features (https://github.com/devcontainers/features). We anticipate to have a similar repo and distribution process for templates/definitions. We'll keep everyone updated (likely via another issue in this repo or comment on #1589) when our new templates repo is available and the process is defined. Please let me know if you have any questions, thank you! |
Hi @bamurtaugh thanks for the info! |
No problem! And yes, we'd hold off on merging this PR as this repo will eventually be archived, except for security patches. |
Right. I will close this PR then. |
Thanks @gusbicalho! @Chuxel what do you think about removing? It seems reasonable based on the above info:
But we'll also be discussing what to do with contributions in this repo that don't end up as part of the new repos, so perhaps we hold off until we can share a more definite plan. |
Alright, I will wait a little before closing this PR then. |
@bamurtaugh I think we could tactically merge given it is broken as-is and the new process has not yet been disclosed. @gusbicalho Thie new approach will be like Features which will allow anyone to contribute at any time - templates will end up in an OCI Artifact repository like GHCR. This has taken longer than we expected, so thanks for the patience. You could also consider contributing a Feature for Haskel near term that can then be added to any image. Info on creating, publishing and contributing a Feature can be found in the public template https://github.com/devcontainers/feature-template |
(Some previous discussion at haskell/docker-haskell#76)
Problem
The existing devcontainer for haskell is based on the
haskell
images from https://github.com/haskell/docker-haskell. These images provide specific GHC/cabal versions, which is a good thing for reproducibility. However, those images do not include a binary for thehaskell-language-server
. The existing devcontainer relies on the Haskell extension automatically downloadinghaskell-language-server
.This no longer works. Since version 2.0.1 (released in 2022-04-27), the Haskell extension for VSCode depends on GHCup for downloading HLS. Therefore, any user who tries to use this devcontainer ends up getting error messages about missing GHCup or missing HLS.
Solution
Instead of starting from the
haskell
image, the devcontainer can start from a minimal Debian image, download and install GHCup and use that to manage GHC, HLS, Cabal and Stack.The list of packages installed in the beginning of the Dockerfile was copied from one of the
haskell
Dockerfiles.Q: Why not start from one of the
haskell
images? A: Because then we'd have extra GHC and cabal installations in the system, which are not managed by GHCup. This could be confusing for users trying to understand and modify the image; it also uses up space for no good reason.Q: Do we really need to install GHC, cabal and stack while building the container? A: Not really. If we only install GHCup, the Haskell extension will prompt the user to install recommended versions of those tools. However, this prompt will only happen when the user first opens a haskell source file, and then they will have to wait until the installation is complete. To me it seems better to have a container that takes longer to build, but once built the user can quickly start working.