Skip to content

Commit b4354e3

Browse files
authored
Merge pull request #120 from codecrafters-io/andy/upgrade
[HTTP] CC-1693: Upgrade Haskell to 9.8.4
2 parents 35becd6 + df7f28a commit b4354e3

26 files changed

+151
-45
lines changed

compiled_starters/haskell/.codecrafters/compile.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88

99
set -e # Exit on failure
1010

11-
# This compiles the program into $(stack path --local-install-root)/bin/hs-http-server-clone-exe.
11+
# This compiles the program into $(stack path --local-install-root)/bin/codecrafters-http-server-exe.
1212
stack build

compiled_starters/haskell/.codecrafters/run.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88

99
set -e # Exit on failure
1010

11-
exec $(stack path --local-install-root)/bin/hs-http-server-clone-exe "$@"
11+
exec $(stack path --local-install-root)/bin/codecrafters-http-server-exe "$@"

compiled_starters/haskell/.gitignore

+25-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
1-
.stack-work/
2-
hs-http-server-clone.cabal
1+
codecrafters-http-server.cabal
32
*~
3+
dist
4+
dist-*
5+
cabal-dev
6+
*.o
7+
*.hi
8+
*.hie
9+
*.chi
10+
*.chs.h
11+
*.dyn_o
12+
*.dyn_hi
13+
.hpc
14+
.hsenv
15+
.cabal-sandbox/
16+
cabal.sandbox.config
17+
*.prof
18+
*.aux
19+
*.hp
20+
*.eventlog
21+
.stack/
22+
.stack-work/
23+
cabal.project.local
24+
cabal.project.local~
25+
.HTF/
26+
.ghc.environment.*

compiled_starters/haskell/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Time to move on to the next stage!
3030

3131
Note: This section is for stages 2 and beyond.
3232

33-
1. Ensure you have `stack` installed locally
33+
1. Ensure you have `stack (23.18)` installed locally
3434
1. Run `./your_program.sh` to run your program, which is implemented in
3535
`app/Main.hs`.
3636
1. Commit your changes and run `git push origin master` to submit your solution

compiled_starters/haskell/codecrafters.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ debug: false
77
# Use this to change the Haskell version used to run your code
88
# on Codecrafters.
99
#
10-
# Available versions: haskell-9.4
11-
language_pack: haskell-9.4
10+
# Available versions: haskell-9.8
11+
language_pack: haskell-9.8

compiled_starters/haskell/package.yaml

+4-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
# failures.
66
#
77
# DON'T EDIT THIS!
8-
name: hs-http-server-clone
8+
9+
name: codecrafters-http-server
910
version: 0.1.0.0
1011
license: BSD3
1112

@@ -21,12 +22,12 @@ ghc-options:
2122
- -Wredundant-constraints
2223

2324
dependencies:
24-
- base >= 4.7 && < 5
25+
- base >= 4.19 && < 5
2526
- network # establish a simple TCP network
2627
- bytestring # useful to send bytes over the network
2728

2829
executables:
29-
hs-http-server-clone-exe:
30+
codecrafters-http-server-exe:
3031
main: Main.hs
3132
source-dirs: app
3233
ghc-options:

compiled_starters/haskell/stack.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# failures.
66
#
77
# DON'T EDIT THIS!
8-
resolver: lts-21.11
8+
resolver: lts-23.18
99

1010
packages:
1111
- .

compiled_starters/haskell/stack.yaml.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
packages: []
77
snapshots:
88
- completed:
9-
sha256: 64d66303f927e87ffe6b8ccf736229bf608731e80d7afdf62bdd63c59f857740
10-
size: 640037
11-
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/21/11.yaml
12-
original: lts-21.11
9+
sha256: d133abe75e408a407cce3f032c96ac1bbadf474a93b5156ebf4135b53382d56b
10+
size: 683827
11+
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/23/18.yaml
12+
original: lts-23.18

compiled_starters/haskell/your_program.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ set -e # Exit early if any commands fail
2121
#
2222
# - Edit this to change how your program runs locally
2323
# - Edit .codecrafters/run.sh to change how your program runs remotely
24-
exec $(stack path --local-install-root)/bin/hs-http-server-clone-exe "$@"
24+
exec $(stack path --local-install-root)/bin/codecrafters-http-server-exe "$@"

dockerfiles/haskell-9.8.Dockerfile

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
FROM haskell:9.8.4-bullseye
2+
3+
WORKDIR /app
4+
5+
RUN mkdir -p /etc/stack
6+
7+
# Absence of this causes `stack run` to raise a permissions error
8+
RUN echo "allow-different-user: true" >> /etc/stack/config.yaml
9+
10+
# Force usage of the system GHC installation
11+
RUN echo "install-ghc: false" >> /etc/stack/config.yaml
12+
RUN echo "system-ghc: true" >> /etc/stack/config.yaml
13+
14+
COPY stack.yaml package.yaml stack.yaml.lock /app/
15+
16+
# Dummy static content to circumvent the /app doesn't exist warning
17+
RUN mkdir /app/app
18+
RUN echo 'main :: IO ()' >> /app/app/Main.hs
19+
RUN echo 'main = putStrLn "Hello, World!"' >> /app/app/Main.hs
20+
21+
ENV STACK_ROOT=/app/.stack
22+
23+
RUN stack build
24+
RUN stack clean codecrafters-http-server
25+
RUN mkdir /app-cached
26+
RUN mv .stack-work /app-cached/.stack-work
27+
RUN mv .stack /app-cached/.stack
28+
29+
RUN rm -rf /app/app
30+
31+
RUN echo "cd \${CODECRAFTERS_REPOSITORY_DIR} && stack build" > /codecrafters-precompile.sh
32+
RUN chmod +x /codecrafters-precompile.sh
33+
34+
ENV CODECRAFTERS_DEPENDENCY_FILE_PATHS="stack.yaml,package.yaml,stack.yaml.lock"

solutions/haskell/01-at4/code/.codecrafters/compile.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88

99
set -e # Exit on failure
1010

11-
# This compiles the program into $(stack path --local-install-root)/bin/hs-http-server-clone-exe.
11+
# This compiles the program into $(stack path --local-install-root)/bin/codecrafters-http-server-exe.
1212
stack build

solutions/haskell/01-at4/code/.codecrafters/run.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88

99
set -e # Exit on failure
1010

11-
exec $(stack path --local-install-root)/bin/hs-http-server-clone-exe "$@"
11+
exec $(stack path --local-install-root)/bin/codecrafters-http-server-exe "$@"
+25-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
1-
.stack-work/
2-
hs-http-server-clone.cabal
1+
codecrafters-http-server.cabal
32
*~
3+
dist
4+
dist-*
5+
cabal-dev
6+
*.o
7+
*.hi
8+
*.hie
9+
*.chi
10+
*.chs.h
11+
*.dyn_o
12+
*.dyn_hi
13+
.hpc
14+
.hsenv
15+
.cabal-sandbox/
16+
cabal.sandbox.config
17+
*.prof
18+
*.aux
19+
*.hp
20+
*.eventlog
21+
.stack/
22+
.stack-work/
23+
cabal.project.local
24+
cabal.project.local~
25+
.HTF/
26+
.ghc.environment.*

solutions/haskell/01-at4/code/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Time to move on to the next stage!
3030

3131
Note: This section is for stages 2 and beyond.
3232

33-
1. Ensure you have `stack` installed locally
33+
1. Ensure you have `stack (23.18)` installed locally
3434
1. Run `./your_program.sh` to run your program, which is implemented in
3535
`app/Main.hs`.
3636
1. Commit your changes and run `git push origin master` to submit your solution

solutions/haskell/01-at4/code/codecrafters.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ debug: false
77
# Use this to change the Haskell version used to run your code
88
# on Codecrafters.
99
#
10-
# Available versions: haskell-9.4
11-
language_pack: haskell-9.4
10+
# Available versions: haskell-9.8
11+
language_pack: haskell-9.8

solutions/haskell/01-at4/code/package.yaml

+4-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
# failures.
66
#
77
# DON'T EDIT THIS!
8-
name: hs-http-server-clone
8+
9+
name: codecrafters-http-server
910
version: 0.1.0.0
1011
license: BSD3
1112

@@ -21,12 +22,12 @@ ghc-options:
2122
- -Wredundant-constraints
2223

2324
dependencies:
24-
- base >= 4.7 && < 5
25+
- base >= 4.19 && < 5
2526
- network # establish a simple TCP network
2627
- bytestring # useful to send bytes over the network
2728

