Coder Social home page Coder Social logo

ghc-musl's Introduction

ghc-musl

This repository provides Docker images with GHC compiled with musl; therefore can be used to create fully static Haskell binaries without glibc dependency on any platform which can run Docker (x86_64). Powered by ghcup.

Images come with ghc and cabal executables alongside with commonly used libraries and build tools. They can also be used with the stack build tool using its Docker integration.

Here are the latest images currently published in Docker Hub:

  • utdemir/ghc-musl:v25-ghc944
  • utdemir/ghc-musl:v25-ghc925
  • utdemir/ghc-musl:v25-ghc902
  • utdemir/ghc-musl:v25-ghc8107
  • utdemir/ghc-musl:v25-ghc884

Usage

cabal-install

Mount the project directory to the container, and use cabal-install with --enable-executable-static flag inside the container:

$ cd myproject/
$ docker run -itv $PWD:/mnt utdemir/ghc-musl:v25-ghc944
sh$ cd /mnt
sh$ cabal new-update
sh$ cabal new-build --enable-executable-static

You can also set executable-static option on your cabal.project file.

stack

Use below arguments, or set the relevant options on your stack.yaml:

stack build \
  --ghc-options ' -static -optl-static -optl-pthread -fPIC' \
  --docker --docker-image "utdemir/ghc-musl:v25-ghc944" \
  --no-nix

Make sure to pick an image with the GHC version compatible with the Stackage resolver you are using.

Follow commercialhaskell/stack#3420 for more details on static compilation using the Stack build tool.

Example session with GHC

Below shell session shows how to start a pre-compiled docker container and compile a simple Hello.hs as a static executable:

$ docker run -itv $PWD:/mnt utdemir/ghc-musl:v25-ghc944
bash-4.4# cd /mnt/
bash-4.4# cat Hello.hs
main = putStrLn "Hello"
bash-4.4# ghc --make -optl-static -optl-pthread Hello.hs
[1 of 1] Compiling Main             ( Hello.hs, Hello.o )
Linking Hello ...
bash-4.4# ls -al Hello
-rwxr-xr-x 1 root root 1185056 Aug 11 16:55 Hello
bash-4.4# file Hello
Hello: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, with debug_info, not stripped
bash-4.4# ldd ./Hello
ldd: ./Hello: Not a valid dynamic program

The result can be executed on different Linux systems:

$ docker run -itv $PWD:/mnt alpine
# /mnt/Hello
Hello
$ docker run -itv $PWD:/mnt centos
[root@94eb29dcdfe6 /]# /mnt/Hello
Hello

Development

Feel free to open an issue or send a PR to add a library or support a newer compiler version.

The build process is orchestrated using Earthly. Once it is installed (or obtained via "nix-shell -p earthly"), you can use below command to build and test all images:

earthly --allow-privileged +all

Note: --allow-privileged is only necessary because we use Docker-in-Docker project to test if the generated images work with stack's Docker support. You can use the following command to disable Stack tests so that --allow-privileged is not necessary:

earthly --build-arg TEST_STACK=0 +all

The following command updates README.md:

earthly --artifact +readme/README.md

Related

ghc-musl's People

Contributors

aycanirican avatar bardurarantsson avatar benz0li avatar traviscardwell avatar utdemir avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ghc-musl's Issues

add bz2 & openssl

  • bzip2 (via bzlib-conduit, which is a dependency of zip)
  • openssl 1.1.1 (via HsOpenSSL, which is a dependency of http-client-openssl). This one is not that important, as one can use http-client-tls in most cases.

I think this should be it for my use case, but feel free to not include something if you consider it to be bloaty.

The `--ghc-options` for `stack build` were not recognized correctly.

As shown in the README, if i include the ghc-options in stack.yaml, i can add It seems to work correctly. It's great, thank you!

stack.yaml

# ....

executables:
  example-exe:
    main:                Main.hs
    source-dirs:         app
    ghc-options:
    - -threaded
    - -rtsopts
    - -with-rtsopts=-N
    - -static -optl-static -optl-pthread -fPIC # <- HERE!!
    dependencies:
    - exemple

# ....

build command

$ stack build

But I don't write it in stack.yaml, but rather stack build If I write GHC-OPTIONS as an argument to the command, it won't work correctly.

stack.yaml

# ....

executables:
  example-exe:
    main:                Main.hs
    source-dirs:         app
    ghc-options:
    - -threaded
    - -rtsopts
    - -with-rtsopts=-N
   #                                <-DELETE!!!!!
    dependencies:
    - exemple

# ....

build command

$ stack build --ghc-options="-optl-static -optl-pthread -fPIC"

error

......

/nix/store/xsnq7bhmdhmq096g66z0j50hvj9k2yjx-binutils-2.31.1/bin/ld: /nix/store/j7bg5wq89p3my7shxswkb99sy9hfz11m-ghc-8.8.3/lib/ghc-8.8.3/ghc-prim-0.5.3/libHSghc-prim-0.5.3.a(popcnt.o): relocation R_X86_64_32S against `.rodata.popcount_tab' can not be used when making a shared object; recompile with -fPIC
/nix/store/xsnq7bhmdhmq096g66z0j50hvj9k2yjx-binutils-2.31.1/bin/ld: /nix/store/9qq6y9fm4xj9arxy6izkfs8rkd4xhwyp-gcc-9.3.0/lib/gcc/x86_64-unknown-linux-musl/9.3.0/crtend.o: relocation R_X86_64_32 against `.ctors' can not be used when making a shared object; recompile with -fPIC
/nix/store/xsnq7bhmdhmq096g66z0j50hvj9k2yjx-binutils-2.31.1/bin/ld: final link failed: nonrepresentable section on output
collect2: error: ld returned 1 exit status
`cc' failed in phase `Linker'. (Exit code: 1)

--  While building package example-0.1.0.0 using:
      /Users/shin/.stack/setup-exe-cache/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/Cabal-simple_mPHDZzAJ_3.0.1.0_ghc-8.8.3 --builddir=.stack-work/dist/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/Cabal-3.0.1.0 build lib:example exe:exampler-exe --ghc-options " -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1
make: *** [build] Error 1

I suspect that ghcoptions is not passed correctly.

My workflow would be great if I could pass in arguments, but is this error a specification?

Affected by binutils bug 23856

Attempting to compile my program with musl. Attaching relevant --verbose output.

GHC: 9.2.7 (newest LTS)
Stack: 2.7.5

Using the provided command:

stack build \
  --ghc-options ' -static -optl-static -optl-pthread -fPIC' \
  --docker --docker-image "utdemir/ghc-musl:v25-ghc925" \
  --no-nix --verbose
2023-04-30 06:45:56.375059: [debug] checking for -ld.lld... no
2023-04-30 06:45:56.375201: [debug] checking for ld.lld... no
2023-04-30 06:45:56.375374: [debug] checking for -ld.gold... no
2023-04-30 06:45:56.375602: [debug] checking for ld.gold... ld.gold
2023-04-30 06:45:56.404717: [debug] checking whether C compiler supports -fuse ld=gold... yes
2023-04-30 06:45:56.571227: [error] Segmentation fault (core dumped)
2023-04-30 06:45:56.571390: [error] configure: error: The ld.gold linker is affected by binutils bug 23856; please specify a non-broken linker by passing LD=/path/to/ld to ./configure
2023-04-30 06:45:56.571505: [debug] checking whether ld.gold exhibits weak relocation bug (binutils 23856)... affected
2023-04-30 06:45:56.585845: [error] Received ExitFailure 1 when running
Raw command: /home/bob/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-9.2.7.temp/ghc-9.2.7/configure --prefix=/home/bob/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-9.2.7/
Run from: /home/bob/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-9.2.7.temp/ghc-9.2.7/

The bug in question refers to "New: Executables linked with gold against musl segfault".

Support GHC-8.8.3

Thanks for writing this package!

I see that the latest uploaded Docker container supports GHC version is 8.8.1. It would be lovely to support 8.8.3 ๐Ÿ™‚

build postgrest failed with error message setup: The program 'pg_config' is required but it could not be found

I tried to build a fully static linked postgrest binary with this docker image and met following error when
building the postgresql-libpq pacakge:

Failed to build postgresql-libpq-0.9.4.3. The failure occurred during the
configure step.
Build log (
/root/.cabal/logs/ghc-8.8.4/postgresql-libpq-0.9.4.3-7432e0030ca564c2b2e715ebcca1b97ed2ae6fb6b9074429e2384c2bc3647c3b.log
):
[1 of 1] Compiling Main             ( /mnt/dist-newstyle/tmp/src-23/postgresql-libpq-0.9.4.3/dist/setup/setup.hs, /mnt/dist-newstyle/tmp/src-23/postgresql-libpq-0.9.4.3/dist/setup/Main.o )
Linking /mnt/dist-newstyle/tmp/src-23/postgresql-libpq-0.9.4.3/dist/setup/setup ...
Configuring postgresql-libpq-0.9.4.3...
setup: The program 'pg_config' is required but it could not be found.

cabal: Failed to build postgresql-libpq-0.9.4.3 (which is required by
exe:postgrest from postgrest-7.0.1). See the build log above for details.

Error encountered while installing GHC

I'm on Ubuntu 22.04, with stack installed through curl -sSL https://get.haskellstack.org/ | sh and recently upgraded.

When I add

docker:
  enable: true
  image: utdemir/ghc-musl:v25-ghc944

to my project's stack.yaml, stack build fails with

$ stack build
musl libc (x86_64)
Version 1.2.3
Dynamic Program Loader
Usage: /lib/ld-musl-x86_64.so.1 [options] [--] pathname
Preparing to install GHC
(tinfo6-libc6-pre232) to an isolated
location. This will not interfere with
any system-level installation.
Already downloaded ghc-tinfo6-libc6-pre232-8.2.2.
utils/ghc-cabal/dist-install/build/tmp/ghc-cabal-bindist: exec: line 3: utils/ghc-cabal/dist-install/build/tmp/ghc-cabal: not found
make[1]: *** [ghc.mk:991: install_packages] Error 127
make: *** [Makefile:51: install] Error 2
Installing GHC ...

Error: [S-7441]
       Received ExitFailure 2 when running
       Raw command: /usr/bin/make install
       Run from: /home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2.temp/ghc-8.2.2/

       Error encountered while
         installing GHC with
         make install
         run in
         /home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2.temp/ghc-8.2.2/
Details

