Skip to content

[HTTP] CC-1693: Upgrade Haskell to 9.8.4 #120

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

Merged
merged 2 commits into from
Apr 8, 2025
Merged
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
2 changes: 1 addition & 1 deletion compiled_starters/haskell/.codecrafters/compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@

set -e # Exit on failure

# This compiles the program into $(stack path --local-install-root)/bin/hs-http-server-clone-exe.
# This compiles the program into $(stack path --local-install-root)/bin/codecrafters-http-server-exe.
stack build
2 changes: 1 addition & 1 deletion compiled_starters/haskell/.codecrafters/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@

set -e # Exit on failure

exec $(stack path --local-install-root)/bin/hs-http-server-clone-exe "$@"
exec $(stack path --local-install-root)/bin/codecrafters-http-server-exe "$@"
27 changes: 25 additions & 2 deletions compiled_starters/haskell/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
.stack-work/
hs-http-server-clone.cabal
codecrafters-http-server.cabal
*~
dist
dist-*
cabal-dev
*.o
*.hi
*.hie
*.chi
*.chs.h
*.dyn_o
*.dyn_hi
.hpc
.hsenv
.cabal-sandbox/
cabal.sandbox.config
*.prof
*.aux
*.hp
*.eventlog
.stack/
.stack-work/
cabal.project.local
cabal.project.local~
.HTF/
.ghc.environment.*
2 changes: 1 addition & 1 deletion compiled_starters/haskell/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Time to move on to the next stage!

Note: This section is for stages 2 and beyond.

1. Ensure you have `stack` installed locally
1. Ensure you have `stack (23.18)` installed locally
1. Run `./your_program.sh` to run your program, which is implemented in
`app/Main.hs`.
1. Commit your changes and run `git push origin master` to submit your solution
Expand Down
4 changes: 2 additions & 2 deletions compiled_starters/haskell/codecrafters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ debug: false
# Use this to change the Haskell version used to run your code
# on Codecrafters.
#
# Available versions: haskell-9.4
language_pack: haskell-9.4
# Available versions: haskell-9.8
language_pack: haskell-9.8
7 changes: 4 additions & 3 deletions compiled_starters/haskell/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
# failures.
#
# DON'T EDIT THIS!
name: hs-http-server-clone

name: codecrafters-http-server
version: 0.1.0.0
license: BSD3

Expand All @@ -21,12 +22,12 @@ ghc-options:
- -Wredundant-constraints

dependencies:
- base >= 4.7 && < 5
- base >= 4.19 && < 5
- network # establish a simple TCP network
- bytestring # useful to send bytes over the network

executables:
hs-http-server-clone-exe:
codecrafters-http-server-exe:
main: Main.hs
source-dirs: app
ghc-options:
Expand Down
2 changes: 1 addition & 1 deletion compiled_starters/haskell/stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# failures.
#
# DON'T EDIT THIS!
resolver: lts-21.11
resolver: lts-23.18

packages:
- .
8 changes: 4 additions & 4 deletions compiled_starters/haskell/stack.yaml.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
packages: []
snapshots:
- completed:
sha256: 64d66303f927e87ffe6b8ccf736229bf608731e80d7afdf62bdd63c59f857740
size: 640037
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/21/11.yaml
original: lts-21.11
sha256: d133abe75e408a407cce3f032c96ac1bbadf474a93b5156ebf4135b53382d56b
size: 683827
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/23/18.yaml
original: lts-23.18
2 changes: 1 addition & 1 deletion compiled_starters/haskell/your_program.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ set -e # Exit early if any commands fail
#
# - Edit this to change how your program runs locally
# - Edit .codecrafters/run.sh to change how your program runs remotely
exec $(stack path --local-install-root)/bin/hs-http-server-clone-exe "$@"
exec $(stack path --local-install-root)/bin/codecrafters-http-server-exe "$@"
34 changes: 34 additions & 0 deletions dockerfiles/haskell-9.8.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
FROM haskell:9.8.4-bullseye

WORKDIR /app

RUN mkdir -p /etc/stack

# Absence of this causes `stack run` to raise a permissions error
RUN echo "allow-different-user: true" >> /etc/stack/config.yaml

# Force usage of the system GHC installation
RUN echo "install-ghc: false" >> /etc/stack/config.yaml
RUN echo "system-ghc: true" >> /etc/stack/config.yaml

COPY stack.yaml package.yaml stack.yaml.lock /app/

# Dummy static content to circumvent the /app doesn't exist warning
RUN mkdir /app/app
RUN echo 'main :: IO ()' >> /app/app/Main.hs
RUN echo 'main = putStrLn "Hello, World!"' >> /app/app/Main.hs

ENV STACK_ROOT=/app/.stack

RUN stack build
RUN stack clean codecrafters-http-server
RUN mkdir /app-cached
RUN mv .stack-work /app-cached/.stack-work
RUN mv .stack /app-cached/.stack

RUN rm -rf /app/app

RUN echo "cd \${CODECRAFTERS_REPOSITORY_DIR} && stack build" > /codecrafters-precompile.sh
RUN chmod +x /codecrafters-precompile.sh

ENV CODECRAFTERS_DEPENDENCY_FILE_PATHS="stack.yaml,package.yaml,stack.yaml.lock"
2 changes: 1 addition & 1 deletion solutions/haskell/01-at4/code/.codecrafters/compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@

set -e # Exit on failure

# This compiles the program into $(stack path --local-install-root)/bin/hs-http-server-clone-exe.
# This compiles the program into $(stack path --local-install-root)/bin/codecrafters-http-server-exe.
stack build
2 changes: 1 addition & 1 deletion solutions/haskell/01-at4/code/.codecrafters/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@

set -e # Exit on failure

exec $(stack path --local-install-root)/bin/hs-http-server-clone-exe "$@"
exec $(stack path --local-install-root)/bin/codecrafters-http-server-exe "$@"
27 changes: 25 additions & 2 deletions solutions/haskell/01-at4/code/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
.stack-work/
hs-http-server-clone.cabal
codecrafters-http-server.cabal
*~
dist
dist-*
cabal-dev
*.o
*.hi
*.hie
*.chi
*.chs.h
*.dyn_o
*.dyn_hi
.hpc
.hsenv
.cabal-sandbox/
cabal.sandbox.config
*.prof
*.aux
*.hp
*.eventlog
.stack/
.stack-work/
cabal.project.local
cabal.project.local~
.HTF/
.ghc.environment.*
2 changes: 1 addition & 1 deletion solutions/haskell/01-at4/code/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Time to move on to the next stage!

Note: This section is for stages 2 and beyond.

1. Ensure you have `stack` installed locally
1. Ensure you have `stack (23.18)` installed locally
1. Run `./your_program.sh` to run your program, which is implemented in
`app/Main.hs`.
1. Commit your changes and run `git push origin master` to submit your solution
Expand Down
4 changes: 2 additions & 2 deletions solutions/haskell/01-at4/code/codecrafters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ debug: false
# Use this to change the Haskell version used to run your code
# on Codecrafters.
#
# Available versions: haskell-9.4
language_pack: haskell-9.4
# Available versions: haskell-9.8
language_pack: haskell-9.8
7 changes: 4 additions & 3 deletions solutions/haskell/01-at4/code/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
# failures.
#
# DON'T EDIT THIS!
name: hs-http-server-clone

name: codecrafters-http-server
version: 0.1.0.0
license: BSD3

Expand All @@ -21,12 +22,12 @@ ghc-options:
- -Wredundant-constraints

dependencies:
- base >= 4.7 && < 5
- base >= 4.19 && < 5
- network # establish a simple TCP network
- bytestring # useful to send bytes over the network