2829
executables:
29-
hs-http-server-clone-exe:
30+
codecrafters-http-server-exe:
3031
main: Main.hs
3132
source-dirs: app
3233
ghc-options:

solutions/haskell/01-at4/code/stack.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# failures.
66
#
77
# DON'T EDIT THIS!
8-
resolver: lts-21.11
8+
resolver: lts-23.18
99

1010
packages:
1111
- .

solutions/haskell/01-at4/code/stack.yaml.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
packages: []
77
snapshots:
88
- completed:
9-
sha256: 64d66303f927e87ffe6b8ccf736229bf608731e80d7afdf62bdd63c59f857740
10-
size: 640037
11-
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/21/11.yaml
12-
original: lts-21.11
9+
sha256: d133abe75e408a407cce3f032c96ac1bbadf474a93b5156ebf4135b53382d56b
10+
size: 683827
11+
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/23/18.yaml
12+
original: lts-23.18

solutions/haskell/01-at4/code/your_program.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ set -e # Exit early if any commands fail
2121
#
2222
# - Edit this to change how your program runs locally
2323
# - Edit .codecrafters/run.sh to change how your program runs remotely
24-
exec $(stack path --local-install-root)/bin/hs-http-server-clone-exe "$@"
24+
exec $(stack path --local-install-root)/bin/codecrafters-http-server-exe "$@"

starter_templates/haskell/code/.codecrafters/compile.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88

99
set -e # Exit on failure
1010

11-
# This compiles the program into $(stack path --local-install-root)/bin/hs-http-server-clone-exe.
11+
# This compiles the program into $(stack path --local-install-root)/bin/codecrafters-http-server-exe.
1212
stack build

starter_templates/haskell/code/.codecrafters/run.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@
88

99
set -e # Exit on failure
1010

11-
exec $(stack path --local-install-root)/bin/hs-http-server-clone-exe "$@"
11+
exec $(stack path --local-install-root)/bin/codecrafters-http-server-exe "$@"
+25-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
1-
.stack-work/
2-
hs-http-server-clone.cabal
1+
codecrafters-http-server.cabal
32
*~
3+
dist
4+
dist-*
5+
cabal-dev
6+
*.o
7+
*.hi
8+
*.hie
9+
*.chi
10+
*.chs.h
11+
*.dyn_o
12+
*.dyn_hi
13+
.hpc
14+
.hsenv
15+
.cabal-sandbox/
16+
cabal.sandbox.config
17+
*.prof
18+
*.aux
19+
*.hp
20+
*.eventlog
21+
.stack/
22+
.stack-work/
23+
cabal.project.local
24+
cabal.project.local~
25+
.HTF/
26+
.ghc.environment.*

starter_templates/haskell/code/package.yaml

+4-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
# failures.
66
#
77
# DON'T EDIT THIS!
8-
name: hs-http-server-clone
8+
9+
name: codecrafters-http-server
910
version: 0.1.0.0
1011
license: BSD3
1112

@@ -21,12 +22,12 @@ ghc-options:
2122
- -Wredundant-constraints
2223

2324
dependencies:
24-
- base >= 4.7 && < 5
25+
- base >= 4.19 && < 5
2526
- network # establish a simple TCP network
2627
- bytestring # useful to send bytes over the network
2728

2829
executables:
29-
hs-http-server-clone-exe:
30+
codecrafters-http-server-exe:
3031
main: Main.hs
3132
source-dirs: app
3233
ghc-options:

starter_templates/haskell/code/stack.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# failures.
66
#
77
# DON'T EDIT THIS!
8-
resolver: lts-21.11
8+
resolver: lts-23.18
99

1010
packages:
1111
- .

starter_templates/haskell/code/stack.yaml.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
packages: []
77
snapshots:
88
- completed:
9-
sha256: 64d66303f927e87ffe6b8ccf736229bf608731e80d7afdf62bdd63c59f857740
10-
size: 640037
11-
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/21/11.yaml
12-
original: lts-21.11
9+
sha256: d133abe75e408a407cce3f032c96ac1bbadf474a93b5156ebf4135b53382d56b
10+
size: 683827
11+
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/23/18.yaml
12+
original: lts-23.18

starter_templates/haskell/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
attributes:
2-
required_executable: stack
2+
required_executable: stack (23.18)
33
user_editable_file: app/Main.hs

0 commit comments

Comments
 (0)