https://github.com/torahappy/ghcjs-devenv
A docker image to develop GHC/GHCJS 9 projects.
https://github.com/torahappy/ghcjs-devenv
cabal docker docker-compose ghc ghcjs ghcup haskell neovim stack
Last synced: about 2 months ago
JSON representation
A docker image to develop GHC/GHCJS 9 projects.
- Host: GitHub
- URL: https://github.com/torahappy/ghcjs-devenv
- Owner: torahappy
- Created: 2024-11-27T04:46:39.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-11-27T09:37:06.000Z (over 1 year ago)
- Last Synced: 2025-08-30T08:13:35.968Z (9 months ago)
- Topics: cabal, docker, docker-compose, ghc, ghcjs, ghcup, haskell, neovim, stack
- Language: Lua
- Homepage: https://hub.docker.com/repository/docker/taw3/ghcjs-devenv/general
- Size: 14.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# GHCJS development environment
This docker image is a boilerplate for GHCJS develop environment. It has GHCUp with normal GHC and experimental GHCJS 9.x, necessary libraries and GIR files for `jsaddle-webkit2gtk`, X11 forwarding preset (for testing webkit2gtk), and neovim with coc-nvim (with haskell-language-server support).
## How to setup
Before setup, you need a workspace folder (different from this repository) and put `examples/docker-compose.yml` onto it. Then, run following commands:
1. `mkdir .stack-cache`
1. `mkdir .cabal-cache`
1. `mkdir -p .stack-cache/hooks/`
1. `curl https://raw.githubusercontent.com/haskell/ghcup-hs/master/scripts/hooks/stack/ghc-install.sh > .stack-cache/hooks/ghc-install.sh`
1. `chmod +x .stack-cache/hooks/ghc-install.sh`
1. `echo "system-ghc: false" >> .stack-cache/config.yaml`
1. `docker-compose up`
Connect to the container via `docker exec -it rdwp-myservice-1 /root/uid-remap.bash bash` or `ssh haskell@localhost -p2222` (password: haskell)
Edit project files via `nvim` or VSCode Docker Container with haskell plugin.
## How to build a project
Just run `stack build` (for GHC binary) or `cabal build` (for GHCJS binary) within your project.
For cabal with GHCJS, replacement of compiler and other tools is required. To do so, append
```
with-compiler: javascript-unknown-ghcjs-ghc-9.10.0.20240413
with-hc-pkg: javascript-unknown-ghcjs-ghc-pkg-9.10.0.20240413
```
to the `cabal.project` file and run
```
cabal build --with-hsc2hs=javascript-unknown-ghcjs-hsc2hs-9.10.0.20240413
```
whenever you build.