From hlmerscher at gmail.com Thu Jul 11 21:14:32 2024 From: hlmerscher at gmail.com (Hercules Merscher) Date: Thu, 11 Jul 2024 23:14:32 +0200 Subject: [Haskell-beginners] Compiling project errors within a docker container Message-ID: Hello folks, I've been developing a small side project (a small web app). I'm developing on a Macbook M1 Pro, however, I need to compile it to test against a linux/amd64 environment. I'm trying to use docker for that. I know it is emulated via VM in this case and performance will suffer, but it's not a big deal for me since it's just a toy project. I'm using stack as build tool and GHC 9.6. The `stack build --fast` command errors, hinting that it could be out of memory. ``` root at c5f07dbd83dc:/opt/app# stack build --fast -j 4 --allow-different-user ... Error: [S-7282] Stack failed to execute the build plan. While executing the build plan, Stack encountered the error: [S-7011] While building package rinha-0.1.0.0 (scroll up to its section to see the error) using: /root/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_6HauvNHV_3.10.3.0_ghc-9.6.5 --verbose=1 --builddir=.stack-work/dist/x86_64-linux/ghc-9.6.5 build lib:rinha exe:rinha-exe --ghc-options " -fdiagnostics-color=always" Process exited with code: ExitFailure (-9) (THIS MAY INDICATE OUT OF MEMORY) ``` Initially, I thought it really could be out of memory as I'm using colima and had default configuration. Then I started colima giving it 4 CPUs and 16GiB memory: ``` $ colima start --cpu 4 --memory 16 -a x86_64 -t vz --vz-rosetta ``` The project starts building, stays like that for almost 1h, and then this error happens. I wouldn't like to spin up a server just to build a project that I will be running on my laptop, but I see myself without alternatives and I'm finding it weird since I never had such a problem with other languages and it's the first time I see it while doing some Haskell. Any tips? Best, Hercules -------------- next part -------------- An HTML attachment was scrubbed... URL: From gale at sefer.org Sun Jul 14 10:33:39 2024 From: gale at sefer.org (Yitzchak Gale) Date: Sun, 14 Jul 2024 13:33:39 +0300 Subject: [Haskell-beginners] Compiling project errors within a dockercontainer In-Reply-To: References: Message-ID: <04f14adc-d2b2-453c-b17c-cf6463c834d7@app.fastmail.com> I'm using Lima directly (not via Colima) without any issues. Is it important for you to do this inside a docker? Does your project build OK natively on the Mac? On Fri, Jul 12, 2024, at 12:14 AM, Hercules Merscher wrote: > Hello folks, > > I've been developing a small side project (a small web app). I'm developing on a Macbook M1 Pro, however, I need to compile it to test against a linux/amd64 environment. I'm trying to use docker for that. I know it is emulated via VM in this case and performance will suffer, but it's not a big deal for me since it's just a toy project. > > I'm using stack as build tool and GHC 9.6. > > The `stack build --fast` command errors, hinting that it could be out of memory. > > ``` > root at c5f07dbd83dc:/opt/app# stack build --fast -j 4 --allow-different-user > ... > Error: [S-7282] > Stack failed to execute the build plan. > > While executing the build plan, Stack encountered the error: > > [S-7011] > While building package rinha-0.1.0.0 (scroll up to its section to see the error) using: > /root/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_6HauvNHV_3.10.3.0_ghc-9.6.5 --verbose=1 --builddir=.stack-work/dist/x86_64-linux/ghc-9.6.5 build lib:rinha exe:rinha-exe --ghc-options " -fdiagnostics-color=always" > Process exited with code: ExitFailure (-9) (THIS MAY INDICATE OUT OF MEMORY) > ``` > > Initially, I thought it really could be out of memory as I'm using colima and had default configuration. Then I started colima giving it 4 CPUs and 16GiB memory: > > ``` > $ colima start --cpu 4 --memory 16 -a x86_64 -t vz --vz-rosetta > ``` > > The project starts building, stays like that for almost 1h, and then this error happens. > > I wouldn't like to spin up a server just to build a project that I will be running on my laptop, but I see myself without alternatives and I'm finding it weird since I never had such a problem with other languages and it's the first time I see it while doing some Haskell. > > Any tips? > > Best, > Hercules > _______________________________________________ > Beginners mailing list > Beginners at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hlmerscher at gmail.com Sun Jul 14 21:00:49 2024 From: hlmerscher at gmail.com (Hercules Merscher) Date: Sun, 14 Jul 2024 23:00:49 +0200 Subject: [Haskell-beginners] Compiling project errors within a dockercontainer In-Reply-To: <04f14adc-d2b2-453c-b17c-cf6463c834d7@app.fastmail.com> References: <04f14adc-d2b2-453c-b17c-cf6463c834d7@app.fastmail.com> Message-ID: Em dom., 14 de jul. de 2024 às 12:34, Yitzchak Gale escreveu: > I'm using Lima directly (not via Colima) without any issues. Is it > important for you to do this inside a docker? > > Does your project build OK natively on the Mac? > Yes, I'm developing on a Mac M1 and it builds super fast without problems. So, your message made me remove one level of abstraction to give it a try with lima instead of colima... and it worked! I ran `limactl start template://docker --arch x86_64` and did a `docker-compose build` and all went well. Thanks, everybody! :) > > On Fri, Jul 12, 2024, at 12:14 AM, Hercules Merscher wrote: > > Hello folks, > > I've been developing a small side project (a small web app). I'm > developing on a Macbook M1 Pro, however, I need to compile it to test > against a linux/amd64 environment. I'm trying to use docker for that. I > know it is emulated via VM in this case and performance will suffer, but > it's not a big deal for me since it's just a toy project. > > I'm using stack as build tool and GHC 9.6. > > The `stack build --fast` command errors, hinting that it could be out of > memory. > > ``` > root at c5f07dbd83dc:/opt/app# stack build --fast -j 4 --allow-different-user > ... > Error: [S-7282] > Stack failed to execute the build plan. > > While executing the build plan, Stack encountered the error: > > [S-7011] > While building package rinha-0.1.0.0 (scroll up to its section to > see the error) using: > > /root/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_6HauvNHV_3.10.3.0_ghc-9.6.5 > --verbose=1 --builddir=.stack-work/dist/x86_64-linux/ghc-9.6.5 build > lib:rinha exe:rinha-exe --ghc-options " -fdiagnostics-color=always" > Process exited with code: ExitFailure (-9) (THIS MAY INDICATE OUT > OF MEMORY) > ``` > > Initially, I thought it really could be out of memory as I'm using colima > and had default configuration. Then I started colima giving it 4 CPUs and > 16GiB memory: > > ``` > $ colima start --cpu 4 --memory 16 -a x86_64 -t vz --vz-rosetta > ``` > > The project starts building, stays like that for almost 1h, and then this > error happens. > > I wouldn't like to spin up a server just to build a project that I will be > running on my laptop, but I see myself without alternatives and I'm finding > it weird since I never had such a problem with other languages and it's the > first time I see it while doing some Haskell. > > Any tips? > > Best, > Hercules > _______________________________________________ > Beginners mailing list > Beginners at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners > > _______________________________________________ > Beginners mailing list > Beginners at haskell.org > http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners > -------------- next part -------------- An HTML attachment was scrubbed... URL: