Skip to content

Instantly share code, notes, and snippets.

@rwcitek
Last active December 5, 2022 03:45
Show Gist options
  • Save rwcitek/e89b872e2613d23997f756b4e8325af3 to your computer and use it in GitHub Desktop.
Save rwcitek/e89b872e2613d23997f756b4e8325af3 to your computer and use it in GitHub Desktop.
# This should be turned into a multi-stage Dockerfile
docker container stop build_haskell ; docker container rm build_haskell ; sleep 1
docker container run -d --name build_haskell ubuntu:20.04 sleep inf
<<'eof' docker container exec -i -w /tmp/ build_haskell /bin/bash
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y vim tree jq file wget gcc g++ make xz-utils curl
eof
docker container commit build_haskell build_haskell:pt1
docker container stop build_haskell ; docker container rm build_haskell ; sleep 1
docker container run -d --name build_haskell build_haskell:pt1 sleep inf
<<'eof' docker container exec -i -w /tmp/ build_haskell /bin/bash
# install a recent binary
cd /tmp/
curl -O https://downloads.haskell.org/~ghc/9.0.2/ghc-9.0.2-x86_64-ubuntu20.04-linux.tar.xz
tar -xf ghc-9.0.2-x86_64-ubuntu20.04-linux.tar.xz
cd ghc-9.0.2
./configure
make install
ghc --version
eof
docker container commit build_haskell build_haskell:pt2
# Trying 9.4.3
docker container stop build_haskell ; docker container rm build_haskell ; sleep 1
docker container run -d --name build_haskell build_haskell:pt2 sleep inf
<< 'eof' docker container exec -i build_haskell /bin/bash
# compile new version from source
cd /tmp/
curl -O https://downloads.haskell.org/~ghc/latest/ghc-9.4.3-src.tar.xz
tar -xf ghc-9.4.3-src.tar.xz
cd ghc-9.4.3
./configure
make
eof
false && {
# Hmm. Still doesn't work. Got this error:
...
Linking utils/ghc-cabal/dist/build/tmp/ghc-cabal ...
ghc/ghc.mk:110: ghc/stage1/package-data.mk: No such file or directory
make[1]: *** [utils/ghc-cabal/ghc.mk:50: utils/ghc-cabal/dist/build/tmp/ghc-cabal] Killed
make: *** [Makefile:124: all] Error 2
}
# Trying 9.4.2
docker container stop build_haskell ; docker container rm build_haskell ; sleep 1
docker container run -d --name build_haskell build_haskell:pt2 sleep inf
<< 'eof' docker container exec -i build_haskell /bin/bash
# compile new version from source
cd /tmp/
curl -O https://downloads.haskell.org/~ghc/9.4.2/ghc-9.4.2-src.tar.xz
tar -xf ghc-9.4.2-src.tar.xz
cd ghc-9.4.2/
./configure
make
eof
false && {
# Hmm. Still doesn't work. Got this error:
...
Linking utils/ghc-cabal/dist/build/tmp/ghc-cabal ...
ghc/ghc.mk:110: ghc/stage1/package-data.mk: No such file or directory
make[1]: *** [utils/ghc-cabal/ghc.mk:50: utils/ghc-cabal/dist/build/tmp/ghc-cabal] Killed
make: *** [Makefile:124: all] Error 2
}
# Trying 9.4.1
docker container stop build_haskell ; docker container rm build_haskell ; sleep 1
docker container run -d --name build_haskell build_haskell:pt2 sleep inf
<< 'eof' docker container exec -i build_haskell /bin/bash
# compile new version from source
cd /tmp/
curl -O https://downloads.haskell.org/~ghc/9.4.1/ghc-9.4.1-src.tar.xz
tar -xf ghc-9.4.1-src.tar.xz
cd ghc-9.4.1
./configure
make
eof
false && {
# Hmm. Still doesn't work. Got this error:
...
Linking utils/ghc-cabal/dist/build/tmp/ghc-cabal ...
ghc/ghc.mk:110: ghc/stage1/package-data.mk: No such file or directory
make[1]: *** [utils/ghc-cabal/ghc.mk:50: utils/ghc-cabal/dist/build/tmp/ghc-cabal] Killed
make: *** [Makefile:124: all] Error 2
}
# Sorry, Haskell. You've used up your time slice. On to other things.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment