IntersectMBO / bech32

Haskell implementation of the Bech32 address format (BIP 0173).
Apache License 2.0
44 stars 13 forks source link

Fix stack builds in CI #36

Closed newhoggy closed 3 years ago

newhoggy commented 3 years ago

(edited by @rvl)

We found that stack builds stopped working in CI. The builds were failing due to linker errors. Cabal builds worked, but it turns out this was because the Cabal build in CI did not enable -frelease. The release build adds -static to the GHC options (quite important for releasing useful binaries).

It was working before and then stopped working because the GitHub actions workflow specified ubuntu-latest as the build environment. The problems started when GitHub updated their Ubuntu images from 18.04 to 20.04.

We could just downgrade to Ubuntu 18.04, but that's really old version, and our builds ought to work on recent distribution releases.

The solution is probably to add some extra linker flags or libraries, or something.

Thanks @newhoggy for reporting it in #34.

When this is fixed, we can make a Hackage release and get bech32 back into Stackage LTS (see commercialhaskell/stackage/issues/5432 and #31).

rvl commented 3 years ago

Oh this is a pain in the bum...

The Cabal build is working because it doesn't enable the bech32:release flag. That flag adds -static to the build command line. This is needed, otherwise the released binaries are dynamically linked, which limits their usefulness. The static build has started to fail for some reason... something in the build environment changed.

rvl commented 3 years ago

@newhoggy - I have given up on the static build and removed it from the -frelease Cabal flag.