diff --git a/compiled_starters/haskell/.codecrafters/compile.sh b/compiled_starters/haskell/.codecrafters/compile.sh index 1de2e58..a77bb0b 100755 --- a/compiled_starters/haskell/.codecrafters/compile.sh +++ b/compiled_starters/haskell/.codecrafters/compile.sh @@ -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 diff --git a/compiled_starters/haskell/.codecrafters/run.sh b/compiled_starters/haskell/.codecrafters/run.sh index a278ab0..9b77791 100755 --- a/compiled_starters/haskell/.codecrafters/run.sh +++ b/compiled_starters/haskell/.codecrafters/run.sh @@ -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 "$@" \ No newline at end of file diff --git a/compiled_starters/haskell/.gitignore b/compiled_starters/haskell/.gitignore index a7226d6..ff96b56 100644 --- a/compiled_starters/haskell/.gitignore +++ b/compiled_starters/haskell/.gitignore @@ -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.* \ No newline at end of file diff --git a/compiled_starters/haskell/README.md b/compiled_starters/haskell/README.md index f6dbe77..a2cc126 100644 --- a/compiled_starters/haskell/README.md +++ b/compiled_starters/haskell/README.md @@ -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 diff --git a/compiled_starters/haskell/codecrafters.yml b/compiled_starters/haskell/codecrafters.yml index 6059433..fc797fb 100644 --- a/compiled_starters/haskell/codecrafters.yml +++ b/compiled_starters/haskell/codecrafters.yml @@ -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 diff --git a/compiled_starters/haskell/package.yaml b/compiled_starters/haskell/package.yaml index 5e18c2e..d9b8f30 100644 --- a/compiled_starters/haskell/package.yaml +++ b/compiled_starters/haskell/package.yaml @@ -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 @@ -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: diff --git a/compiled_starters/haskell/stack.yaml b/compiled_starters/haskell/stack.yaml index 5a0a4f8..93a04e9 100644 --- a/compiled_starters/haskell/stack.yaml +++ b/compiled_starters/haskell/stack.yaml @@ -5,7 +5,7 @@ # failures. # # DON'T EDIT THIS! -resolver: lts-21.11 +resolver: lts-23.18 packages: - . diff --git a/compiled_starters/haskell/stack.yaml.lock b/compiled_starters/haskell/stack.yaml.lock index 30cbd43..2b897fa 100644 --- a/compiled_starters/haskell/stack.yaml.lock +++ b/compiled_starters/haskell/stack.yaml.lock @@ -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 diff --git a/compiled_starters/haskell/your_program.sh b/compiled_starters/haskell/your_program.sh index ff00e2d..aa0e57e 100755 --- a/compiled_starters/haskell/your_program.sh +++ b/compiled_starters/haskell/your_program.sh @@ -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 "$@" diff --git a/dockerfiles/haskell-9.8.Dockerfile b/dockerfiles/haskell-9.8.Dockerfile new file mode 100644 index 0000000..9d56ab7 --- /dev/null +++ b/dockerfiles/haskell-9.8.Dockerfile @@ -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" diff --git a/solutions/haskell/01-at4/code/.codecrafters/compile.sh b/solutions/haskell/01-at4/code/.codecrafters/compile.sh index 1de2e58..a77bb0b 100755 --- a/solutions/haskell/01-at4/code/.codecrafters/compile.sh +++ b/solutions/haskell/01-at4/code/.codecrafters/compile.sh @@ -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 diff --git a/solutions/haskell/01-at4/code/.codecrafters/run.sh b/solutions/haskell/01-at4/code/.codecrafters/run.sh index a278ab0..9b77791 100755 --- a/solutions/haskell/01-at4/code/.codecrafters/run.sh +++ b/solutions/haskell/01-at4/code/.codecrafters/run.sh @@ -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 "$@" \ No newline at end of file diff --git a/solutions/haskell/01-at4/code/.gitignore b/solutions/haskell/01-at4/code/.gitignore index a7226d6..ff96b56 100644 --- a/solutions/haskell/01-at4/code/.gitignore +++ b/solutions/haskell/01-at4/code/.gitignore @@ -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.* \ No newline at end of file diff --git a/solutions/haskell/01-at4/code/README.md b/solutions/haskell/01-at4/code/README.md index f6dbe77..a2cc126 100644 --- a/solutions/haskell/01-at4/code/README.md +++ b/solutions/haskell/01-at4/code/README.md @@ -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 diff --git a/solutions/haskell/01-at4/code/codecrafters.yml b/solutions/haskell/01-at4/code/codecrafters.yml index 6059433..fc797fb 100644 --- a/solutions/haskell/01-at4/code/codecrafters.yml +++ b/solutions/haskell/01-at4/code/codecrafters.yml @@ -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 diff --git a/solutions/haskell/01-at4/code/package.yaml b/solutions/haskell/01-at4/code/package.yaml index 5e18c2e..d9b8f30 100644 --- a/solutions/haskell/01-at4/code/package.yaml +++ b/solutions/haskell/01-at4/code/package.yaml @@ -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 @@ -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: diff --git a/solutions/haskell/01-at4/code/stack.yaml b/solutions/haskell/01-at4/code/stack.yaml index 5a0a4f8..93a04e9 100644 --- a/solutions/haskell/01-at4/code/stack.yaml +++ b/solutions/haskell/01-at4/code/stack.yaml @@ -5,7 +5,7 @@ # failures. # # DON'T EDIT THIS! -resolver: lts-21.11 +resolver: lts-23.18 packages: - . diff --git a/solutions/haskell/01-at4/code/stack.yaml.lock b/solutions/haskell/01-at4/code/stack.yaml.lock index 30cbd43..2b897fa 100644 --- a/solutions/haskell/01-at4/code/stack.yaml.lock +++ b/solutions/haskell/01-at4/code/stack.yaml.lock @@ -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 diff --git a/solutions/haskell/01-at4/code/your_program.sh b/solutions/haskell/01-at4/code/your_program.sh index ff00e2d..aa0e57e 100755 --- a/solutions/haskell/01-at4/code/your_program.sh +++ b/solutions/haskell/01-at4/code/your_program.sh @@ -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 "$@" diff --git a/starter_templates/haskell/code/.codecrafters/compile.sh b/starter_templates/haskell/code/.codecrafters/compile.sh index 1de2e58..a77bb0b 100755 --- a/starter_templates/haskell/code/.codecrafters/compile.sh +++ b/starter_templates/haskell/code/.codecrafters/compile.sh @@ -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 diff --git a/starter_templates/haskell/code/.codecrafters/run.sh b/starter_templates/haskell/code/.codecrafters/run.sh index a278ab0..9b77791 100755 --- a/starter_templates/haskell/code/.codecrafters/run.sh +++ b/starter_templates/haskell/code/.codecrafters/run.sh @@ -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 "$@" \ No newline at end of file diff --git a/starter_templates/haskell/code/.gitignore b/starter_templates/haskell/code/.gitignore index a7226d6..ff96b56 100644 --- a/starter_templates/haskell/code/.gitignore +++ b/starter_templates/haskell/code/.gitignore @@ -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.* \ No newline at end of file diff --git a/starter_templates/haskell/code/package.yaml b/starter_templates/haskell/code/package.yaml index 5e18c2e..d9b8f30 100644 --- a/starter_templates/haskell/code/package.yaml +++ b/starter_templates/haskell/code/package.yaml @@ -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 @@ -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: diff --git a/starter_templates/haskell/code/stack.yaml b/starter_templates/haskell/code/stack.yaml index 5a0a4f8..93a04e9 100644 --- a/starter_templates/haskell/code/stack.yaml +++ b/starter_templates/haskell/code/stack.yaml @@ -5,7 +5,7 @@ # failures. # # DON'T EDIT THIS! -resolver: lts-21.11 +resolver: lts-23.18 packages: - . diff --git a/starter_templates/haskell/code/stack.yaml.lock b/starter_templates/haskell/code/stack.yaml.lock index 30cbd43..2b897fa 100644 --- a/starter_templates/haskell/code/stack.yaml.lock +++ b/starter_templates/haskell/code/stack.yaml.lock @@ -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 diff --git a/starter_templates/haskell/config.yml b/starter_templates/haskell/config.yml index b95abeb..3f2a66d 100644 --- a/starter_templates/haskell/config.yml +++ b/starter_templates/haskell/config.yml @@ -1,3 +1,3 @@ attributes: - required_executable: stack + required_executable: stack (23.18) user_editable_file: app/Main.hs