<div dir="ltr">I filed a bug: <a href="https://github.com/haskell/cabal/issues/2213">https://github.com/haskell/cabal/issues/2213</a> <div>Someone commented that it should basically work.</div><div><br></div><div>I’m trying to track down exactly where it goes wrong for me. There’s a problem in the way "cabal exec” interacts with the ghc-ios script.</div><div><br></div><div>If I run…</div><div><br></div><div><div>ghc-ios -v3 test.hs</div><div>Glasgow Haskell Compiler, Version 7.8.3, stage 1 booted by GHC version 7.8.2</div><div>Using binary package database: /usr/local/lib/arm-apple-darwin10-ghc-7.8.3/package.conf.d/package.cache</div><div>Using binary package database: /Users/axis/.ghc/arm-ios-7.8.3/package.conf.d/package.cache</div></div><div><br></div><div>It correctly finds the package database.</div><div><br></div><div>But if I run…</div><div><br></div><div><div>cabal exec ghc-ios -- -v3 test.hs</div><div>Glasgow Haskell Compiler, Version 7.8.3, stage 1 booted by GHC version 7.8.2</div><div>Using binary package database: /usr/local/lib/ghc-7.8.3/package.conf.d/package.cache</div><div>Using binary package database: /Users/axis/sandbox/.cabal-sandbox/x86_64-osx-ghc-7.8.3-packages.conf.d/package.cache</div></div><div><br></div><div>It correctly uses the sandbox, but not the arm ghc.</div><div><br></div><div>I looked into /usr/local/bin/arm-apple-darwin10-ghc, which does the following:</div><div><br></div><div><div> #!/bin/sh</div><div> exedir="/usr/local/lib/arm-apple-darwin10-ghc-7.8.3/bin"</div><div> exeprog="ghc-stage1"</div><div> executablename="$exedir/$exeprog"</div><div> datadir="/usr/local/share"</div><div> bindir="/usr/local/bin"</div><div> topdir="/usr/local/lib/arm-apple-darwin10-ghc-7.8.3"</div><div> executablename="$exedir/ghc"</div><div> exec "$executablename" -B"$topdir" ${1+"$@“}</div></div><div><br></div><div>I’m not sure what’s going on at the end (what is the -B flag?), but somehow that topdir variable doesn’t make it through the sandbox call.</div><div><br></div><div>Thanks for your help.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Oct 15, 2014 at 9:30 PM, Axis Sivitz <span dir="ltr"><<a href="mailto:axis@asivitz.com" target="_blank">axis@asivitz.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Oh, I think you’re right, it wasn’t actually installing correctly. I will file a bug with cabal.<div><br></div><div>Thanks</div></div><div class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">On Wed, Oct 15, 2014 at 6:58 PM, Luke Iannini <span dir="ltr"><<a href="mailto:lukexipd@gmail.com" target="_blank">lukexipd@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Axis,<div><br></div><div>I'm looking at my notes from my (brief) attempt to try sandboxes with ghc-ios, and it looks like one major issue is that the --builddir flag isn't paid attention to when installing into a sandbox, thus the object files from different architectures get mixed up. That will likely need a patch to cabal (I don't think many of the cabal devs are using multiple architectures/cross compilation) — filing a bug would be great.</div><div><br></div><div>Best</div><div>Luke</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Wed, Oct 15, 2014 at 1:57 PM, Axis Sivitz <span dir="ltr"><<a href="mailto:axis@asivitz.com" target="_blank">axis@asivitz.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr"><span style="font-family:arial,sans-serif;font-size:13px">Is anyone using ghc-ios with cabal sandbox? I am having trouble with it.</span><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">I can 'cabal-ios install’ fine. That installs the packages properly in the sandbox for arm and x86.</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">But the ghc-ios script doesn’t use the sandbox environment. And running a simple 'cabal exec ghc-ios …’ clobbers the package-db path:</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">I get...</div><div style="font-family:arial,sans-serif;font-size:13px">"Using binary package database: /…/sandbox/x86_64-osx-ghc-7.8.3-packages.conf.d/package.cache”<br></div><div style="font-family:arial,sans-serif;font-size:13px">and then a bunch of errors like:</div><div style="font-family:arial,sans-serif;font-size:13px"><div>Bad interface file: /usr/local/lib/ghc-7.8.3/base-4.7.0.1/Prelude.hi</div><div>        magic number mismatch: old/corrupt interface file? (wanted 129742, got 33214052)</div></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">I guess the best solution is for cabal’s exec command to respect the arguments that cabal-ios provides. But maybe in the meantime perhaps I can tweak the ghc-ios script to add an argument to look for the presence of sandboxing, unless anyone else has a better idea.</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Thanks,</div><div style="font-family:arial,sans-serif;font-size:13px">Axis</div></div>
<br></div></div>_______________________________________________<br>
iPhone mailing list<br>
<a href="mailto:iPhone@haskell.org" target="_blank">iPhone@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/iphone" target="_blank">http://www.haskell.org/mailman/listinfo/iphone</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br><br clear="all"><div><br></div></div></div><span class="HOEnZb"><font color="#888888">-- <br><div dir="ltr"><div>Axis Sivitz</div><div><a href="http://buttonbrigade.com/" target="_blank">http://asivitz.com</a></div><div><a href="tel:%28513%29%20535-1668" value="+15135351668" target="_blank">(513) 535-1668</a></div></div>
</font></span></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div>Axis Sivitz</div><div><a href="http://buttonbrigade.com/" target="_blank">http://asivitz.com</a></div><div>(513) 535-1668</div></div></div>
</div>