executables:
hs-http-server-clone-exe:
codecrafters-http-server-exe:
main: Main.hs
source-dirs: app
ghc-options:
Expand Down
2 changes: 1 addition & 1 deletion solutions/haskell/01-at4/code/stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# failures.
#
# DON'T EDIT THIS!
resolver: lts-21.11
resolver: lts-23.18

packages:
- .
8 changes: 4 additions & 4 deletions solutions/haskell/01-at4/code/stack.yaml.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
packages: []
snapshots:
- completed:
sha256: 64d66303f927e87ffe6b8ccf736229bf608731e80d7afdf62bdd63c59f857740
size: 640037
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/21/11.yaml
original: lts-21.11
sha256: d133abe75e408a407cce3f032c96ac1bbadf474a93b5156ebf4135b53382d56b
size: 683827
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/23/18.yaml
original: lts-23.18
2 changes: 1 addition & 1 deletion solutions/haskell/01-at4/code/your_program.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ set -e # Exit early if any commands fail
#
# - Edit this to change how your program runs locally
# - Edit .codecrafters/run.sh to change how your program runs remotely
exec $(stack path --local-install-root)/bin/hs-http-server-clone-exe "$@"
exec $(stack path --local-install-root)/bin/codecrafters-http-server-exe "$@"
2 changes: 1 addition & 1 deletion starter_templates/haskell/code/.codecrafters/compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@

set -e # Exit on failure

# This compiles the program into $(stack path --local-install-root)/bin/hs-http-server-clone-exe.
# This compiles the program into $(stack path --local-install-root)/bin/codecrafters-http-server-exe.
stack build
2 changes: 1 addition & 1 deletion starter_templates/haskell/code/.codecrafters/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@

set -e # Exit on failure

exec $(stack path --local-install-root)/bin/hs-http-server-clone-exe "$@"
exec $(stack path --local-install-root)/bin/codecrafters-http-server-exe "$@"
27 changes: 25 additions & 2 deletions starter_templates/haskell/code/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
.stack-work/
hs-http-server-clone.cabal
codecrafters-http-server.cabal
*~
dist
dist-*
cabal-dev
*.o
*.hi
*.hie
*.chi
*.chs.h
*.dyn_o
*.dyn_hi
.hpc
.hsenv
.cabal-sandbox/
cabal.sandbox.config
*.prof
*.aux
*.hp
*.eventlog
.stack/
.stack-work/
cabal.project.local
cabal.project.local~
.HTF/
.ghc.environment.*
7 changes: 4 additions & 3 deletions starter_templates/haskell/code/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
# failures.
#
# DON'T EDIT THIS!
name: hs-http-server-clone

name: codecrafters-http-server
version: 0.1.0.0
license: BSD3

Expand All @@ -21,12 +22,12 @@ ghc-options:
- -Wredundant-constraints

dependencies:
- base >= 4.7 && < 5
- base >= 4.19 && < 5
- network # establish a simple TCP network
- bytestring # useful to send bytes over the network

executables:
hs-http-server-clone-exe:
codecrafters-http-server-exe:
main: Main.hs
source-dirs: app
ghc-options:
Expand Down
2 changes: 1 addition & 1 deletion starter_templates/haskell/code/stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# failures.
#
# DON'T EDIT THIS!
resolver: lts-21.11
resolver: lts-23.18

packages:
- .
8 changes: 4 additions & 4 deletions starter_templates/haskell/code/stack.yaml.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
packages: []
snapshots:
- completed:
sha256: 64d66303f927e87ffe6b8ccf736229bf608731e80d7afdf62bdd63c59f857740
size: 640037
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/21/11.yaml
original: lts-21.11
sha256: d133abe75e408a407cce3f032c96ac1bbadf474a93b5156ebf4135b53382d56b
size: 683827
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/23/18.yaml
original: lts-23.18
2 changes: 1 addition & 1 deletion starter_templates/haskell/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
attributes:
required_executable: stack
required_executable: stack (23.18)
user_editable_file: app/Main.hs
Loading