-
Notifications
You must be signed in to change notification settings - Fork 843
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Dev Container Configuration Files #6228
Add Dev Container Configuration Files #6228
Conversation
I tried to be minimally invasive, i.e.
I hope this is fine and the instructions in the additional @mpilgrem What do you think? Any objections? Or additions? |
See jgm/pandoc#9039 (comment) ff for the discussion about adding Dev Containers to the Pandoc repository. |
The Haskell extension errors in the default Dev Container configuration: cabal exec -v0 -- ghc --print-libdir
Quick fix: Set constraint |
Test online with GitHub Codespaces at https://github.com/benz0li/commercialhaskell-stack/tree/add-dev-containers Screenshot using 'Default' configuration: |
@benz0li, I understand that GitHub Codespaces is a cloud-based x86_64-based Linux-based development environment service that GitHub users can pay for, and a repository (like Stack's) can assist those Codespaces users by providing a configuration (usually located in a So, some questions:
Finally, when this is settled, it would be good to add something (some pointer to the specific |
@benz0li, I did not follow your |
Please open in Codespaces or VS Code (using https://github.com/benz0li/commercialhaskell-stack/tree/add-dev-containers) with the default Dev Container configuration; wait until all VS Code extensions are installed; open file Should one be able to build Stack with Cabal (the tool) as well?
That is not the case. See #6212 (comment) ff. |
These Dev Container configuration can also be run locally/'remotely (SSH)' with VS Code using Docker/Podman on both Dev Containers end "it works on my computer"-debates quickly because there is a Dev Container config to reproduce the issue. |
No. The MIT license is just my preferred OSS licence. I could also use the BSD 3-Clause with
These Dev Containers are based on the same docker images that 'are used'/'are going to be used' to build the statically linked Linux amd64 and arm64 binary releases of stack. Debatable is the fact, that an unofficial build of GHC is used in these images. This was already discussed in #6142.
Agreed. |
– Stack and Visual Studio Code - The Haskell Tool Stack: Haskell Language Server > Tips This is exactly what [at least newer versions of] HLS try to do in the background – and fail with this repository. I have successfully built stack (using stack); HLS still fails with the same error message. |
@benz0li, on building Stack (
EDIT: The following also fine locally:
|
Well, well, well...
Fixed for default config HLS still does not work, though:
|
This is maybe a known problem - see #6224 which mentions a work-around. I have not yet got to the bottom of #6224. |
Is there a way to tell HLS to ignore this module? With a 'cradle' - an hie.yaml file - in the project's root directory? @mpilgrem Thank you for all the feedback. Highly appreciated. |
Until further notice, the Haskell Language Server and the VS Code Haskell extension is not installed (= disabled) for all Dev Container configurations. Due to #6154. With the 'Default' configuration, Haskell now builds using both Stack and Cabal. |
@benz0li, on a cradle for HLS, I've not commited one to the repository because I think it forces a choice of either Stack or Cabal (the tool). That seemed to me to be inappropriate to impose, even for Stack's own repository. |
Downgraded |
@benz0li, for your information, I have added some information about how to use HLS with the Stack project here: https://docs.haskellstack.org/en/latest/CONTRIBUTING/#haskell-language-server. |
Haskell extension + HLS work fine with the proposed cradle for Stack. I have updated the instructions accordingly: I tried the following cradle for Cabal: cradle:
cabal:
- path: "./src"
component: "lib:stack"
- path: "./app"
component: "stack:exe:stack"
- path: "./tests/integration"
component: "stack:exe:stack-integration-test"
- path: "./tests/unit"
component: "stack:test:stack-unit-test" But this still leads to the error described in #6228 (comment). |
@benz0li, regarding:
Somehow, after an initial |
@mpilgrem No worries. I will try a few more things. If I do not find a solution, I might ask over at https://github.com/haskell/haskell-language-server. |
@benz0li, I got HLS to work with the Stack project on Windows with Cabal, but it was 'ugly'. This is what I did:
|
Added hlint and yamllint to the Dev Containers and re-enabled the VS Code Haskell extension in the default config. After merging the latest changes from branch master, the HLS works fine in the default Dev Container. |
- A 'Full Rebuild Container' resets the home directory on Codespaces
- Pip may be used to install MkDocs
I think the current Then, I suggest See [haskellstack.org > Stack's code (advanced) > Maintainers > Dev Containers](https://doc.haskellstack.org)
or [../doc/maintainers/devcontainers.md](../doc/maintainers/devcontainers.md) for
more information. @mpilgrem Can you make a suggestion how and where in |
@benz0li, regarding:
My suggestion on 'where' is to give it its own section near the end, after the section on 'Haskell Language Server'. My suggestion on 'how', is about 'assumed knowledge' of the reader: imagine you are writing to help somebody who is about to start a course on computer science at university. Hyperlinks to where they can read more to understand the context may assist. |
@mpilgrem Please review. Thank you. EDIT: Any (other) tool I have missed? |
- Add info about PATH and precedence of executables
- Enable Oh My Zsh plugins screen tmux vscode
@benz0li, thanks! I'll merge. It maybe that when I see how the |
No updates to ChangeLog.md and documentation required.