I am trying to install Haskell Platform on a provisioned machine (puppet). The "box" I'll be using will have 512mb memory and is Ubuntu 12 64 bit. First I installed GHC 7.6.3 via the tarball (so configure and make install). That went fine.
After that puppet will download the Haskell platform 2013.2. It will also do configure and make install. But that will fail due the restricted amount of memory available;
Notice: /Stage[main]/Haskell::Platform/Exec[haskell platform install]/returns: scripts/build.sh
Notice: /Stage[main]/Haskell::Platform/Exec[haskell platform install]/returns: **************************************************
Notice: /Stage[main]/Haskell::Platform/Exec[haskell platform install]/returns: Scanning system for any installed Haskell Platform components...
Notice: /Stage[main]/Haskell::Platform/Exec[haskell platform install]/returns:
Notice: /Stage[main]/Haskell::Platform/Exec[haskell platform install]/returns: Found:
Notice: /Stage[main]/Haskell::Platform/Exec[haskell platform install]/returns: None.
Notice: /Stage[main]/Haskell::Platform/Exec[haskell platform install]/returns:
Notice: /Stage[main]/Haskell::Platform/Exec[haskell platform install]/returns: New packages to install:
Notice: /Stage[main]/Haskell::Platform/Exec[haskell platform install]/returns: HUnit-1.2.5.2 OpenGLRaw-1.3.0.0 GLURaw-1.3.0.0 OpenGL-2.8.0.0 GLUT-2.4.0.0 html-1.0.1.2 parallel-3.2.0.3 primitive-0.5.0.1 random-1.0.1.1 QuickCheck-2.6 alex-3.0.5 split-0.2.2 stm-2.4.2 async-2.0.1.4 syb-0.4.0 haskell-src-1.0.1.5 text-0.11.3.1 attoparsec-0.10.4.0 hashable-1.1.2.5 case-insensitive-1.0.0.1 transformers-0.3.0.0 mtl-2.1.2 fgl-5.4.2.4 happy-1.18.10 parsec-3.1.3 network-2.4.1.2 HTTP-4000.2.8 regex-base-0.93.2 regex-posix-0.95.2 regex-compat-0.95.1 unordered-containers-0.2.3.0 vector-0.10.0.1 xhtml-3000.2.1 cgi-3001.1.7.5 zlib-0.5.4.1 cabal-install-1.16.0.2 haskell-platform-2013.2.0.0
Notice: /Stage[main]/Haskell::Platform/Exec[haskell platform install]/returns:
Notice: /Stage[main]/Haskell::Platform/Exec[haskell platform install]/returns: **************************************************
Notice: /Stage[main]/Haskell::Platform/Exec[haskell platform install]/returns: Building HUnit-1.2.5.2
Notice: /Stage[main]/Haskell::Platform/Exec[haskell platform install]/returns: "/usr/local/bin/ghc" "--make" "Setup" "-o" "Setup" "-package" "Cabal-1.16.0"
Notice: /Stage[main]/Haskell::Platform/Exec[haskell platform install]/returns: Linking Setup ...
Notice: /Stage[main]/Haskell::Platform/Exec[haskell platform install]/returns: collect2: ld terminated with signal 9 [Killed]
Notice: /Stage[main]/Haskell::Platform/Exec[haskell platform install]/returns:
Notice: /Stage[main]/Haskell::Platform/Exec[haskell platform install]/returns: Error:
Notice: /Stage[main]/Haskell::Platform/Exec[haskell platform install]/returns: Compiling the Setup script failed
Notice: /Stage[main]/Haskell::Platform/Exec[haskell platform install]/returns: make: *** [build.stamp] Error 2
So I googled: "collect2: ld terminated with signal 9 [Killed]" and came to the conclusion it was a memory problem (Why is the linker terminating on me? when i build CLang). No problem if you will provision with Vagrant. I upped the available memory to 2GB and the install went FINE
However I want to deploy it to digital ocean where you'll have a restricted amount of memory available aswell. To solve this issue you can also create or increase the size of a swap file. So I made a swap file of 4GB. And ran provisioning again. This fails with the same error as before:
collect2: ld terminated with signal 9 [Killed]
I am using a puppet script to create the swap file: https://gist.github.com/philfreo/6576492
I've verified the creation of the file and it is there.
What am I missing?