Skip to content

Cocoa Cannot Load On Mac OS Using GHC

Summary

I cannot install anything on Mac OS Big Sur that somehow requires Cocoa. I am unsure why these things even require Cocoa because they're not in the source code for the project. I even try to link it and fix it but it can't find it at all and I can't tell if this is my problem or GHCs.

Steps to reproduce

cabal install diagrams --lib --ghc --ghc-options "-framework Cocoa"

[ 7 of 12] Compiling Geom2D.CubicBezier.Overlap ( Geom2D/CubicBezier/Overlap.lhs, dist/build/Geom2D/CubicBezier/Overlap.o )
<command line>: user specified .o/.so/.DLL could not be loaded (not found)
Whilst trying to load:  (framework) Cocoa
Additional directories searched: (none)

Failed to build linear-1.21.3.
Build log ( /Users/sauce/.cabal/logs/ghc-8.8.4/lnr-1.21.3-9577be3f.log ):
[1 of 1] Compiling Main             ( /var/folders/_r/hh821zbj42lfldrz_3dzpncc0000gn/T/cabal-install.-28494/dist-newstyle/tmp/src-28496/linear-1.21.3/dist/setup/setup.hs, /var/folders/_r/hh821zbj42lfldrz_3dzpncc0000gn/T/cabal-install.-28494/dist-newstyle/tmp/src-28496/linear-1.21.3/dist/setup/Main.o )
Linking /var/folders/_r/hh821zbj42lfldrz_3dzpncc0000gn/T/cabal-install.-28494/dist-newstyle/tmp/src-28496/linear-1.21.3/dist/setup/setup ...
Configuring linear-1.21.3...
Preprocessing library for linear-1.21.3..
Building library for linear-1.21.3..
[ 1 of 22] Compiling Linear.Binary    ( src/Linear/Binary.hs, dist/build/Linear/Binary.o )
[ 2 of 22] Compiling Linear.Conjugate ( src/Linear/Conjugate.hs, dist/build/Linear/Conjugate.o )
[ 3 of 22] Compiling Linear.Epsilon   ( src/Linear/Epsilon.hs, dist/build/Linear/Epsilon.o )
[ 4 of 22] Compiling Linear.Instances ( src/Linear/Instances.hs, dist/build/Linear/Instances.o )
[ 5 of 22] Compiling Linear.Vector    ( src/Linear/Vector.hs, dist/build/Linear/Vector.o )
<command line>: user specified .o/.so/.DLL could not be loaded (not found)
Whilst trying to load:  (framework) Cocoa
Additional directories searched: (none)
cabal: Failed to build JuicyPixels-3.3.5 (which is required by diagrams-1.4).
See the build log above for details.
Failed to build cubicbezier-0.6.0.6 (which is required by diagrams-1.4). See
the build log above for details.
Failed to build linear-1.21.3 (which is required by diagrams-1.4). See the
build log above for details.

Expected behavior

Install and Build Diagrams

Environment

  • GHC version used: 8.8.4

Optional:

  • Operating System: Mac OS Big Sur
  • System Architecture: Intel
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information