Skip to content

chore: [sc-129896] Upgrade Smurf to GHC 9.2 #14

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

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
- arm64
ghc:
- 9.0.2
- 9.2.4
- 9.2.5
- 9.4.2
runs-on: ubuntu-latest
steps:
Expand All @@ -34,7 +34,7 @@ jobs:
matrix:
ghc:
- 9.0.2
- 9.2.4
- 9.2.5
- 9.4.2
runs-on: ubuntu-latest
steps:
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ RUN \
ARG HLS_VERSION=1.8.0.0
RUN \
set -o errexit -o xtrace; \
if test -n "$HLS_VERSION"; then \
ghcup install hls "$HLS_VERSION" --set; \
if test -n "$HLS_VERSION" && "$GHC_VERSION" == "9.2.5"; then \
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can come back and make a conditional here to install 1.8 for 9.0.2 if we really want, but I'd prefer to get things working end to end in smurf first.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here is what I'd like:

  • If configured to do so, install HLS from source.
  • Otherwise attempt to install HLS via GHCup.
  • Or do nothing.

I feel like the easiest way to support that would be to have two environment variables: HLS_GIT_REF and HLS_VERSION. If HLS_GIT_REF is set, HLS will be compiled from source using ghcup compile hls -g $HLS_GIT_REF. Otherwise, if HLS_VERSION is set, HLS will be installed using ghcup install hls $HLS_VERSION. If neither are set, HLS is not installed.

Or perhaps we could try to be fancy by keeping the single HLS_VERSION variable and checking to see if it looks like a commit. If it does, compile; otherwise install.

if echo "$HLS_VERSION" | grep --extended-regexp --quiet '^[0-9a-f]{40}$'
then echo compile
else echo install
fi

For example:

$ if echo '1.8.0.0' | egrep -q '^[0-9a-f]{40}$'; then echo compile; else echo install; fi
install
$ if echo '5d56aa70a84807d7659e72eacd4d91fee08dbdbb' | egrep -q '^[0-9a-f]{40}$'; then echo compile; else echo install; fi
compile

That way we can use HLS_VERSION=1.8.0.0 for GHC_VERSION=9.0.2 (as we currently do), but also support HLS_VERSION=5d56aa70a84807d7659e72eacd4d91fee08dbdbb for GHC_VERSION=9.2.5 and GHC_VERSION=9.4.3.

What do you think?

ghcup compile hls -g 5d56aa70a84807d7659e72eacd4d91fee08dbdbb --git-describe-version --ghc $GHC_VERSION --cabal-update --set; \
ghcup gc --hls-no-ghc; \
haskell-language-server-wrapper --version; \
fi
Expand Down
2 changes: 1 addition & 1 deletion aws/image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ env:
DOCKER_USERNAME: docker-hub-read-only:DOCKER_USERNAME
variables:
AWS_REGION: us-east-1
GHC_VERSION: 9.2.4
GHC_VERSION: 9.2.5
phases:
build:
commands:
Expand Down
2 changes: 1 addition & 1 deletion aws/manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 0.2
env:
variables:
AWS_REGION: us-east-1
GHC_VERSION: 9.2.4
GHC_VERSION: 9.2.5
phases:
build:
commands:
Expand Down