-
Notifications
You must be signed in to change notification settings - Fork 0
Compile HLS from source #16
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
Compile HLS from source #16
Conversation
I misunderstood this flag, here's the docs for the related `-c` that helped me understand it: > Automatically enable compacting collection when the live data exceeds ⟨n⟩% of the maximum heap size (see the -M ⟨size⟩ option). Note that the maximum heap size is unlimited by default, so this option has no effect unless the maximum heap size is set with -M ⟨size⟩. https://downloads.haskell.org/~ghc/9.2.5/docs/html/users_guide/runtime_control.html?highlight=compacting#rts-flag--c%20%E2%9F%A8n%E2%9F%A9
see if this at 1 caused an immediate OOM somehow or if I have syntax wrong but it threw an "exit code 9" still anyway
idk how to use it apparently and things passed without it
since I got a no parse error maybe only -j lets you use $NUMCPU
Weirdly everything except GHC 9.4.3 succeeded. |
Aha! I was interpreting
Indeed, I'm not sure how to convince the build to use 1.6.1 instead of 1.6.0. I figured that it would use the latest allow version anyway. |
It's trying to use an older version of ghc-exactprint because HLS pins the index state: https://github.com/haskell/haskell-language-server/blob/385dd1b57af75ccd286e104b7e00f2b0cb626588/cabal.project#L53 |
This branch produces an image that is about twice as big as the one from the
It's possible that this could be reduced, but we may run into problems like we did before: #8 (comment) |
This doesn't work if you mount a volume at
$ docker run \
--interactive \
--rm \
--tty \
--volume $PWD/cabal-store:/cabal-store \
public.ecr.aws/acilearning/haskell:9.2.5-f9048e692cd00062f033f56346da4c9b0ae3371e \
sh -c 'ldd /home/haskell/.ghcup/bin/haskell-language-server-9.2.5 | grep "not found" | wc -l'
226 |
I just tested with a simple project and everything seems to work! The latest image ( |
I can think of two solutions for this:
The second options I'm slightly suspicious of, but think it would be fine. I'm not sure if you consider 2 an option @tfausak, thoughts? As for 1, I'm not sure if it's possible. I'll ask in haskell/haskell-language-server#3345 (comment). |
I don't believe that 2 is an option since the cabal store is supposed to be a singular thing. conclusion: HLS with template Haskell is only compatible with "fat" docker images and not "thin" docker images which mount an external volume for the cabal store |
It was recommended to create our own custom bindist like hls does but for our docker container. I've never created a bindist, but here are relevant links on how hls does that: https://github.com/haskell/haskell-language-server/blob/master/GNUmakefile |
I'm not necessarily opposed to making our own bindist, but it seems like potentially a lot of work. |
Yeah, I don't really want to do it because it seems like a lot of work and kind of complex to maintain. However the only alternatives I see to resolve this situation are:
We've discussed 2 a few times and it's not a popular suggestion. I lean towards 1 maybe mostly because of familiarity, but I remember you mentioning how 1 was a pain to maintain and that you like thin images more. |
It would be especially hard to support fat images given that we provide images for multiple versions of GHC. Another option is to install HLS with a separate Cabal store directory. That's probably worse than making a custom bindist, but it's also easier. I think it would be something like We could also stick with versions of GHC that HLS has official support for. Currently that would be 9.2.4 and 9.4.2. (It's not clear to me why HLS doesn't release more frequently. haskell/haskell-language-server#3355) |
I can't remember if 9.2.4 actually worked or had the same problems. I'll go back to 9.2.4 and see if things work. |
So I'm assuming the bindists we get from ghcup will work within our docker containers and avoid the hls issues after reading @tfausak's comment: #16 (comment)
So I'm assuming the bindists we get from ghcup will work within our docker containers and avoid the hls issues after reading @tfausak's comment: #16 (comment)
An alternative to #14 that actually works, unlike #15. Fixes #12. Also fixes #13.