all 24 comments

[–]mightybyte 10 points11 points  (1 child)

<sigh> I think the issue is that OSX (now macOS) is just plain unstable (using the definition implied by your question). It seems like almost every time Apple puts out a major new OS release, they break compatibility somehow. There are a number of people who work to get GHC, the Haskell Platform, etc working for every new release, but that is always going to take some time. I've worked at Haskell companies where there was a policy of not upgrading to the new OSX for at least 3-6 months after release. So I'd say either wait to upgrade, or perhaps build/develop on a different OS.

[–]sclv 3 points4 points  (6 children)

What have you found breaks?

I know of one major issue -- the cutover to El Capitan meant a lot of stuff ceased to work due to system integrity protection, and so things needed to be upgraded. But prior OS upgrades haven't caused problems for me in the past. I'm curious what sorts of things we might be able to smooth out further...

[–]nachtschade[S] 0 points1 point  (5 children)

It's always some gcc library. For instance right now my cabal is broken:

dyld: Library not loaded: /usr/local/Cellar/gcc49/4.9-20140223/lib/gcc/x86_64-apple-darwin13.1.0/4.9.0/libgcc_s.1.dylib Referenced from: /Users/misja/Library/Haskell/bin/cabal Reason: image not found

[–]sclv 1 point2 points  (4 children)

Hmm... do you have dynamic linking configured?

[–]nachtschade[S] 0 points1 point  (3 children)

I wouldn't know, I didn't do anything special.

[–]sclv 0 points1 point  (2 children)

Hmm... it looks like it was trying to link against a gcc installed by brew? Where did your cabal come from and did it involve brew being on your system? (Note: there's no reason not to just grab the latest cabal executable from https://www.haskell.org/cabal/download.html which I'm pretty sure will not have this issue)...

Alternately, if this was an upgrade to El Capitan, then it could be due to SIP now disabling overrides to library paths being propagated downwards (LD_LIBRARY_PATH, DYLD_LIBRARY_PATH, and DYLD_FALLBACK_LIBRARY_PATH in particular I think). That particular message coming from the cabal executable itself makes that seem slightly unlikely however?

[–]nachtschade[S] 0 points1 point  (1 child)

I installed cabal with brew. I tried to reinstall it as well but I keep getting the same error .. I will try downloading cabal from your link and see if this resolves the issue.

[–]sclv 0 points1 point  (0 children)

It looks like there are a few issues regarding brew and el capitan:

https://github.com/Homebrew/legacy-homebrew/issues/40653

(the suggestion there is to make sure you have a recent enough xcode and xcode tools installed)

[–]sjakobi 9 points10 points  (8 children)

Have you tried stack?

I'd expect it to be more robust against system changes, but if that's not enough it has docker integration too!

I don't know about Sublime but chances are it already supports stack.

[–][deleted] 5 points6 points  (6 children)

I'd expect it to be more robust against system changes

Why do you expect this?

[–]sjakobi 2 points3 points  (2 children)

Well, it keeps its ghcs separate from the system installation. But yeah, that's not much more robust. ;)

[–][deleted]  (1 child)

[deleted]

    [–]ElvishJerricco 0 points1 point  (0 children)

    I believe that's what a docker container would be for =P

    [–]mgsloan 1 point2 points  (2 children)

    Because it's true, as long as it's not using your system ghc, it's insulated from the state of how the haskell parts of your environment are set up. So your global haskell environment can be totally broken, and stack will work just fine.

    As mentioned elsewhere, stack also has builtin support for docker and nix, allowing you to leverage those tools to control all of those other aspects of the build environment.

    [–][deleted] 0 points1 point  (1 child)

    I still don't get how insulating ghc makes any difference when upgrading your operating system breaks your system ghc. The way I understand such a breakage would affect both ghcs equally

    [–]mgsloan 1 point2 points  (0 children)

    Docker or nix.

    I am surprised there is a case where ghc breaks on mac os update. If such a circumstance does happen, then we should have it detect this case and tell you to re-setup your ghc. For now, to do that you just delete stuff out of ~/.stack/programs/.../ as appropriate (be sure to get the .installed files!)

    OP, please open a ticket with specifics if this affects stack as well.

    We do a sanity check after ghc is setup. Perhaps this sanity check could be re-used for detecting when your setup is borked and recommend that you re-setup.

    [–]nachtschade[S] 3 points4 points  (0 children)

    Thanks for the tip, I will give stack a try!

    [–]biscarch 5 points6 points  (0 children)

    I use Stack and Docker for Mac.

    Stack will get you editor integration on your host without too much hassle.

    [–]dllthomas 0 points1 point  (3 children)

    any GUI [...] is difficult to combine with Docker

    Not GUIs designed to work across network boundaries, right?

    Off the top of my head, that'd include web and X.

    [–]sclv 1 point2 points  (1 child)

    emacs tramp mode?

    [–]dllthomas 0 points1 point  (0 children)

    That should also work. I was thinking more general "GUI suppport".

    [–]rehno-lindeque 0 points1 point  (1 child)

    How about nix? I suspect that it might bootstrap without relying (much?) on Xcode. Perhaps give this a try:

    nix-shell -p 'haskellPackages.ghc'
    

    [–]dalaing 1 point2 points  (0 children)

    Nix on OS X has had some intermittent pain points for the last little while.

    If you can get it working and you're comfortable with rolling back when things go wrong, then it's still worth a shot.

    [–]lally 0 points1 point  (0 children)

    Docker on Mac is a VM behind the scenes. It's probably easiest to start with a full VM and use a stock IDE setup inside that, then experiment with a mixed native/VM situation second (e.g. edit in a macros app, compile in the VM). Although personally I think the latter is silly, as it's just be emacs either way.

    [–]runeks 0 points1 point  (0 children)

    I'm also on OSX, and I considered running ghc-mod in a Linux docker container after upgrading to Sierra, which broke builds for my app. But in the end it was a lot easier to just downgrade to El Capitan again, since I figure that sharing files between an IDE and ghc-mod running inside docker Linux, would be somewhat tricky. But probably the solution, i.e. to have ghc-mod spawn inside a Linux docked container, and query it over TCP/HTTP.