Version 2.11.1, Git revision c1167a6abc3f4978ccded5ba0246a57387da0e2f x86_64 hpack-0.35.2
2023-06-11 15:58:31.473010: [debug] Checking for project config at: /home/user/myproject/stack.yaml
2023-06-11 15:58:31.473225: [debug] Loading project config file stack.yaml
2023-06-11 15:58:31.478440: [debug] (SQL) SELECT COUNT(*) FROM "last_performed" WHERE ("action"=?) AND ("timestamp">=?); [PersistInt64 1,PersistUTCTime 2023-06-10 13:58:31.47840366 UTC]
2023-06-11 15:58:31.479059: [debug] Run process: /usr/bin/docker --version
2023-06-11 15:58:31.497138: [debug] Process finished in 18ms: /usr/bin/docker --version
2023-06-11 15:58:31.497409: [debug] Run process: /usr/bin/docker inspect utdemir/ghc-musl:v25-ghc944
2023-06-11 15:58:31.516042: [debug] Process finished in 19ms: /usr/bin/docker inspect utdemir/ghc-musl:v25-ghc944
2023-06-11 15:58:31.516478: [debug] (SQL) SELECT "id","image_hash","exe_path","exe_timestamp","compatible" FROM "docker_image_exe_cache" WHERE "image_hash"=? AND "exe_path"=? AND "exe_timestamp"=?; [PersistText "sha256:1b836718892c62ffdd1a21852fb3a20e1cd297bb1f05505d845fbe1d928c4a89",PersistText "/usr/local/bin/stack",PersistUTCTime 2023-06-11 13:51:44.348851623 UTC]
2023-06-11 15:58:31.516855: [debug] Run process within /home/user/myproject/: /usr/bin/docker create -e STACK_IN_CONTAINER=1 -e STACK_ROOT=/home/user/.stack -e STACK_PLATFORM_VARIANT=dk85569e7f830e7dc606115fd702e078fb -e HOME=/home/user/myproject/.stack-work/docker/_home -e PATH=/opt/host/bin:/home/user/myproject/.stack-work/docker/_home/.local/bin:/usr/local/.ghcup/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin -e PWD=/home/user/myproject -v /home/user:/home/user -v /home/user/.stack:/home/user/.stack -v /home/user/myproject:/home/user/myproject -v /home/user/myproject/.stack-work/docker/_home:/home/user/myproject/.stack-work/docker/_home -w /home/user/myproject --net=host -e USER=user -v /usr/local/bin/stack:/opt/host/bin/stack -i utdemir/ghc-musl:v25-ghc944 /opt/host/bin/stack --internal-re-exec-version=2.11.1 --internal-docker-entrypoint "DockerEntrypoint {deUser = Just (DockerUser {duUid = 1000, duGid = 1000, duGroups = [4,24,27,29,30,46,121,132,133,134,1000], duUmask = 2})}" run --verbose
2023-06-11 15:58:31.583668: [debug] Process finished in 67ms: /usr/bin/docker create -e STACK_IN_CONTAINER=1 -e STACK_ROOT=/home/user/.stack -e STACK_PLATFORM_VARIANT=dk85569e7f830e7dc606115fd702e078fb -e HOME=/home/user/myproject/.stack-work/docker/_home -e PATH=/opt/host/bin:/home/user/myproject/.stack-work/docker/_home/.local/bin:/usr/local/.ghcup/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin -e PWD=/home/user/myproject -v /home/user:/home/user -v /home/user/.stack:/home/user/.stack -v /home/user/myproject:/home/user/myproject -v /home/user/myproject/.stack-work/docker/_home:/home/user/myproject/.stack-work/docker/_home -w /home/user/myproject --net=host -e USER=user -v /usr/local/bin/stack:/opt/host/bin/stack -i utdemir/ghc-musl:v25-ghc944 /opt/host/bin/stack --internal-re-exec-version=2.11.1 --internal-docker-entrypoint "DockerEntrypoint {deUser = Just (DockerUser {duUid = 1000, duGid = 1000, duGroups = [4,24,27,29,30,46,121,132,133,134,1000], duUmask = 2})}" run --verbose
2023-06-11 15:58:31.583913: [debug] Run process: /usr/bin/docker start -a -i 9276dbb6f33fcbe398db29b32e57047e513f047c42da0a07c43a9b284f294e92
Version 2.11.1, Git revision c1167a6abc3f4978ccded5ba0246a57387da0e2f x86_64 hpack-0.35.2
2023-06-11 13:58:31.785288: [debug] Checking for project config at: /home/user/myproject/stack.yaml
2023-06-11 13:58:31.785501: [debug] Loading project config file stack.yaml
2023-06-11 13:58:31.790905: [debug] Run process: /usr/sbin/groupadd -o --gid 1000 stack
2023-06-11 13:58:31.809104: [debug] Process finished in 18ms: /usr/sbin/groupadd -o --gid 1000 stack
2023-06-11 13:58:31.809464: [debug] Run process: /usr/sbin/useradd -oN --uid 1000 --gid 1000 --home /home/user/myproject/.stack-work/docker/_home stack
2023-06-11 13:58:31.848427: [debug] Process finished in 39ms: /usr/sbin/useradd -oN --uid 1000 --gid 1000 --home /home/user/myproject/.stack-work/docker/_home stack
2023-06-11 13:58:31.848594: [debug] Run process: /usr/sbin/groupadd -o --gid 4 group4
2023-06-11 13:58:31.864066: [debug] Process finished in 15ms: /usr/sbin/groupadd -o --gid 4 group4
2023-06-11 13:58:31.864223: [debug] Run process: /usr/sbin/groupadd -o --gid 24 group24
2023-06-11 13:58:31.880440: [debug] Process finished in 16ms: /usr/sbin/groupadd -o --gid 24 group24
2023-06-11 13:58:31.880755: [debug] Run process: /usr/sbin/groupadd -o --gid 27 group27
2023-06-11 13:58:31.897807: [debug] Process finished in 17ms: /usr/sbin/groupadd -o --gid 27 group27
2023-06-11 13:58:31.897987: [debug] Run process: /usr/sbin/groupadd -o --gid 29 group29
2023-06-11 13:58:31.913553: [debug] Process finished in 15ms: /usr/sbin/groupadd -o --gid 29 group29
2023-06-11 13:58:31.913715: [debug] Run process: /usr/sbin/groupadd -o --gid 30 group30
2023-06-11 13:58:31.929078: [debug] Process finished in 15ms: /usr/sbin/groupadd -o --gid 30 group30
2023-06-11 13:58:31.929315: [debug] Run process: /usr/sbin/groupadd -o --gid 46 group46
2023-06-11 13:58:31.944984: [debug] Process finished in 16ms: /usr/sbin/groupadd -o --gid 46 group46
2023-06-11 13:58:31.945155: [debug] Run process: /usr/sbin/groupadd -o --gid 121 group121
2023-06-11 13:58:31.961830: [debug] Process finished in 16ms: /usr/sbin/groupadd -o --gid 121 group121
2023-06-11 13:58:31.961999: [debug] Run process: /usr/sbin/groupadd -o --gid 132 group132
2023-06-11 13:58:31.989475: [debug] Process finished in 27ms: /usr/sbin/groupadd -o --gid 132 group132
2023-06-11 13:58:31.989650: [debug] Run process: /usr/sbin/groupadd -o --gid 133 group133
2023-06-11 13:58:32.008496: [debug] Process finished in 19ms: /usr/sbin/groupadd -o --gid 133 group133
2023-06-11 13:58:32.008683: [debug] Run process: /usr/sbin/groupadd -o --gid 134 group134
2023-06-11 13:58:32.024218: [debug] Process finished in 15ms: /usr/sbin/groupadd -o --gid 134 group134
2023-06-11 13:58:32.024390: [debug] Run process: /usr/sbin/groupadd -o --gid 1000 group1000
2023-06-11 13:58:32.039414: [debug] Process finished in 15ms: /usr/sbin/groupadd -o --gid 1000 group1000
2023-06-11 13:58:32.041750: [debug] (SQL) SELECT COUNT(*) FROM "last_performed" WHERE ("action"=?) AND ("timestamp">=?); [PersistInt64 1,PersistUTCTime 2023-06-10 13:58:32.041556829 UTC]
2023-06-11 13:58:32.043718: [debug] Using package location completions from a lock file
2023-06-11 13:58:32.052159: [debug] Loaded snapshot from Pantry database.
2023-06-11 13:58:32.218460: [debug] Prefetching git repos: []
2023-06-11 13:58:32.218525: [debug] []
2023-06-11 13:58:32.220312: [debug] Asking for a supported GHC version
2023-06-11 13:58:32.220355: [debug] Getting system compiler version
2023-06-11 13:58:32.221700: [debug] (SQL) SELECT "id","actual_version","arch","ghc_path","ghc_size","ghc_modified","ghc_pkg_path","runghc_path","haddock_path","cabal_version","global_db","global_db_cache_size","global_db_cache_modified","info","global_dump" FROM "compiler_cache" WHERE "ghc_path"=?; [PersistText "/usr/local/.ghcup/ghc/9.4.4/bin/ghc-9.4.4"]
2023-06-11 13:58:32.263747: [debug] Loaded compiler information from cache
2023-06-11 13:58:32.263909: [debug] Not using compiler at "/usr/local/.ghcup/ghc/9.4.4/bin/ghc-9.4.4": PrettyException UnwantedCompilerVersion
2023-06-11 13:58:32.264364: [debug] Installed tools: 
 - 
2023-06-11 13:58:32.264483: [debug] Run process: /sbin/ldconfig -p
2023-06-11 13:58:32.265620: [debug] Process finished in 1ms: /sbin/ldconfig -p
2023-06-11 13:58:32.265797: [debug] Run process: /usr/bin/ldd --version
musl libc (x86_64)
Version 1.2.3
Dynamic Program Loader
Usage: /lib/ld-musl-x86_64.so.1 [options] [--] pathname
2023-06-11 13:58:32.266560: [debug] Process finished in 1ms: /usr/bin/ldd --version
2023-06-11 13:58:32.266620: [debug] Did not find a version of shared library libc6.
2023-06-11 13:58:32.266667: [debug] Did not find shared library libtinfo.so.5
2023-06-11 13:58:32.266742: [debug] Found shared library libtinfo.so.6 in /usr/lib/
2023-06-11 13:58:32.266772: [debug] Found shared library libncursesw.so.6 in /usr/lib/
2023-06-11 13:58:32.266806: [debug] Found shared library libgmp.so.10 in /usr/lib/
2023-06-11 13:58:32.266832: [debug] Did not find shared library libgmp.so.3
2023-06-11 13:58:32.266850: [debug] Potential GHC builds: tinfo6-libc6-pre232, ncurses6
2023-06-11 13:58:32.266892: [debug] Found already installed GHC builds: 
2023-06-11 13:58:32.542665: [debug] Trying to setup GHC build: tinfo6-libc6-pre232
2023-06-11 13:58:32.542750: [info] Preparing to install GHC (tinfo6-libc6-pre232) to an isolated location. This will not interfere with
any system-level installation.
2023-06-11 13:58:32.543016: [info] Preparing to download ghc-tinfo6-libc6-pre232-8.2.2 ...
2023-06-11 13:58:32.543059: [debug] Downloading from https://github.com/commercialhaskell/ghc/releases/download/ghc-8.2.2-release/ghc-8.2.2-x86_64-fedora27-linux-patch1.tar.xz to /home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2.tar.xz ...
2023-06-11 13:58:32.543088: [debug] Will check against sha1 hash: 124b0f81079cecfa5813cbed0b37cd4bff89345d
2023-06-11 13:58:32.543107: [debug] Will check against sha256 hash: 282094d67a786e975d71022f1c9650d19f6f5eeb6a618a9c14dd9cccf1eff9f7
2023-06-11 13:58:33.264049: [info] Already downloaded ghc-tinfo6-libc6-pre232-8.2.2.
2023-06-11 13:58:33.268149: [debug] menv = fromList [("GHCUP_INSTALL_BASE_PREFIX","/usr/local"),("HOME","/home/user/myproject/.stack-work/docker/_home"),("HOSTNAME","agape"),("PATH","/opt/host/bin:/home/user/myproject/.stack-work/docker/_home/.local/bin:/usr/local/.ghcup/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"),("PWD","/home/user/myproject"),("STACK_IN_CONTAINER","1"),("STACK_PLATFORM_VARIANT","dk85569e7f830e7dc606115fd702e078fb"),("STACK_ROOT","/home/user/.stack"),("USER","user")]
2023-06-11 13:58:33.268557: [debug] ziptool: xz
2023-06-11 13:58:33.268595: [debug] make: make
2023-06-11 13:58:33.268648: [debug] tar: tar
2023-06-11 13:58:33.268664: [info] Unpacking GHC into /home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2.temp/ ...
2023-06-11 13:58:33.268681: [debug] Unpacking /home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2.tar.xz
2023-06-11 13:58:33.268790: [debug] Run process within /home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2.temp/: /usr/bin/tar Jxf /home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2.tar.xz
2023-06-11 13:58:45.971316: [debug] Process finished in 12702ms: /usr/bin/tar Jxf /home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2.tar.xz
2023-06-11 13:58:45.971483: [info] Configuring GHC ...
2023-06-11 13:58:45.971628: [debug] Run process within /home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2.temp/ghc-8.2.2/: /home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2.temp/ghc-8.2.2/configure --prefix=/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/
<bunch of conifigure output, removed because comment was too long>
2023-06-11 13:58:47.330296: [debug] ****************************************************
2023-06-11 13:58:47.330355: [debug] Configuration done, ready to 'make install'
2023-06-11 13:58:47.330374: [debug] (see README and INSTALL files for more info.)
2023-06-11 13:58:47.330574: [debug] ****************************************************
2023-06-11 13:58:47.343718: [debug] Process finished in 1372ms: /home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2.temp/ghc-8.2.2/configure --prefix=/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/
2023-06-11 13:58:47.343777: [info] Installing GHC ...
2023-06-11 13:58:47.343915: [debug] Run process within /home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2.temp/ghc-8.2.2/: /usr/bin/make install
2023-06-11 13:58:47.346085: [debug] /usr/bin/make --no-print-directory -f ghc.mk install BINDIST=YES NO_INCLUDE_DEPS=YES
2023-06-11 13:58:47.862059: [debug] "rm" -f utils/ghc-pkg/dist-install/build/Version.hs  
2023-06-11 13:58:47.863006: [debug] echo "module Version where"                    >> utils/ghc-pkg/dist-install/build/Version.hs
2023-06-11 13:58:47.863559: [debug] echo "version, targetOS, targetARCH :: String" >> utils/ghc-pkg/dist-install/build/Version.hs
2023-06-11 13:58:47.863947: [debug] echo "version    = \"8.2.2\""      >> utils/ghc-pkg/dist-install/build/Version.hs
2023-06-11 13:58:47.864356: [debug] echo "targetOS   = \"linux\""        >> utils/ghc-pkg/dist-install/build/Version.hs
2023-06-11 13:58:47.864774: [debug] echo "targetARCH = \"x86_64\""      >> utils/ghc-pkg/dist-install/build/Version.hs
2023-06-11 13:58:47.865433: [debug] "rm" -f utils/ghc-pkg/dist/build/Version.hs  
2023-06-11 13:58:47.866408: [debug] echo "module Version where"                    >> utils/ghc-pkg/dist/build/Version.hs
2023-06-11 13:58:47.867031: [debug] echo "version, targetOS, targetARCH :: String" >> utils/ghc-pkg/dist/build/Version.hs
2023-06-11 13:58:47.867544: [debug] echo "version    = \"8.2.2\""      >> utils/ghc-pkg/dist/build/Version.hs
2023-06-11 13:58:47.867955: [debug] echo "targetOS   = \"linux\""        >> utils/ghc-pkg/dist/build/Version.hs
2023-06-11 13:58:47.868399: [debug] echo "targetARCH = \"x86_64\""      >> utils/ghc-pkg/dist/build/Version.hs
2023-06-11 13:58:47.870289: [debug] /usr/bin/install -c -m 755 -d "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin"
2023-06-11 13:58:47.871322: [debug] "rm" -f                                         "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/hp2ps"  
2023-06-11 13:58:47.872138: [debug] create () { touch "$1" && chmod 755 "$1" ; } && create                                           "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/hp2ps"
2023-06-11 13:58:47.873626: [debug] echo '#!/bin/sh'                                       >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/hp2ps"
2023-06-11 13:58:47.874252: [debug] echo 'exedir="/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/bin"'                    >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/hp2ps"
2023-06-11 13:58:47.874839: [debug] echo 'exeprog="hp2ps"'                          >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/hp2ps"
2023-06-11 13:58:47.875392: [debug] echo 'executablename="$exedir/$exeprog"'           >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/hp2ps"
2023-06-11 13:58:47.875871: [debug] echo 'datadir="/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/share"'                             >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/hp2ps"
2023-06-11 13:58:47.876299: [debug] echo 'bindir="/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin"'                               >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/hp2ps"
2023-06-11 13:58:47.876720: [debug] echo 'topdir="/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2"'                               >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/hp2ps"
2023-06-11 13:58:47.877233: [debug] cat utils/hp2ps/hp2ps.wrapper                         >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/hp2ps"
2023-06-11 13:58:47.877985: [debug] chmod +x                                         "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/hp2ps"
2023-06-11 13:58:47.878844: [debug] /usr/bin/install -c -m 755 -d "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin"
2023-06-11 13:58:47.879753: [debug] "rm" -f                                 "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/ghci-8.2.2"  
2023-06-11 13:58:47.880416: [debug] create () { touch "$1" && chmod 755 "$1" ; } && create                                   "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/ghci-8.2.2"
2023-06-11 13:58:47.881845: [debug] echo '#!/bin/sh'                               >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/ghci-8.2.2"
2023-06-11 13:58:47.882364: [debug] echo 'exec "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/ghc-8.2.2" --interactive "$@"' >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/ghci-8.2.2"
2023-06-11 13:58:47.882864: [debug] chmod +x                                 "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/ghci-8.2.2"
2023-06-11 13:58:47.883512: [debug] "rm" -f "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/ghci"  
2023-06-11 13:58:47.884198: [debug] ln -s ghci-8.2.2 "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/ghci"
2023-06-11 13:58:47.884956: [debug] /usr/bin/install -c -m 755 -d "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/include"
2023-06-11 13:58:47.885903: [debug] /usr/bin/install -c -m 755 -d "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/include/." && /usr/bin/install -c -m 644  includes/./*.h "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/include/./" &&   /usr/bin/install -c -m 755 -d "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/include/rts" && /usr/bin/install -c -m 644  includes/rts/*.h "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/include/rts/" &&   /usr/bin/install -c -m 755 -d "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/include/rts/prof" && /usr/bin/install -c -m 644  includes/rts/prof/*.h "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/include/rts/prof/" &&   /usr/bin/install -c -m 755 -d "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/include/rts/storage" && /usr/bin/install -c -m 644  includes/rts/storage/*.h "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/include/rts/storage/" &&   /usr/bin/install -c -m 755 -d "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/include/stg" && /usr/bin/install -c -m 644  includes/stg/*.h "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/include/stg/" &&  true
2023-06-11 13:58:47.896011: [debug] /usr/bin/install -c -m 644  includes/ghcautoconf.h includes/ghcplatform.h includes/ghcversion.h includes/dist-derivedconstants/header/DerivedConstants.h "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/include/"
2023-06-11 13:58:47.897423: [debug] /usr/bin/install -c -m 755 -d "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/include"
2023-06-11 13:58:47.898553: [debug] /usr/bin/install -c -m 644  rts/dist/build/ffi.h rts/dist/build/ffitarget.h "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/include/"
2023-06-11 13:58:47.899663: [debug] /usr/bin/install -c -m 755 -d "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin"
2023-06-11 13:58:47.900621: [debug] "rm" -f                                         "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/haddock-ghc-8.2.2"  
2023-06-11 13:58:47.901427: [debug] create () { touch "$1" && chmod 755 "$1" ; } && create                                           "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/haddock-ghc-8.2.2"
2023-06-11 13:58:47.902944: [debug] echo '#!/bin/sh'                                       >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/haddock-ghc-8.2.2"
2023-06-11 13:58:47.903475: [debug] echo 'exedir="/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/bin"'                    >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/haddock-ghc-8.2.2"
2023-06-11 13:58:47.903920: [debug] echo 'exeprog="haddock"'                          >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/haddock-ghc-8.2.2"
2023-06-11 13:58:47.904424: [debug] echo 'executablename="$exedir/$exeprog"'           >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/haddock-ghc-8.2.2"
2023-06-11 13:58:47.904879: [debug] echo 'datadir="/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/share"'                             >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/haddock-ghc-8.2.2"
2023-06-11 13:58:47.905391: [debug] echo 'bindir="/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin"'                               >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/haddock-ghc-8.2.2"
2023-06-11 13:58:47.905854: [debug] echo 'topdir="/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2"'                               >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/haddock-ghc-8.2.2"
2023-06-11 13:58:47.906238: [debug] cat utils/haddock/haddock.wrapper                         >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/haddock-ghc-8.2.2"
2023-06-11 13:58:47.906924: [debug] chmod +x                                         "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/haddock-ghc-8.2.2"
2023-06-11 13:58:47.907776: [debug] /usr/bin/install -c -m 755 -d "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/html/"  
2023-06-11 13:58:47.908651: [debug] /usr/bin/install -c -m 755 -d "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/html/Classic.theme/"  
2023-06-11 13:58:47.909369: [debug] /usr/bin/install -c -m 755 -d "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/html/Ocean.std-theme/"  
2023-06-11 13:58:47.910064: [debug] /usr/bin/install -c -m 755 -d "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/latex/"
2023-06-11 13:58:47.910733: [debug] /usr/bin/install -c -m 644  utils/haddock/haddock-api/resources/html/haddock-util.js "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/html/"  
2023-06-11 13:58:47.911496: [debug] /usr/bin/install -c -m 644  utils/haddock/haddock-api/resources/html/Classic.theme/haskell_icon.gif "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/html/Classic.theme/"  
2023-06-11 13:58:47.912247: [debug] /usr/bin/install -c -m 644  utils/haddock/haddock-api/resources/html/Classic.theme/minus.gif "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/html/Classic.theme/"  
2023-06-11 13:58:47.912995: [debug] /usr/bin/install -c -m 644  utils/haddock/haddock-api/resources/html/Classic.theme/plus.gif "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/html/Classic.theme/"  
2023-06-11 13:58:47.913730: [debug] /usr/bin/install -c -m 644  utils/haddock/haddock-api/resources/html/Classic.theme/xhaddock.css "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/html/Classic.theme/"  
2023-06-11 13:58:47.914483: [debug] /usr/bin/install -c -m 644  utils/haddock/haddock-api/resources/html/Ocean.std-theme/hslogo-16.png "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/html/Ocean.std-theme/"  
2023-06-11 13:58:47.915207: [debug] /usr/bin/install -c -m 644  utils/haddock/haddock-api/resources/html/Ocean.std-theme/minus.gif "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/html/Ocean.std-theme/"  
2023-06-11 13:58:47.915934: [debug] /usr/bin/install -c -m 644  utils/haddock/haddock-api/resources/html/Ocean.std-theme/ocean.css "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/html/Ocean.std-theme/"  
2023-06-11 13:58:47.916645: [debug] /usr/bin/install -c -m 644  utils/haddock/haddock-api/resources/html/Ocean.std-theme/plus.gif "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/html/Ocean.std-theme/"  
2023-06-11 13:58:47.917372: [debug] /usr/bin/install -c -m 644  utils/haddock/haddock-api/resources/html/Ocean.std-theme/synopsis.png "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/html/Ocean.std-theme/"  
2023-06-11 13:58:47.918118: [debug] /usr/bin/install -c -m 644  utils/haddock/haddock-api/resources/html/solarized.css "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/html/"  
2023-06-11 13:58:47.918862: [debug] /usr/bin/install -c -m 644  utils/haddock/haddock-api/resources/html/highlight.js "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/html/"  
2023-06-11 13:58:47.919526: [debug] /usr/bin/install -c -m 644  utils/haddock/haddock-api/resources/latex/haddock.sty "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/latex/"
2023-06-11 13:58:47.920313: [debug] "rm" -f "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/haddock"  
2023-06-11 13:58:47.921309: [debug] ln -s haddock-ghc-8.2.2 "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/haddock"
2023-06-11 13:58:47.922267: [debug] /usr/bin/install -c -m 755 -d "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin"
2023-06-11 13:58:47.923207: [debug] "rm" -f                                         "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/hsc2hs"  
2023-06-11 13:58:47.923949: [debug] create () { touch "$1" && chmod 755 "$1" ; } && create                                           "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/hsc2hs"
2023-06-11 13:58:47.925504: [debug] echo '#!/bin/sh'                                       >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/hsc2hs"
2023-06-11 13:58:47.925995: [debug] echo 'exedir="/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/bin"'                    >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/hsc2hs"
2023-06-11 13:58:47.926535: [debug] echo 'exeprog="hsc2hs"'                          >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/hsc2hs"
2023-06-11 13:58:47.927063: [debug] echo 'executablename="$exedir/$exeprog"'           >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/hsc2hs"
2023-06-11 13:58:47.927620: [debug] echo 'datadir="/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/share"'                             >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/hsc2hs"
2023-06-11 13:58:47.928102: [debug] echo 'bindir="/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin"'                               >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/hsc2hs"
2023-06-11 13:58:47.928622: [debug] echo 'topdir="/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2"'                               >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/hsc2hs"
2023-06-11 13:58:47.929062: [debug] echo 'HSC2HS_EXTRA="--cflag=-fno-stack-protector --lflag=-fuse-ld=gold"' >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/hsc2hs"
2023-06-11 13:58:47.929493: [debug] cat utils/hsc2hs/hsc2hs.wrapper                         >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/hsc2hs"
2023-06-11 13:58:47.930200: [debug] chmod +x                                         "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/hsc2hs"
2023-06-11 13:58:47.930907: [debug] /usr/bin/install -c -m 644  utils/hsc2hs/template-hsc.h "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2"
2023-06-11 13:58:47.931969: [debug] /usr/bin/install -c -m 755 -d "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin"
2023-06-11 13:58:47.932765: [debug] "rm" -f                                         "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/ghc-pkg-8.2.2"  
2023-06-11 13:58:47.933477: [debug] create () { touch "$1" && chmod 755 "$1" ; } && create                                           "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/ghc-pkg-8.2.2"
2023-06-11 13:58:47.934916: [debug] echo '#!/bin/sh'                                       >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/ghc-pkg-8.2.2"
2023-06-11 13:58:47.935434: [debug] echo 'exedir="/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/bin"'                    >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/ghc-pkg-8.2.2"
2023-06-11 13:58:47.935848: [debug] echo 'exeprog="ghc-pkg"'                          >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/ghc-pkg-8.2.2"
2023-06-11 13:58:47.936288: [debug] echo 'executablename="$exedir/$exeprog"'           >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/ghc-pkg-8.2.2"
2023-06-11 13:58:47.936706: [debug] echo 'datadir="/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/share"'                             >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/ghc-pkg-8.2.2"
2023-06-11 13:58:47.937119: [debug] echo 'bindir="/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin"'                               >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/ghc-pkg-8.2.2"
2023-06-11 13:58:47.937721: [debug] echo 'topdir="/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2"'                               >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/ghc-pkg-8.2.2"
2023-06-11 13:58:47.938119: [debug] cat utils/ghc-pkg/ghc-pkg.wrapper                         >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/ghc-pkg-8.2.2"
2023-06-11 13:58:47.938772: [debug] chmod +x                                         "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/ghc-pkg-8.2.2"
2023-06-11 13:58:47.939483: [debug] /usr/bin/install -c -m 755 -d "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin"
2023-06-11 13:58:47.940361: [debug] "rm" -f "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/ghc-pkg"  
2023-06-11 13:58:47.940975: [debug] ln -s ghc-pkg-8.2.2 "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/ghc-pkg"
2023-06-11 13:58:47.941781: [debug] /usr/bin/install -c -m 755 -d "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin"
2023-06-11 13:58:47.942613: [debug] "rm" -f                                         "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/hpc"  
2023-06-11 13:58:47.943353: [debug] create () { touch "$1" && chmod 755 "$1" ; } && create                                           "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/hpc"
2023-06-11 13:58:47.944663: [debug] echo '#!/bin/sh'                                       >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/hpc"
2023-06-11 13:58:47.945052: [debug] echo 'exedir="/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/bin"'                    >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/hpc"
2023-06-11 13:58:47.945510: [debug] echo 'exeprog="hpc"'                          >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/hpc"
2023-06-11 13:58:47.945910: [debug] echo 'executablename="$exedir/$exeprog"'           >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/hpc"
2023-06-11 13:58:47.946391: [debug] echo 'datadir="/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/share"'                             >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/hpc"
2023-06-11 13:58:47.946802: [debug] echo 'bindir="/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin"'                               >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/hpc"
2023-06-11 13:58:47.947243: [debug] echo 'topdir="/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2"'                               >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/hpc"
2023-06-11 13:58:47.947642: [debug] cat utils/hpc/hpc.wrapper                         >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/hpc"
2023-06-11 13:58:47.948302: [debug] chmod +x                                         "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/hpc"
2023-06-11 13:58:47.949145: [debug] /usr/bin/install -c -m 755 -d "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin"
2023-06-11 13:58:47.950020: [debug] "rm" -f                                         "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/runghc-8.2.2"  
2023-06-11 13:58:47.950690: [debug] create () { touch "$1" && chmod 755 "$1" ; } && create                                           "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/runghc-8.2.2"
2023-06-11 13:58:47.951972: [debug] echo '#!/bin/sh'                                       >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/runghc-8.2.2"
2023-06-11 13:58:47.952421: [debug] echo 'exedir="/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/bin"'                    >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/runghc-8.2.2"
2023-06-11 13:58:47.952861: [debug] echo 'exeprog="runghc"'                          >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/runghc-8.2.2"
2023-06-11 13:58:47.953395: [debug] echo 'executablename="$exedir/$exeprog"'           >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/runghc-8.2.2"
2023-06-11 13:58:47.953894: [debug] echo 'datadir="/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/share"'                             >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/runghc-8.2.2"
2023-06-11 13:58:47.954383: [debug] echo 'bindir="/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin"'                               >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/runghc-8.2.2"
2023-06-11 13:58:47.954829: [debug] echo 'topdir="/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2"'                               >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/runghc-8.2.2"
2023-06-11 13:58:47.955266: [debug] echo 'ghcprog="ghc-8.2.2"' >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/runghc-8.2.2"
2023-06-11 13:58:47.955656: [debug] cat utils/runghc/runghc.wrapper                         >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/runghc-8.2.2"
2023-06-11 13:58:47.956360: [debug] chmod +x                                         "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/runghc-8.2.2"
2023-06-11 13:58:47.957138: [debug] "rm" -f "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/runhaskell"  
2023-06-11 13:58:47.958167: [debug] ln -s runghc "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/runhaskell"
2023-06-11 13:58:47.958990: [debug] "rm" -f "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/runghc"  
2023-06-11 13:58:47.959958: [debug] ln -s runghc-8.2.2 "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/runghc"
2023-06-11 13:58:47.960926: [debug] /usr/bin/install -c -m 755 -d "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin"
2023-06-11 13:58:47.961933: [debug] "rm" -f                                         "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/ghc-8.2.2"  
2023-06-11 13:58:47.962628: [debug] create () { touch "$1" && chmod 755 "$1" ; } && create                                           "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/ghc-8.2.2"
2023-06-11 13:58:47.963939: [debug] echo '#!/bin/sh'                                       >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/ghc-8.2.2"
2023-06-11 13:58:47.964326: [debug] echo 'exedir="/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/bin"'                    >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/ghc-8.2.2"
2023-06-11 13:58:47.964782: [debug] echo 'exeprog="ghc-stage2"'                          >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/ghc-8.2.2"
2023-06-11 13:58:47.965204: [debug] echo 'executablename="$exedir/$exeprog"'           >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/ghc-8.2.2"
2023-06-11 13:58:47.965651: [debug] echo 'datadir="/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/share"'                             >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/ghc-8.2.2"
2023-06-11 13:58:47.966084: [debug] echo 'bindir="/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin"'                               >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/ghc-8.2.2"
2023-06-11 13:58:47.966492: [debug] echo 'topdir="/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2"'                               >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/ghc-8.2.2"
2023-06-11 13:58:47.966902: [debug] echo 'executablename="$exedir/ghc"' >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/ghc-8.2.2"
2023-06-11 13:58:47.967288: [debug] cat ghc/ghc.wrapper                         >> "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/ghc-8.2.2"
2023-06-11 13:58:47.967941: [debug] chmod +x                                         "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/ghc-8.2.2"
2023-06-11 13:58:47.968893: [debug] "rm" -f "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/ghc"  
2023-06-11 13:58:47.970002: [debug] ln -s ghc-8.2.2 "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/bin/ghc"
2023-06-11 13:58:47.970732: [debug] /usr/bin/install -c -m 755 -d "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/share/man"
2023-06-11 13:58:47.971618: [debug] /usr/bin/install -c -m 755 -d "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/share/man/man1"
2023-06-11 13:58:47.972279: [debug] /usr/bin/install -c -m 644  docs/users_guide/build-man/ghc.1 "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/share/man/man1"
2023-06-11 13:58:47.973256: [debug] #  driver/ghc-usage.txt driver/ghci-usage.txt includes/dist-derivedconstants/header/platformConstants settings = libraries to install
2023-06-11 13:58:47.973771: [debug] #  "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2" = directory to install to
2023-06-11 13:58:47.974160: [debug] #
2023-06-11 13:58:47.974572: [debug] # The .dll case calls STRIP_CMD explicitly, instead of `install -s`, because
2023-06-11 13:58:47.974946: [debug] # on Win64, "install -s" calls a strip that doesn't understand 64bit binaries.
2023-06-11 13:58:47.975320: [debug] # For some reason, this means the DLLs end up non-executable, which means
2023-06-11 13:58:47.975709: [debug] # executables that use them just segfault.
2023-06-11 13:58:47.976085: [debug] /usr/bin/install -c -m 755 -d  "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2"
2023-06-11 13:58:47.976801: [debug] for i in  driver/ghc-usage.txt driver/ghci-usage.txt includes/dist-derivedconstants/header/platformConstants settings; do case $i in *.a) /usr/bin/install -c -m 644  $i  "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2"; true  "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2"/`basename $i` ;; *.dll) /usr/bin/install -c -m 755  $i  "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2" ; :  "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2"/`basename $i` ;; *.so) /usr/bin/install -c -m 755  $i  "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2" ;; *.dylib) /usr/bin/install -c -m 755  $i  "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2";; *) /usr/bin/install -c -m 644  $i  "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2"; esac; done
2023-06-11 13:58:47.979462: [debug] gcc -E -undef -traditional -P -DINSTALLING -DLIB_DIR='"/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2"' -DINCLUDE_DIR='"/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/include"' -DFFI_INCLUDE_DIR= -DFFI_LIB_DIR= '-DFFI_LIB="Cffi"' -x c -Iincludes -Iincludes/dist -Iincludes/dist-derivedconstants/header -Iincludes/dist-ghcconstants/header rts/package.conf.in -o rts/dist/package.conf.install.raw
2023-06-11 13:58:47.987206: [debug] grep -v '^#pragma GCC' rts/dist/package.conf.install.raw | sed -e 's/""//g' -e 's/:[ 	]*,/: /g' >rts/dist/package.conf.install
2023-06-11 13:58:47.990197: [debug] /usr/bin/install -c -m 755 -d "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/bin"
2023-06-11 13:58:47.991318: [debug] for i in utils/unlit/dist/build/tmp/unlit utils/hp2ps/dist/build/tmp/hp2ps utils/hp2ps/dist/build/tmp/hp2ps utils/haddock/dist/build/tmp/haddock utils/haddock/dist/build/tmp/haddock utils/hsc2hs/dist-install/build/tmp/hsc2hs utils/hsc2hs/dist-install/build/tmp/hsc2hs utils/ghc-pkg/dist-install/build/tmp/ghc-pkg utils/ghc-pkg/dist-install/build/tmp/ghc-pkg utils/hpc/dist-install/build/tmp/hpc utils/hpc/dist-install/build/tmp/hpc utils/runghc/dist-install/build/tmp/runghc utils/runghc/dist-install/build/tmp/runghc ghc/stage2/build/tmp/ghc-stage2 ghc/stage2/build/tmp/ghc-stage2 iserv/stage2/build/tmp/ghc-iserv iserv/stage2_p/build/tmp/ghc-iserv-prof iserv/stage2_dyn/build/tmp/ghc-iserv-dyn; do \
2023-06-11 13:58:47.991480: [debug] 	/usr/bin/install -c -m 755  $i "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/bin"; \
2023-06-11 13:58:47.991527: [debug] done
2023-06-11 13:58:48.084854: [debug] "mv" "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/bin/ghc-stage2" "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/bin/ghc"
2023-06-11 13:58:48.090306: [debug] /usr/bin/install -c -m 755 -d "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2"
2023-06-11 13:58:48.091281: [debug] "rm" -rf "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/package.conf.d"  
2023-06-11 13:58:48.092142: [debug] /usr/bin/install -c -m 755 -d "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/package.conf.d"
2023-06-11 13:58:48.092857: [debug] /usr/bin/install -c -m 755 -d "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/rts"
2023-06-11 13:58:48.093626: [debug] #  rts/dist/build/libHSrts.a rts/dist/build/libHSrts_p.a rts/dist/build/libHSrts-ghc8.2.2.so rts/dist/build/libHSrts_l.a rts/dist/build/libHSrts_debug.a rts/dist/build/libHSrts_thr.a rts/dist/build/libHSrts_thr_debug.a rts/dist/build/libHSrts_thr_l.a rts/dist/build/libHSrts_thr_p.a rts/dist/build/libHSrts_debug-ghc8.2.2.so rts/dist/build/libHSrts_thr-ghc8.2.2.so rts/dist/build/libHSrts_thr_debug-ghc8.2.2.so rts/dist/build/libHSrts_l-ghc8.2.2.so rts/dist/build/libHSrts_thr_l-ghc8.2.2.so rts/dist/build/libffi.so rts/dist/build/libffi.so.6 rts/dist/build/libffi.so.6.0.4 rts/dist/build/libCffi.a rts/dist/build/libCffi_p.a rts/dist/build/libCffi_l.a rts/dist/build/libCffi_debug.a rts/dist/build/libCffi_thr.a rts/dist/build/libCffi_thr_debug.a rts/dist/build/libCffi_thr_l.a rts/dist/build/libCffi_thr_p.a = libraries to install
2023-06-11 13:58:48.094015: [debug] #  "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/rts" = directory to install to
2023-06-11 13:58:48.094345: [debug] #
2023-06-11 13:58:48.094732: [debug] # The .dll case calls STRIP_CMD explicitly, instead of `install -s`, because
2023-06-11 13:58:48.095150: [debug] # on Win64, "install -s" calls a strip that doesn't understand 64bit binaries.
2023-06-11 13:58:48.095556: [debug] # For some reason, this means the DLLs end up non-executable, which means
2023-06-11 13:58:48.095952: [debug] # executables that use them just segfault.
2023-06-11 13:58:48.096696: [debug] /usr/bin/install -c -m 755 -d  "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/rts"
2023-06-11 13:58:48.097482: [debug] for i in  rts/dist/build/libHSrts.a rts/dist/build/libHSrts_p.a rts/dist/build/libHSrts-ghc8.2.2.so rts/dist/build/libHSrts_l.a rts/dist/build/libHSrts_debug.a rts/dist/build/libHSrts_thr.a rts/dist/build/libHSrts_thr_debug.a rts/dist/build/libHSrts_thr_l.a rts/dist/build/libHSrts_thr_p.a rts/dist/build/libHSrts_debug-ghc8.2.2.so rts/dist/build/libHSrts_thr-ghc8.2.2.so rts/dist/build/libHSrts_thr_debug-ghc8.2.2.so rts/dist/build/libHSrts_l-ghc8.2.2.so rts/dist/build/libHSrts_thr_l-ghc8.2.2.so rts/dist/build/libffi.so rts/dist/build/libffi.so.6 rts/dist/build/libffi.so.6.0.4 rts/dist/build/libCffi.a rts/dist/build/libCffi_p.a rts/dist/build/libCffi_l.a rts/dist/build/libCffi_debug.a rts/dist/build/libCffi_thr.a rts/dist/build/libCffi_thr_debug.a rts/dist/build/libCffi_thr_l.a rts/dist/build/libCffi_thr_p.a; do case $i in *.a) /usr/bin/install -c -m 644  $i  "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/rts"; true  "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/rts"/`basename $i` ;; *.dll) /usr/bin/install -c -m 755  $i  "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/rts" ; :  "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/rts"/`basename $i` ;; *.so) /usr/bin/install -c -m 755  $i  "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/rts" ;; *.dylib) /usr/bin/install -c -m 755  $i  "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/rts";; *) /usr/bin/install -c -m 644  $i  "/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2/rts"; esac; done
2023-06-11 13:58:48.181061: [debug] "utils/ghc-cabal/dist-install/build/tmp/ghc-cabal-bindist" copy libraries/ghc-prim dist-install ":" '' '/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2' '/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/lib/ghc-8.2.2' '/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/share/doc/ghc-8.2.2/html/libraries' 'v p dyn'  
2023-06-11 13:58:48.181844: [error] utils/ghc-cabal/dist-install/build/tmp/ghc-cabal-bindist: exec: line 3: utils/ghc-cabal/dist-install/build/tmp/ghc-cabal: not found
2023-06-11 13:58:48.181942: [error] make[1]: *** [ghc.mk:991: install_packages] Error 127
2023-06-11 13:58:48.182582: [error] make: *** [Makefile:51: install] Error 2
2023-06-11 13:58:48.183132: [debug] Checking for project config at: /home/user/myproject/stack.yaml
2023-06-11 13:58:48.183205: [debug] Loading project config file stack.yaml
2023-06-11 13:58:48.185980: [debug] (SQL) SELECT COUNT(*) FROM "last_performed" WHERE ("action"=?) AND ("timestamp">=?); [PersistInt64 1,PersistUTCTime 2023-06-10 13:58:48.185954565 UTC]
2023-06-11 13:58:48.186290: [error] 
Error: [S-7441]
       Received ExitFailure 2 when running
       Raw command: /usr/bin/make install
       Run from: /home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2.temp/ghc-8.2.2/
       
       Error encountered while installing GHC with
         make install
         run in
         /home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2.temp/ghc-8.2.2/
       
       The following directories may now contain files, but won't be used by Stack:
       * /home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2.temp/
       * /home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-tinfo6-libc6-pre232-8.2.2/
       
       For more information consider rerunning with --verbose flag.
       
2023-06-11 15:58:48.754607: [debug] Run process: /usr/bin/docker rm -f 9276dbb6f33fcbe398db29b32e57047e513f047c42da0a07c43a9b284f294e92
2023-06-11 15:58:48.820750: [debug] Process finished in 66ms: /usr/bin/docker rm -f 9276dbb6f33fcbe398db29b32e57047e513f047c42da0a07c43a9b284f294e92

Failed with integer-gmp

I tried to build a static linked package with this docker image, there're some third-party packages depending on integer-gmp,
When I try to build my package, it failed with error

#11 244.5 'cabal copy' failed.  Error message:
#11 244.5
#11 244.5 --  While building package integer-gmp-1.0.3.0 (scroll up to its section to see the error) using:
#11 244.5       /tmp/stack-e5c68ff1884e36c5/integer-gmp-1.0.3.0/.stack-work/dist/x86_64-linux/Cabal-3.2.1.0/setup/setup --builddir=.stack-work/dist/x86_64-linux/Cabal-3.2.1.0 copy
#11 244.5     Process exited with code: ExitFailure 1
#11 244.5
#11 244.5 Possible causes of this issue:
#11 244.5 * No module named "Main". The 'main-is' source file should usually have a header indicating that it's a 'Main' module.
#11 244.5 * A cabal file that refers to nonexistent other files (e.g. a license-file that doesn't exist). Running 'cabal check' may point out these issues.
#11 244.5 * The Setup.hs file is changing the installation target dir.
#11 244.5

I checked the build logs, I found it may be caused by:

integer-gmp                      > setup: can't find include file ghc-gmp.h

Is there any idea to solve the problem?

Docker image with GHC 9.2.5

Hi,

I'm using ghc-musl docker image to create a builder image on top of it and then use it with stack. I am trying to switch from GHC 8.10.7 to 9.2 which currently means using LTS 20.6 bundled with GHC 9.2.5.

Would it be possible to push utdemir/ghc-musl:v24-ghc925? I only see v24-ghc922 on the Dockerhub. Or what is your policy about image versions?

I am also okay with building ghc-musl:v24-ghc925 myself locally, but I'm not very familiar with Earthly and not sure how to do it. If I run earthly --allow-privileged --push --artifact +ghc925/README the image is apparently built, but is not pushed or something. So what would be the easier way to get a 9.2.5-based image pushed to the local Docker?

SSL certificates

Great project!

My cabal.project refers to remote repositories using source-repository-package, but cabal can't fetch them inside this container because the certificates aren't configured.

SSL certificate problem: unable to get local issuer certificate

Is it possible to add certificates to this container so that source-repository-package can be used?

Alpine package upgrades

During discussion in #21, I ran lsupg on utdemir/ghc-musl:v24-ghc922 and was surprised to see that many packages have updates for an image that was built so recently. I assume that ghc-musl containers are not public-facing, but statically linking old versions of libraries could have security implications for the static executables built using ghc-musl.

The image that I am testing was built within the past two days.

$ docker images utdemir/ghc-musl
REPOSITORY         TAG           IMAGE ID       CREATED             SIZE
utdemir/ghc-musl   v24-ghc884    762d6c408038   About an hour ago   3.38GB
utdemir/ghc-musl   v24-ghc922    e4b4c874e807   40 hours ago        3.71GB
utdemir/ghc-musl   v24-ghc8107   bf3cac041a70   41 hours ago        3.42GB
utdemir/ghc-musl   v24-ghc902    f7e76a7f3474   41 hours ago        3.32GB

There are a number of packages with updates available. In this case, ghc-musl users may be concerned with the old crypto, TLS, and SSL packages.

$ lsupg --docker utdemir/ghc-musl:v24-ghc922
apk  busybox                 1.34.1-r3    1.34.1-r4
apk  ca-certificates-bundle  20191127-r7  20211220-r0
apk  libcrypto1.1            1.1.1l-r8    1.1.1n-r0
apk  libssl1.1               1.1.1l-r8    1.1.1n-r0
apk  libretls                3.3.4-r2     3.3.4-r3
apk  ssl_client              1.34.1-r3    1.34.1-r4
apk  bash                    5.1.8-r0     5.1.16-r0
apk  expat                   2.4.4-r0     2.4.7-r0
apk  openssl-dev             1.1.1l-r8    1.1.1n-r0
apk  openssl-libs-static     1.1.1l-r8    1.1.1n-r0
apk  libxml2                 2.9.12-r2    2.9.13-r0

The problem is that apk update is run to update the package index, but apk upgrade is not run to upgrade the packages that are already installed. The parent image (alpine:3.15.0) is over four months old, so the packages really should be upgraded, IMHO.

Using a specific version (3.15.0) of the alpine image makes it clear exactly which image was used to build a ghc-musl image. Adding apk upgrade, however, means that the packages used depends on the timing of the build. Perhaps this negates the point of using a specific version? Would it be worthwhile to use alpine:latest instead? Note that I recommend running apk upgrade even when using the latest image.

Would you be so kind as to include stack?

I was enthusiast when I read that Images come with ghc and cabal executables alongside with commonly used libraries and build tools. Finding out that stack must be manually installed was disappointing. Of course, it's quite simple for the end user to add stack, but I think this does not honor the promise made in the sentence quoted.

Let's not forget all those who enjoy easy builds from Stackage snapshots... :)

edit: I realize there is a Stack workflow that is already supported, i.e using Stack from the host to build the target image. But you base image also allows to produce nice statically linked executables from outside the host, i.e. from a CI/CD runner. It is in particular in this context that it would be appreciable to have Stack pre-installed, so as to be able to use the image you offer as a build context to copy an executable from.

Build a statically linked Haskell library with ghc-musl

Hello,

I am attempting to statically link a Haskell library that exports a C API. But I get the following errors if I pass the -optl-static flag:

/usr/lib/gcc/x86_64-alpine-linux-musl/10.3.1/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/gcc/x86_64-alpine-linux-musl/10.3.1/crtbeginT.o: relocation R_X86_64_32 against hidden symbol `__TMC_END__' can not be used when making a shared object
/usr/lib/gcc/x86_64-alpine-linux-musl/10.3.1/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/gcc/x86_64-alpine-linux-musl/10.3.1/crtend.o: relocation R_X86_64_32 against `.ctors' can not be used when making a shared object; recompile with -fPIC
collect2: error: ld returned 1 exit status

without the -optl-static flag the file is linked but when I run ldd I see there are dependencies like the following:

ldd libEval.so 
	/lib/ld-musl-x86_64.so.1 (0x7f74a28ec000)
	libc.musl-x86_64.so.1 => /lib/ld-musl-x86_64.so.1 (0x7f74a28ec000)
	libgmp.so.10 => /usr/lib/libgmp.so.10 (0x7f74a1d16000)
Error relocating libEval.so: __fini_array_start: symbol not found
Error relocating libEval.so: __fini_array_end: symbol not found

Let me share the full set of commands and the full program so that the error can be reproduced. Here is what the programs looks like (taken from http://www.vex.net/~trebla/haskell/so.xhtml#top):

Eval.hs

module Eval() where

import Prelude hiding (lex)
import Foreign.C
import Foreign
import Control.Applicative
import Text.ParserCombinators.ReadP
import Text.Read.Lex

foreign export ccall "eval" c_eval :: CString -> Ptr CInt -> IO (Ptr CInt)

c_eval s r = do
    cs <- peekCAString s
    case hs_eval cs of
        Nothing -> return nullPtr
        Just x -> do
            poke r x
            return r

hs_eval :: String -> Maybe CInt
hs_eval inp = case readP_to_S expr inp of
    (a,_) : _ -> Just a
    [] -> Nothing

expr = addition <* expect EOF

addition = chainl1 multiplication add
  where
    add = expect (Symbol "+") >> return (+)

multiplication = chainl1 atom mul
  where
    mul = expect (Symbol "*") >> return (*)

atom = number <|> between lp rp addition

number = do
    Number n <- lex
    case numberToInteger n of
        Just i -> return (fromIntegral i)
        Nothing -> pfail

lp = expect (Punc "(")
rp = expect (Punc ")")

hsbracket.c

#include <HsFFI.h>

static void my_enter(void) __attribute__((constructor));
static void my_enter(void)
{
  static char *argv[] = { "libEval.so", 0 }, **argv_ = argv;
  static int argc = 1;
  hs_init(&argc, &argv_);
}

static void my_exit(void) __attribute__((destructor));
static void my_exit(void)
{
  hs_exit();
}

The command that I run inside your docker image is this:

ghc -O2 -fPIC -c hsbracket.c
ghc -O2 -shared -flink-rts -fPIC -o libEval.so Eval.hs hsbracket.o

This one successfully produces the shared library, but if I do ldd I get:

	/lib/ld-musl-x86_64.so.1 (0x7facb50a6000)
	libgmp.so.10 => /usr/lib/libgmp.so.10 (0x7facb44d0000)
	libc.musl-x86_64.so.1 => /lib/ld-musl-x86_64.so.1 (0x7facb50a6000)
Error relocating libEval.so: __fini_array_start: symbol not found
Error relocating libEval.so: __fini_array_end: symbol not found

Another set of commands that I tried with the above program is

ghc -O2 -fPIC -c hsbracket.c
ghc -O2 -shared -flink-rts -optl-static -fPIC -o libEval.so Eval.hs hsbracket.o

But this fails with

Linking libEval.so ...
/usr/lib/gcc/x86_64-alpine-linux-musl/10.3.1/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/gcc/x86_64-alpine-linux-musl/10.3.1/crtbeginT.o: relocation R_X86_64_32 against hidden symbol `__TMC_END__' can not be used when making a shared object
/usr/lib/gcc/x86_64-alpine-linux-musl/10.3.1/../../../../x86_64-alpine-linux-musl/bin/ld: /usr/lib/gcc/x86_64-alpine-linux-musl/10.3.1/crtend.o: relocation R_X86_64_32 against `.ctors' can not be used when making a shared object; recompile with -fPIC
collect2: error: ld returned 1 exit status
`gcc' failed in phase `Linker'. (Exit code: 1)

Is it not possible to statically link this library?

Cannot build 'summoner-tui'

I'm trying to use ghc-musl to build summoner-tui. However, I see the following error when trying to do this:

Linking /mnt/dist-newstyle/build/x86_64-linux/ghc-8.8.1/summoner-tui-2.0.0.0/x/summon-tui/build/summon-tui/summon-tui ...
/nix/store/b1zj8ydpycg7vncj40mafr177bs66gw1-binutils-2.31.1/bin/ld: cannot find -ltinfo
collect2: error: ld returned 1 exit status
`cc' failed in phase `Linker'. (Exit code: 1)
cabal: Failed to build exe:summon-tui from summoner-tui-2.0.0.0.

Earthfile suggestions

I wrote my own version of the Earthfile, to learn Earthly as well as try implementing some new features. I am creating this issue to see which (if any) of the changes you are interested in incorporating into the project.

Suggestions

Separate External Targets

The motivation is to be able to easily build specific images, without building all images. Users can then test changes against a single GHC version before building all versions, providing faster iteration. There is a target for each GHC version, a readme target for updating README.md, as well as the all target that builds everything.

For example, the following command can be used to build and test the GHC 9.2.2 image.

earthly --allow-privileged +ghc922

Note that these targets do not need to run in separate containers. A top-level FROM command is used, and none of these "external" targets have a FROM command.

Upgrade Alpine Packages

The Alpine package index is updated and installed packages are upgraded. #23

Add latest Tags

The ghc-musl images use tags that specify a version number. (I use GHC_MUSL_VERSION as the variable name for clarity.) This is great for making repeatable builds.

I think it would be a helpful to also create tags that point to the latest image for each GHC version. The tag names could simply leave out the version (ghc922) or use the string latest (latest-ghc922). Doing this allows downstream projects to use new versions (security updates) without having to bump the version number in their configuration.

Note that this is not implemented in the Earthfile below.

Use Latest Cabal Version

Each release of GHC specifies the minimum version of Cabal that it works with, but new versions of Cabal can be used with old version go GHC. Installing the minimum version is useful for testing compatibility, but ghc-musl is for building static executables, not testing. I think that it is preferable to use the latest version of Cabal for all GHC versions. There are multiple benefits:

  • Users who make use of new Cabal features will not have failures due to building with an older Cabal version.
  • The cabal tests relying on cabal list-bin can be performed. I added similar tests for Stack, btw.
  • The Earthfile is somewhat simplified.

Minimize Layers

I try to minimize the number of layers in output images. All consecutive RUN commands are combined.

Note that the test targets are not output, so they may use separate RUN commands for clarity.

Minimize Internal Targets

I combined some internal targets (such as ghcup, ghc-deps, and result) because there is no practical reason for them to be separate. IMHO, it makes the Earthfile a bit easier to read and understand.

Add TEST_CABAL And TEST_STACK Flags

I added TEST_CABAL and TEST_STACK flags so that these tests can be turned off using --build-arg options. For example, the following command can be used to disable Stack tests in CI.

earthly --no-output --build-arg TEST_STACK=0 +all

Note that the ghc target contains everything for an image, while the image target outputs the image only after the tests have passed.

Use Common Alpine Version

Unless there is a good reason to use different Alpine versions for different images, the version can be specified once.

I specify it at the top-level. Changing this versions invalidates the cache for all targets.

Use ARG To Configure BASE_TAG

The BASE_TAG should be an ARG, as it is not an environment variable.

Users who test local builds (adding dependencies necessary for their project, for example) are able to specify a custom BASE_TAG using a --build-arg option. This ensures that they do not overwrite official images.

Sort Packages

I prefer to sort the packages installed in the base-system target, so that they are easy to maintain. The first installation command, which installs general system software requirements, lists packages sorted by package name. The second installation command, which installs requirements for building static executables with various dependencies, lists packages in groups so that the program, library, -dev, and -static packages are kept together on the same line, and the lines are sorted.

Use GHCUp --set Option

I use the --set option instead of separate set commands, just to reduce the lines of code.

Reduce Whitespace

I wrote the Earthfile using a different style, which has less whitespace. I think that it makes the file easier to read, but I of course do not mind keeping the current style if it is preferred.

Note that the example Earthfiles use two-space indentation.

Specify Earthly Version

The VERSION command will be required in the future. I think it would be a good idea to start specifying it now.

Earthfile

I am pasting my Earthfile instead of linking to a branch or gist because a branch or gist may be deleted in the future. I am not including comments so that it is easier to read, but I think adding some documentation in comments (or a separate file in the repo) could help people who are not familiar with Earthly.

VERSION 0.6

ARG ALPINE_VERSION=3.15.2
FROM alpine:$ALPINE_VERSION

ARG GHC_MUSL_VERSION=24
ARG BASE_TAG=utdemir/ghc-musl:v$GHC_MUSL_VERSION

base-system:
  FROM alpine:$ALPINE_VERSION
  RUN apk update \
   && apk upgrade \
   && apk add \
        autoconf automake bash binutils-gold curl dpkg fakeroot file \
        findutils g++ gcc git make perl shadow tar xz \
   && apk add \
        brotli brotli-static \
        bzip2 bzip2-dev bzip2-static \
        curl libcurl curl-static \
        freetype freetype-dev freetype-static \
        gmp-dev \
        libffi libffi-dev \
        libpng libpng-static \
        ncurses-dev ncurses-static \
        openssl-dev openssl-libs-static \
        pcre pcre-dev \
        pcre2 pcre2-dev \
        sdl sdl-dev sdl-static \
        sdl2 sdl2-dev \
        sdl2_image sdl2_image-dev \
        sdl2_mixer sdl2_mixer-dev \
        sdl2_ttf sdl2_ttf-dev \
        sdl_image sdl_image-dev \
        sdl_mixer sdl_mixer-dev \
        xz xz-dev \
        zlib zlib-dev zlib-static \
   && ln -s /usr/lib/libncursesw.so.6 /usr/lib/libtinfo.so.6

ghc:
  FROM +base-system
  ARG --required GHC
  ENV GHCUP_INSTALL_BASE_PREFIX=/usr/local
  RUN curl --fail --output /bin/ghcup \
        'https://downloads.haskell.org/ghcup/x86_64-linux-ghcup' \
   && chmod 0755 /bin/ghcup \
   && ghcup upgrade --target /bin/ghcup \
   && ghcup install ghc "$GHC" --set \
   && ghcup install cabal --set \
   && /usr/local/.ghcup/bin/cabal update
  ENV PATH="/usr/local/.ghcup/bin:$PATH"

test-cabal:
  FROM +ghc
  COPY example /example
  WORKDIR /example/
  RUN cabal new-build example --enable-executable-static
  RUN file $(cabal list-bin example) | grep 'statically linked'
  RUN echo test | $(cabal list-bin example) | grep 'Hello World!'

test-stack:
  FROM earthly/dind:alpine
  RUN apk add curl file \
   && curl -sSL https://get.haskellstack.org/ | sh
  COPY example /example
  WORKDIR /example/
  WITH DOCKER --load ghc-musl=+ghc
    RUN stack build \
          --ghc-options '-static -optl-static -optl-pthread -fPIC' \
          --docker --docker-image ghc-musl
  END
  RUN file $(find /example/.stack-work/install/ -type f -name example) \
    | grep 'statically linked'
  RUN echo test \
    | $(find /example/.stack-work/install/ -type f -name example) \
    | grep 'Hello World!'

image:
  FROM +ghc
  ARG TEST_CABAL=1
  ARG TEST_STACK=1
  ARG --required TAG
  IF [ "$TEST_CABAL" = "1" ]
    BUILD +test-cabal
  END
  IF [ "$TEST_STACK" = "1" ]
    BUILD +test-stack
  END
  SAVE IMAGE --push "$TAG"

ghc922:
  BUILD +image --GHC=9.2.2 --TAG=$BASE_TAG-ghc922

ghc902:
  BUILD +image --GHC=9.0.2 --TAG=$BASE_TAG-ghc902

ghc8107:
  BUILD +image --GHC=8.10.7 --TAG=$BASE_TAG-ghc8107

ghc884:
  BUILD +image --GHC=8.8.4 --TAG=$BASE_TAG-ghc884

readme:
  RUN apk add bash gettext
  COPY ./update-readme.sh .
  RUN ./update-readme.sh \
        "$BASE_TAG-ghc922" \
        "$BASE_TAG-ghc902" \
        "$BASE_TAG-ghc8107" \
        "$BASE_TAG-ghc884"
  SAVE ARTIFACT README.md

all:
  BUILD +ghc922
  BUILD +ghc902
  BUILD +ghc8107
  BUILD +ghc884
  BUILD +readme

Support using integer-simple

'libgmp' has some licensing restrictions with respect to statically linking which makes it unusable on some use cases.

We can provide a set of images using integer-simple instead. We should still keep gmp based images since it has some performance benefits over integer-simple.

Build wai-app-static failed with Segfaults

I'm trying to build a static binary in v24-ghc922, but it seems to segfault when building the dependencies,

error log as such:

Waiting for download of RepoTarballPackage (RepoSecure {repoRemote =
RemoteRepo {remoteRepoName = RepoName "hackage.haskell.org", remoteRepoURI =
http://hackage.haskell.org/, remoteRepoSecure = Just True, remoteRepoRootKeys
=
["fe331502606802feac15e514d9b9ea83fee8b6ffef71335479a2e68d84adc6b0","1ea9ba32c526d1cc91ab5e5bd364ec5e9e8cb67179a471872f6e26f0ae773d42","2c6c3627bd6c982990239487f1abd02e08a02e6cf16edb105a8012d444d870c3","0a5c7ea47cd1b15f01f5f51a33adda7e655bc0f0b0615baa8e271f4c3351e21d","51f0161b906011b52c6613376b1ae937670da69322113a246a09f807c62f6921"],
remoteRepoKeyThreshold = 3, remoteRepoShouldTryHttps = True}, repoLocalDir =
"/root/.cabal/packages/hackage.haskell.org"}) (PackageIdentifier {pkgName =
PackageName "wai-app-static", pkgVersion = mkVersion [3,1,7,4]}) Nothing
Extracting
/root/.cabal/packages/hackage.haskell.org/wai-app-static/3.1.7.4/wai-app-static-3.1.7.4.tar.gz
to /dist-newstyle/tmp/src-10...
Updating wai-app-static.cabal with the latest revision from the index.
creating /dist-newstyle/tmp/src-10/wai-app-static-3.1.7.4/dist
Starting     wai-app-static-3.1.7.4 (lib)
Using self-exec internal setup method with build-type Simple and args:
["act-as-setup","--build-type=Simple","--","configure","--verbose=3","--builddir=dist","--ghc","--prefix=/root/.cabal/store/ghc-9.2.2/wai-app-static-3.1.7.4-fb9e5129137dfe755e819b6218fd6c1a5b92f08577d7495bf73e09e4fc8456e8","--bindir=/root/.cabal/store/ghc-9.2.2/wai-app-static-3.1.7.4-fb9e5129137dfe755e819b6218fd6c1a5b92f08577d7495bf73e09e4fc8456e8/bin","--libdir=/root/.cabal/store/ghc-9.2.2/wai-app-static-3.1.7.4-fb9e5129137dfe755e819b6218fd6c1a5b92f08577d7495bf73e09e4fc8456e8/lib","--libsubdir=","--dynlibdir=/root/.cabal/store/ghc-9.2.2/wai-app-static-3.1.7.4-fb9e5129137dfe755e819b6218fd6c1a5b92f08577d7495bf73e09e4fc8456e8/lib","--libexecdir=/root/.cabal/store/ghc-9.2.2/wai-app-static-3.1.7.4-fb9e5129137dfe755e819b6218fd6c1a5b92f08577d7495bf73e09e4fc8456e8/libexec","--libexecsubdir=","--datadir=/root/.cabal/store/ghc-9.2.2/wai-app-static-3.1.7.4-fb9e5129137dfe755e819b6218fd6c1a5b92f08577d7495bf73e09e4fc8456e8/share","--datasubdir=","--docdir=/root/.cabal/store/ghc-9.2.2/wai-app-static-3.1.7.4-fb9e5129137dfe755e819b6218fd6c1a5b92f08577d7495bf73e09e4fc8456e8/share/doc","--htmldir=/root/.cabal/store/ghc-9.2.2/wai-app-static-3.1.7.4-fb9e5129137dfe755e819b6218fd6c1a5b92f08577d7495bf73e09e4fc8456e8/share/doc/html","--haddockdir=/root/.cabal/store/ghc-9.2.2/wai-app-static-3.1.7.4-fb9e5129137dfe755e819b6218fd6c1a5b92f08577d7495bf73e09e4fc8456e8/share/doc/html","--sysconfdir=/root/.cabal/store/ghc-9.2.2/wai-app-static-3.1.7.4-fb9e5129137dfe755e819b6218fd6c1a5b92f08577d7495bf73e09e4fc8456e8/etc","--enable-library-vanilla","--disable-library-profiling","--disable-shared","--disable-static","--disable-executable-dynamic","--disable-executable-static","--disable-profiling","--profiling-detail=default","--library-profiling-detail=default","--enable-optimization","--disable-debug-info","--disable-library-for-ghci","--disable-split-sections","--disable-split-objs","--disable-executable-stripping","--disable-library-stripping","--package-db=clear","--package-db=global","--package-db=/root/.cabal/store/ghc-9.2.2/package.db","--flags=cryptonite","--flags=-print","--cid=wai-app-static-3.1.7.4-fb9e5129137dfe755e819b6218fd6c1a5b92f08577d7495bf73e09e4fc8456e8","--extra-prog-path=/root/.cabal/bin","--dependency=base=base-4.16.1.0","--dependency=blaze-html=blaze-html-0.9.1.2-565acf4ddcd862165036ecc9ca081afdc136af96b04c49301e544cd569ba2116","--dependency=blaze-markup=blaze-markup-0.8.2.8-8b356967fa70d06d3b451d261b05ebf61340b18e66d497ba40dc1161e0a58acc","--dependency=bytestring=bytestring-0.11.3.0","--dependency=containers=containers-0.6.5.1","--dependency=cryptonite=cryptonite-0.30-0352fdecbbe18173280a18432d4120b758b5463fa9af3cfe6043247172aa4168","--dependency=directory=directory-1.3.6.2","--dependency=file-embed=file-embed-0.0.15.0-809216cf8f025a3304e27bb2be184d8865e723942a8f2eebcbdd91a1602002b5","--dependency=filepath=filepath-1.4.2.2","--dependency=http-date=http-date-0.0.11-af0a48e46bc3982e0e3b2170d9e944af252b67756584ff5f22605776d80e1cb3","--dependency=http-types=http-types-0.12.3-9133791759d40ec950027be8b0a321efc572d0dd42fe8772ffa36daac57b2b06","--dependency=memory=memory-0.18.0-fa73a8eec938442e42f419a3ea9cd4f41895a15d4fb5dbf2e2df9cf6fc6eed9b","--dependency=mime-types=mime-types-0.1.1.0-7fa79a99c6d275fc6cb72abe9b8b5cf49ac1e678a7ff3a7dd31244614f43a5a6","--dependency=old-locale=old-locale-1.0.0.7-026ff563d66376bb5e161b2b0b2d49d2776e0b68edda93bf99e9218d4752e0cf","--dependency=optparse-applicative=optparse-applicative-0.17.0.0-bb16945600c9c810a89c43467c648560762b2126af229cd470d5d74b5464da4e","--dependency=template-haskell=template-haskell-2.18.0.0","--dependency=text=text-1.2.5.0","--dependency=time=time-1.11.1.1","--dependency=transformers=transformers-0.5.6.2","--dependency=unix-compat=unix-compat-0.6-bd2eda3eebe164580c797c2b86e6705f97857a66fa54c4537de70127cc7aa302","--dependency=unordered-containers=unordered-containers-0.2.19.1-0fca301d08e4758b101d4ec469ff91c68aba10ff38b6c557f8f1074f5f157e62","--dependency=wai=wai-3.2.3-1b4ad9bee2642bb0ea1a04aa120ba4cc5973b4c2a74f8fcb46d480c72cfa9a88","--dependency=wai-extra=wai-extra-3.1.13.0-52fdc84d9d05b81a3fdb660017ace0931933480197bbcb2f418e2ee3ca147689","--dependency=warp=warp-3.3.23-79d326ac3ad8f4dbf1f08de8bda7b31c458429ac145347fa1d57d7eb025bae41","--dependency=zlib=zlib-0.6.3.0-e9c83ab7388977aa22733fa965d2b0055d73afbfd5e640a04441ad38f747ad52","--disable-coverage","--exact-configuration","--with-ghc=/usr/local/.ghcup/bin/ghc","--with-ghc-pkg=/usr/local/.ghcup/ghc/9.2.2/bin/ghc-pkg-9.2.2","--ghc-option=-hide-all-packages","lib:wai-app-static"]
/usr/local/.ghcup/bin/cabal-3.6.0.0 act-as-setup --build-type=Simple --
configure --verbose=3 --builddir=dist --ghc
--prefix=/root/.cabal/store/ghc-9.2.2/wai-app-static-3.1.7.4-fb9e5129137dfe755e819b6218fd6c1a5b92f08577d7495bf73e09e4fc8456e8
--bindir=/root/.cabal/store/ghc-9.2.2/wai-app-static-3.1.7.4-fb9e5129137dfe755e819b6218fd6c1a5b92f08577d7495bf73e09e4fc8456e8/bin
--libdir=/root/.cabal/store/ghc-9.2.2/wai-app-static-3.1.7.4-fb9e5129137dfe755e819b6218fd6c1a5b92f08577d7495bf73e09e4fc8456e8/lib
--libsubdir=
--dynlibdir=/root/.cabal/store/ghc-9.2.2/wai-app-static-3.1.7.4-fb9e5129137dfe755e819b6218fd6c1a5b92f08577d7495bf73e09e4fc8456e8/lib
--libexecdir=/root/.cabal/store/ghc-9.2.2/wai-app-static-3.1.7.4-fb9e5129137dfe755e819b6218fd6c1a5b92f08577d7495bf73e09e4fc8456e8/libexec
--libexecsubdir=
--datadir=/root/.cabal/store/ghc-9.2.2/wai-app-static-3.1.7.4-fb9e5129137dfe755e819b6218fd6c1a5b92f08577d7495bf73e09e4fc8456e8/share
--datasubdir=
--docdir=/root/.cabal/store/ghc-9.2.2/wai-app-static-3.1.7.4-fb9e5129137dfe755e819b6218fd6c1a5b92f08577d7495bf73e09e4fc8456e8/share/doc
--htmldir=/root/.cabal/store/ghc-9.2.2/wai-app-static-3.1.7.4-fb9e5129137dfe755e819b6218fd6c1a5b92f08577d7495bf73e09e4fc8456e8/share/doc/html
--haddockdir=/root/.cabal/store/ghc-9.2.2/wai-app-static-3.1.7.4-fb9e5129137dfe755e819b6218fd6c1a5b92f08577d7495bf73e09e4fc8456e8/share/doc/html
--sysconfdir=/root/.cabal/store/ghc-9.2.2/wai-app-static-3.1.7.4-fb9e5129137dfe755e819b6218fd6c1a5b92f08577d7495bf73e09e4fc8456e8/etc
--enable-library-vanilla --disable-library-profiling --disable-shared
--disable-static --disable-executable-dynamic --disable-executable-static
--disable-profiling --profiling-detail=default
--library-profiling-detail=default --enable-optimization --disable-debug-info
--disable-library-for-ghci --disable-split-sections --disable-split-objs
--disable-executable-stripping --disable-library-stripping --package-db=clear
--package-db=global --package-db=/root/.cabal/store/ghc-9.2.2/package.db
--flags=cryptonite --flags=-print
--cid=wai-app-static-3.1.7.4-fb9e5129137dfe755e819b6218fd6c1a5b92f08577d7495bf73e09e4fc8456e8
--extra-prog-path=/root/.cabal/bin --dependency=base=base-4.16.1.0
--dependency=blaze-html=blaze-html-0.9.1.2-565acf4ddcd862165036ecc9ca081afdc136af96b04c49301e544cd569ba2116
--dependency=blaze-markup=blaze-markup-0.8.2.8-8b356967fa70d06d3b451d261b05ebf61340b18e66d497ba40dc1161e0a58acc
--dependency=bytestring=bytestring-0.11.3.0
--dependency=containers=containers-0.6.5.1
--dependency=cryptonite=cryptonite-0.30-0352fdecbbe18173280a18432d4120b758b5463fa9af3cfe6043247172aa4168
--dependency=directory=directory-1.3.6.2
--dependency=file-embed=file-embed-0.0.15.0-809216cf8f025a3304e27bb2be184d8865e723942a8f2eebcbdd91a1602002b5
--dependency=filepath=filepath-1.4.2.2
--dependency=http-date=http-date-0.0.11-af0a48e46bc3982e0e3b2170d9e944af252b67756584ff5f22605776d80e1cb3
--dependency=http-types=http-types-0.12.3-9133791759d40ec950027be8b0a321efc572d0dd42fe8772ffa36daac57b2b06
--dependency=memory=memory-0.18.0-fa73a8eec938442e42f419a3ea9cd4f41895a15d4fb5dbf2e2df9cf6fc6eed9b
--dependency=mime-types=mime-types-0.1.1.0-7fa79a99c6d275fc6cb72abe9b8b5cf49ac1e678a7ff3a7dd31244614f43a5a6
--dependency=old-locale=old-locale-1.0.0.7-026ff563d66376bb5e161b2b0b2d49d2776e0b68edda93bf99e9218d4752e0cf
--dependency=optparse-applicative=optparse-applicative-0.17.0.0-bb16945600c9c810a89c43467c648560762b2126af229cd470d5d74b5464da4e
--dependency=template-haskell=template-haskell-2.18.0.0
--dependency=text=text-1.2.5.0 --dependency=time=time-1.11.1.1
--dependency=transformers=transformers-0.5.6.2
--dependency=unix-compat=unix-compat-0.6-bd2eda3eebe164580c797c2b86e6705f97857a66fa54c4537de70127cc7aa302
--dependency=unordered-containers=unordered-containers-0.2.19.1-0fca301d08e4758b101d4ec469ff91c68aba10ff38b6c557f8f1074f5f157e62
--dependency=wai=wai-3.2.3-1b4ad9bee2642bb0ea1a04aa120ba4cc5973b4c2a74f8fcb46d480c72cfa9a88
--dependency=wai-extra=wai-extra-3.1.13.0-52fdc84d9d05b81a3fdb660017ace0931933480197bbcb2f418e2ee3ca147689
--dependency=warp=warp-3.3.23-79d326ac3ad8f4dbf1f08de8bda7b31c458429ac145347fa1d57d7eb025bae41
--dependency=zlib=zlib-0.6.3.0-e9c83ab7388977aa22733fa965d2b0055d73afbfd5e640a04441ad38f747ad52
--disable-coverage --exact-configuration --with-ghc=/usr/local/.ghcup/bin/ghc
--with-ghc-pkg=/usr/local/.ghcup/ghc/9.2.2/bin/ghc-pkg-9.2.2
--ghc-option=-hide-all-packages lib:wai-app-static
Redirecting build log to {handle:
/root/.cabal/logs/ghc-9.2.2/wai-app-static-3.1.7.4-fb9e5129137dfe755e819b6218fd6c1a5b92f08577d7495bf73e09e4fc8456e8.log}
Building     wai-app-static-3.1.7.4 (lib)
Using self-exec internal setup method with build-type Simple and args:
["act-as-setup","--build-type=Simple","--","build","--verbose=3","--builddir=dist"]
/usr/local/.ghcup/bin/cabal-3.6.0.0 act-as-setup --build-type=Simple -- build
--verbose=3 --builddir=dist
Redirecting build log to {handle:
/root/.cabal/logs/ghc-9.2.2/wai-app-static-3.1.7.4-fb9e5129137dfe755e819b6218fd6c1a5b92f08577d7495bf73e09e4fc8456e8.log}
packages definitely up to date:
packages previously probably up to date:
packages now probably up to date:
packages newly up to date:
packages out to date: flyio-0.1.0.0-inplace, flyio-0.1.0.0-inplace-myapp
packages invalid due to dep change: flyio-0.1.0.0-inplace, flyio-0.1.0.0-inplace-myapp, servant-server-0.19.2-2c3a326d5ffee8b8fa2ad2ac960266143579627cc0c4526e4219dc02ce8d0e1a, servant-server-0.19.2-e-greet-2387b25f466825f23e766341f552a9bc5a6f526d1d503459f326f8023d3a53ff, wai-app-static-3.1.7.4-e-warp-1d46f1866b41e14c5ca6b356c9d76dbdf8ab9db550faab2caf44296e335dbe02, wai-app-static-3.1.7.4-fb9e5129137dfe755e819b6218fd6c1a5b92f08577d7495bf73e09e4fc8456e8
packages invalid due to build failure: wai-app-static-3.1.7.4-fb9e5129137dfe755e819b6218fd6c1a5b92f08577d7495bf73e09e4fc8456e8

cabal: Failed to build servant-server-0.19.2 because it depends on
servant-server-0.19.2 which itself failed to build.
Failed to build
wai-app-static-3.1.7.4-fb9e5129137dfe755e819b6218fd6c1a5b92f08577d7495bf73e09e4fc8456e8.
The build process segfaulted (i.e. SIGSEGV).

last line from the log file:
wai-app-static-3.1.7.4-fb9e5129137dfe755e819b6218fd6c1a5b92f08577d7495bf73e09e4fc8456e8.log

[8 of 9] Compiling Network.Wai.Application.Static ( Network/Wai/Application/Static.hs, dist/build/Network/Wai/Application/Static.o )
/usr/local/.ghcup/bin/ghc returned ExitFailure (-11)

I don't know whether it is specific to ghc-musl, but it compiled on haskell:9.2

Segfault during configuring

I have enabled the ghc-musl container in my stack.yaml like so:

docker:
  enable: true
  image: utdemir/ghc-musl:v25-ghc944

The resolver is lts-21.16, which I think should be compatible.

In the cabal file, I've added

    cc-options:
        -static
    ld-options:
        -static -pthread

as recommended by this comment.

However, when running stack build, every build process exits with code -11 (segfault).

Is there something I should do differently?

Full build output

``` โžœ stack build --ghc-options ' -static -optl-static -optl-pthread -fPIC' --no-nix OneTuple > configure Only > configure StateVar > configure appar > configure Progress 4/208

Error: [S-7282]
Stack failed to execute the build
plan.

   While executing the build plan,
   Stack encountered the following
   errors:

   [S-7011]
   While
   building package appar-0.1.8 (scroll
   up to its section to see the
   error) using:
   /home/user/.stack/setup-exe-cache/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb-musl/Cabal-simple_6HauvNHV_3.8.1.0_ghc-9.4.7 --verbose=1 --builddir=.stack-work/dist/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb-musl/ghc-9.4.7 configure --with-ghc=/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-musl-9.4.7/bin/ghc-9.4.7 --with-ghc-pkg=/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-musl-9.4.7/bin/ghc-pkg-9.4.7 --user --package-db=clear --package-db=global --package-db=/home/user/.stack/snapshots/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb-musl/356fad6ceb12428804ff3010eb5d77595b26288ae84277ce1fb6cc995fc531f4/9.4.7/pkgdb --libdir=/home/user/.stack/snapshots/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb-musl/356fad6ceb12428804ff3010eb5d77595b26288ae84277ce1fb6cc995fc531f4/9.4.7/lib --bindir=/home/user/.stack/snapshots/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb-musl/356fad6ceb12428804ff3010eb5d77595b26288ae84277ce1fb6cc995fc531f4/9.4.7/bin --datadir=/home/user/.stack/snapshots/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb-musl/356fad6ceb12428804ff3010eb5d77595b26288ae84277ce1fb6cc995fc531f4/9.4.7/share --libexecdir=/home/user/.stack/snapshots/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb-musl/356fad6ceb12428804ff3010eb5d77595b26288ae84277ce1fb6cc995fc531f4/9.4.7/libexec --sysconfdir=/home/user/.stack/snapshots/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb-musl/356fad6ceb12428804ff3010eb5d77595b26288ae84277ce1fb6cc995fc531f4/9.4.7/etc --docdir=/home/user/.stack/snapshots/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb-musl/356fad6ceb12428804ff3010eb5d77595b26288ae84277ce1fb6cc995fc531f4/9.4.7/doc/appar-0.1.8 --htmldir=/home/user/.stack/snapshots/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb-musl/356fad6ceb12428804ff3010eb5d77595b26288ae84277ce1fb6cc995fc531f4/9.4.7/doc/appar-0.1.8 --haddockdir=/home/user/.stack/snapshots/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb-musl/356fad6ceb12428804ff3010eb5d77595b26288ae84277ce1fb6cc995fc531f4/9.4.7/doc/appar-0.1.8 --dependency=base=base-4.17.2.0 --dependency=bytestring=bytestring-0.11.5.2 --exact-configuration --ghc-option=-fhide-source-paths
   Process exited with
   code: ExitFailure (-11)

   [S-7011]
   While
   building package StateVar-1.2.2 (scroll
   up to its section to see the
   error) using:
   /home/user/.stack/setup-exe-cache/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb-musl/Cabal-simple_6HauvNHV_3.8.1.0_ghc-9.4.7 --verbose=1 --builddir=.stack-work/dist/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb-musl/ghc-9.4.7 configure --with-ghc=/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-musl-9.4.7/bin/ghc-9.4.7 --with-ghc-pkg=/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-musl-9.4.7/bin/ghc-pkg-9.4.7 --user --package-db=clear --package-db=global --package-db=/home/user/.stack/snapshots/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb-musl/356fad6ceb12428804ff3010eb5d77595b26288ae84277ce1fb6cc995fc531f4/9.4.7/pkgdb --libdir=/home/user/.stack/snapshots/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb-musl/356fad6ceb12428804ff3010eb5d77595b26288ae84277ce1fb6cc995fc531f4/9.4.7/lib --bindir=/home/user/.stack/snapshots/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb-musl/356fad6ceb12428804ff3010eb5d77595b26288ae84277ce1fb6cc995fc531f4/9.4.7/bin --datadir=/home/user/.stack/snapshots/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb-musl/356fad6ceb12428804ff3010eb5d77595b26288ae84277ce1fb6cc995fc531f4/9.4.7/share --libexecdir=/home/user/.stack/snapshots/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb-musl/356fad6ceb12428804ff3010eb5d77595b26288ae84277ce1fb6cc995fc531f4/9.4.7/libexec --sysconfdir=/home/user/.stack/snapshots/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb-musl/356fad6ceb12428804ff3010eb5d77595b26288ae84277ce1fb6cc995fc531f4/9.4.7/etc --docdir=/home/user/.stack/snapshots/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb-musl/356fad6ceb12428804ff3010eb5d77595b26288ae84277ce1fb6cc995fc531f4/9.4.7/doc/StateVar-1.2.2 --htmldir=/home/user/.stack/snapshots/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb-musl/356fad6ceb12428804ff3010eb5d77595b26288ae84277ce1fb6cc995fc531f4/9.4.7/doc/StateVar-1.2.2 --haddockdir=/home/user/.stack/snapshots/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb-musl/356fad6ceb12428804ff3010eb5d77595b26288ae84277ce1fb6cc995fc531f4/9.4.7/doc/StateVar-1.2.2 --dependency=base=base-4.17.2.0 --dependency=stm=stm-2.5.1.0 --dependency=transformers=transformers-0.5.6.2 --exact-configuration --ghc-option=-fhide-source-paths
   Process exited with
   code: ExitFailure (-11)

   [S-7011]
   While
   building package Only-0.1 (scroll
   up to its section to see the
   error) using:
   /home/user/.stack/setup-exe-cache/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb-musl/Cabal-simple_6HauvNHV_3.8.1.0_ghc-9.4.7 --verbose=1 --builddir=.stack-work/dist/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb-musl/ghc-9.4.7 configure --with-ghc=/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-musl-9.4.7/bin/ghc-9.4.7 --with-ghc-pkg=/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-musl-9.4.7/bin/ghc-pkg-9.4.7 --user --package-db=clear --package-db=global --package-db=/home/user/.stack/snapshots/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb-musl/356fad6ceb12428804ff3010eb5d77595b26288ae84277ce1fb6cc995fc531f4/9.4.7/pkgdb --libdir=/home/user/.stack/snapshots/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb-musl/356fad6ceb12428804ff3010eb5d77595b26288ae84277ce1fb6cc995fc531f4/9.4.7/lib --bindir=/home/user/.stack/snapshots/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb-musl/356fad6ceb12428804ff3010eb5d77595b26288ae84277ce1fb6cc995fc531f4/9.4.7/bin --datadir=/home/user/.stack/snapshots/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb-musl/356fad6ceb12428804ff3010eb5d77595b26288ae84277ce1fb6cc995fc531f4/9.4.7/share --libexecdir=/home/user/.stack/snapshots/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb-musl/356fad6ceb12428804ff3010eb5d77595b26288ae84277ce1fb6cc995fc531f4/9.4.7/libexec --sysconfdir=/home/user/.stack/snapshots/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb-musl/356fad6ceb12428804ff3010eb5d77595b26288ae84277ce1fb6cc995fc531f4/9.4.7/etc --docdir=/home/user/.stack/snapshots/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb-musl/356fad6ceb12428804ff3010eb5d77595b26288ae84277ce1fb6cc995fc531f4/9.4.7/doc/Only-0.1 --htmldir=/home/user/.stack/snapshots/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb-musl/356fad6ceb12428804ff3010eb5d77595b26288ae84277ce1fb6cc995fc531f4/9.4.7/doc/Only-0.1 --haddockdir=/home/user/.stack/snapshots/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb-musl/356fad6ceb12428804ff3010eb5d77595b26288ae84277ce1fb6cc995fc531f4/9.4.7/doc/Only-0.1 --dependency=base=base-4.17.2.0 --dependency=deepseq=deepseq-1.4.8.0 --exact-configuration --ghc-option=-fhide-source-paths
   Process exited with
   code: ExitFailure (-11)

   [S-7011]
   While
   building package OneTuple-0.4.1.1 (scroll
   up to its section to see the
   error) using:
   /home/user/.stack/setup-exe-cache/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb-musl/Cabal-simple_6HauvNHV_3.8.1.0_ghc-9.4.7 --verbose=1 --builddir=.stack-work/dist/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb-musl/ghc-9.4.7 configure --with-ghc=/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-musl-9.4.7/bin/ghc-9.4.7 --with-ghc-pkg=/home/user/.stack/programs/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb/ghc-musl-9.4.7/bin/ghc-pkg-9.4.7 --user --package-db=clear --package-db=global --package-db=/home/user/.stack/snapshots/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb-musl/356fad6ceb12428804ff3010eb5d77595b26288ae84277ce1fb6cc995fc531f4/9.4.7/pkgdb --libdir=/home/user/.stack/snapshots/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb-musl/356fad6ceb12428804ff3010eb5d77595b26288ae84277ce1fb6cc995fc531f4/9.4.7/lib --bindir=/home/user/.stack/snapshots/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb-musl/356fad6ceb12428804ff3010eb5d77595b26288ae84277ce1fb6cc995fc531f4/9.4.7/bin --datadir=/home/user/.stack/snapshots/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb-musl/356fad6ceb12428804ff3010eb5d77595b26288ae84277ce1fb6cc995fc531f4/9.4.7/share --libexecdir=/home/user/.stack/snapshots/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb-musl/356fad6ceb12428804ff3010eb5d77595b26288ae84277ce1fb6cc995fc531f4/9.4.7/libexec --sysconfdir=/home/user/.stack/snapshots/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb-musl/356fad6ceb12428804ff3010eb5d77595b26288ae84277ce1fb6cc995fc531f4/9.4.7/etc --docdir=/home/user/.stack/snapshots/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb-musl/356fad6ceb12428804ff3010eb5d77595b26288ae84277ce1fb6cc995fc531f4/9.4.7/doc/OneTuple-0.4.1.1 --htmldir=/home/user/.stack/snapshots/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb-musl/356fad6ceb12428804ff3010eb5d77595b26288ae84277ce1fb6cc995fc531f4/9.4.7/doc/OneTuple-0.4.1.1 --haddockdir=/home/user/.stack/snapshots/x86_64-linux-dk85569e7f830e7dc606115fd702e078fb-musl/356fad6ceb12428804ff3010eb5d77595b26288ae84277ce1fb6cc995fc531f4/9.4.7/doc/OneTuple-0.4.1.1 --dependency=base=base-4.17.2.0 --dependency=ghc-prim=ghc-prim-0.9.1 --dependency=template-haskell=template-haskell-2.19.0.0 --exact-configuration --ghc-option=-fhide-source-paths
   Process exited with
   code: ExitFailure (-11)
</p>
</details> 

Update image to GHC 9.0.2

Since 2022-01-10, Stackage nightly has switched from GHC 9.0.1 to 9.0.2. Because of this, ghc-musl builds with Stack are capped to nightly-2022-01-06, the last version using GHC 9.0.1.

Add sdl2 and sdl2-ttf to the docker images?

Hi! This an amazing setup. A single instruction and I can compile my program statically, even using various library versions that my old Ubuntu can no longer support. Would it be possible to add sdl2 and sdl2-ttf libraries to future versions of the images? Thank you!

adding pcre

pcre-light has a few reverse dependencies (in particular lens-regex-pcre), so it would be nice if pcre was part of the containers.

Thanks for this very useful project!

Building with stack fails with "Executable named groupadd not found on path" error

Hi! Thank you for making this.

I've been trying to build my project hablog using the stack method as described in the readme:

Add ghc-options: -static -optl-static -optl-pthread -fPIC flags to the executable section of your cabal file and these lines to your stack.yaml, and use stack as usual on the host machine:

docker:
enable: true
image: utdemir/ghc-musl:v15-ghc884

But after running stack build I've got the following error:

Executable named groupadd not found on path: ["/opt/host/bin","/home/soupi/hablog/.stack-work/docker/_home/.local/bin","/usr/local/.ghcup/bin","/usr/local/sbin","/usr/local/bin","/usr/sbin","/usr/bin","/sbin","/bin"]

I'm using stack v2.3.3 and lts-16.15.

Any idea what the issue might be?

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.