Failed to build HsOpenSSL- when building Cardano node

Hi all,

I’m having trouble building a Cardano node on my Ubuntu machine following this guide

After following all the steps from the guide i’m stuck at buildig the Cardano node with:
cabal build cardano-node cardano-cli

Here is the Full terminal code

Below a part of the terminal code where the problem occurs:

Failed to build HsOpenSSL-
Build log (
[1 of 1] Compiling Main             ( /home/cardano1234/git/cardano-node/dist-newstyle/tmp/src-24485/HsOpenSSL-, /home/cardano1234/git/cardano-node/dist-newstyle/tmp/src-24485/HsOpenSSL- )
Linking /home/cardano1234/git/cardano-node/dist-newstyle/tmp/src-24485/HsOpenSSL- ...
Configuring HsOpenSSL-
Preprocessing library for HsOpenSSL-
Building library for HsOpenSSL-
[ 1 of 33] Compiling OpenSSL          ( OpenSSL.hs, dist/build/OpenSSL.o, dist/build/OpenSSL.dyn_o )
[ 2 of 33] Compiling OpenSSL.DH.Internal ( OpenSSL/DH/Internal.hs, dist/build/OpenSSL/DH/Internal.o, dist/build/OpenSSL/DH/Internal.dyn_o )
[ 3 of 33] Compiling OpenSSL.ERR      ( OpenSSL/ERR.hs, dist/build/OpenSSL/ERR.o, dist/build/OpenSSL/ERR.dyn_o )
[ 4 of 33] Compiling OpenSSL.EVP.Base64 ( OpenSSL/EVP/Base64.hs, dist/build/OpenSSL/EVP/Base64.o, dist/build/OpenSSL/EVP/Base64.dyn_o )
[ 5 of 33] Compiling OpenSSL.Objects  ( dist/build/OpenSSL/Objects.hs, dist/build/OpenSSL/Objects.o, dist/build/OpenSSL/Objects.dyn_o )
[ 6 of 33] Compiling OpenSSL.SSL.Option ( dist/build/OpenSSL/SSL/Option.hs, dist/build/OpenSSL/SSL/Option.o, dist/build/OpenSSL/SSL/Option.dyn_o )
[ 7 of 33] Compiling OpenSSL.Stack    ( dist/build/OpenSSL/Stack.hs, dist/build/OpenSSL/Stack.o, dist/build/OpenSSL/Stack.dyn_o )  


`gcc' failed in phase `C Compiler'. (Exit code: 1)
cabal: Failed to build HsOpenSSL- (which is required by
test:cardano-node-test from cardano-node-1.35.4, exe:cardano-node from
cardano-node-1.35.4 and others). See the build log above for details.

I’m using

  • Ubuntu Linux 20.04.5
  • Cardano node 1.35.4
  • GHC 8.10.7
  • Cabal

I tried to install a lower version for Haskell HsOpenSSL (version instead of after reading this post from pullanswer => PullAnswer post

but with no luck.
Any ideas?

Have you done a fresh cabal update before trying to build again after installing the lower HsOpenSSL.

I also read somewhere that you can/should manually update the cabal.project before you build to be HsOpenSSL ==

Hi @jeremyisme,

I tried to change the HsOpenSSL version but ran into the following:

cardano1234@cardano1234-VirtualBox:~/git$ cabal install Cabal HsOpenSSL-
Resolving dependencies...
Build profile: -w ghc-8.10.7 -O1
In order, the following will be built (use -v for more details):
 - Cabal-syntax- (lib) (requires download & build)
 - process- (lib:process) (requires download & build)
 - hsc2hs-0.68.8 (exe:hsc2hs) (requires build)
 - Cabal- (lib) (requires download & build)
 - Cabal- (lib) (requires download & build)
 - network- (lib:network) (requires build)
 - HsOpenSSL- (lib:HsOpenSSL) (requires build)
Downloading  process-
Downloaded   process-
Downloading  Cabal-syntax-
Starting     process- (all, legacy fallback)
Downloaded   Cabal-syntax-
Downloading  Cabal-
Starting     Cabal-syntax- (lib)
Downloaded   Cabal-
Downloading  Cabal-
Building     Cabal-syntax- (lib)
Downloaded   Cabal-
Building     process- (all, legacy fallback)
Installing   process- (all, legacy fallback)
Completed    process- (all, legacy fallback)
Starting     hsc2hs-0.68.8 (exe:hsc2hs)
Starting     Cabal- (lib)
Building     hsc2hs-0.68.8 (exe:hsc2hs)
Building     Cabal- (lib)
Installing   hsc2hs-0.68.8 (exe:hsc2hs)
Completed    hsc2hs-0.68.8 (exe:hsc2hs)
Starting     network- (all, legacy fallback)
Building     network- (all, legacy fallback)
Installing   network- (all, legacy fallback)
Completed    network- (all, legacy fallback)
Installing   Cabal-syntax- (lib)
Completed    Cabal-syntax- (lib)
Starting     Cabal- (lib)
Building     Cabal- (lib)
Installing   Cabal- (lib)
Installing   Cabal- (lib)
Completed    Cabal- (lib)
Starting     HsOpenSSL- (all, legacy fallback)
Completed    Cabal- (lib)
Building     HsOpenSSL- (all, legacy fallback)
Installing   HsOpenSSL- (all, legacy fallback)
Completed    HsOpenSSL- (all, legacy fallback)
@ WARNING: Installation might not be completed as desired! @
The command "cabal install [TARGETS]" doesn't expose libraries.
* You might have wanted to add them as dependencies to your package. In this
case add "Cabal, Cabal, HsOpenSSL" to the build-depends field(s) of your
package's .cabal file.
* You might have wanted to add them to a GHC environment. In this case use
"cabal install --lib Cabal Cabal HsOpenSSL". The "--lib" flag is provisional:
see for more information.

Not sure how to force the version upon Cabal.


I’ve often found it is good to start again with builds sometimes, as you can often end up with orphaned, or incorrect build projects.

Work through the steps here

Making sure you’ve got a clean/new folder for cardano-node2 (or whatever you want to call it). The cabal update command later on will update cabal for your build.

I would make sure you check the cabal.project file before you move to the actually build command.

U can try my guide but before make a fresh installation on server


I’ve done hours of troubleshooting on this, together with someone from IOG. Change
, HSOpenSSL >=
, HsOpenSSL ==
in the cabal.project file if you have this problem.
pay attention to the capital S in the original line and non-capital s in the changed line.
It will work after that.

1 Like

Thanks all for the help.

The solution from @georgem1976 solved my problem.
Nice tutorial @Alexd1985.

1 Like