reflex-frp / reflex-platform

A curated package set and set of tools that let you build Haskell packages so they can run on a variety of platforms. reflex-platform is built on top of the nix package manager.
https://reflex-frp.org
BSD 3-Clause "New" or "Revised" License
720 stars 164 forks source link

OSX ./try-reflex fails with dyld not found #309

Closed cah6 closed 5 years ago

cah6 commented 6 years ago

Unsure if this is a config issue on my end, anyhow the full response is:

$ ./try-reflex
If you have any trouble with this script, please submit an issue at https://github.com/reflex-frp/reflex-platform/issues
Entering the reflex sandbox...
building '/nix/store/1km0ahqx2xrk4hkh7l9n7gc223lb8d3j-stage1Packages.drv'...
dyld: Symbol not found: _containerszm0zi5zi7zi1_DataziSetziBase_zdwzdcp1Data_closure
  Referenced from: /nix/store/bjslr8l2wddlyc85xw19jk08gjik17wx-ghcjs-0.2.0/lib/ghc-8.0.2/x86_64-osx-ghc-8.0.2/libHSghcjs-0.2.1-ArOyRzZQt3EIHrXqYO2Mr1-ghc8.0.2.dylib
  Expected in: /nix/store/bjslr8l2wddlyc85xw19jk08gjik17wx-ghcjs-0.2.0/lib/links/libHScontainers-0.5.7.1-ghc8.0.2.dylib
 in /nix/store/bjslr8l2wddlyc85xw19jk08gjik17wx-ghcjs-0.2.0/lib/ghc-8.0.2/x86_64-osx-ghc-8.0.2/libHSghcjs-0.2.1-ArOyRzZQt3EIHrXqYO2Mr1-ghc8.0.2.dylib
/private/tmp/nix-build-stage1Packages.drv-0/.attr-0: line 1: 13413 Abort trap: 6           ghcjs-pkg list
     13414 Done                    | sed -n 's/^    \(..*\)-\([0-9.]*\)$/\1/ p' > $out
builder for '/nix/store/1km0ahqx2xrk4hkh7l9n7gc223lb8d3j-stage1Packages.drv' failed with exit code 134
error: build of '/nix/store/1km0ahqx2xrk4hkh7l9n7gc223lb8d3j-stage1Packages.drv' failed
(use '--show-trace' to show detailed location information)

Enabling --show-trace doesn't seem to do anything, and it looks like my nix.conf is correct:

build-users-group = nixbld

max-jobs = 32
cores = 1
sandbox = false
substituters = https://cache.nixos.org https://nixcache.reflex-frp.org
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= ryantrinkle.com-1:JJiAKaRv9mWgpVAz8dwewnZe0AzzEAzPkagE9SP5NWI=binary-caches = https://cache.nixos.org https://nixcache.reflex-frp.org
binary-cache-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= ryantrinkle.com-1:JJiAKaRv9mWgpVAz8dwewnZe0AzzEAzPkagE9SP5NWI=
binary-caches-parallel-connections = 40

Let me know if I can do anything to help!

ryantrinkle commented 6 years ago

This looks like a situation that can arise when some derivations are retrieved from cache, but others are not. Can you try running nix-collect-garbage, and then running try-reflex again?

cah6 commented 6 years ago

Hmm that made it re-build/fetch lots of stuff but ended up failing with the same error.

alexfmpe commented 6 years ago

Maybe a stricter "clean" is needed? It seems to be the same error as https://github.com/reflex-frp/reflex-platform/issues/300.

I tried that, and it worked! I ended up running some combination of nix-collect-garbage, nix-store --gc, and nix-env --delete-generations.

cah6 commented 6 years ago

Tried all of those (and also just deleted my ~/.ghc and ~/.ghc-mod dirs) but ended with same thing. I'll see if there's various other forms of cleaning I can do later...

ryantrinkle commented 6 years ago

@cah6 Really sorry to hear that! This is a very unfortunate bug stemming from some nondeterminism in GHC combined with the nondeterminism of how Nix gets things from caches.

Do you have anything in reflex-platform/gc-roots? If so, maybe try deleting that directory and then re-running nix-collect-garbage.

cah6 commented 6 years ago

Nope, nothing in there but the README. Btw I really appreciate all the quick responses on this issue! Maybe it's time to set up a NixOS computer 😄

alexfmpe commented 6 years ago

I'm not familiar with the cause but maybe it would be possible to force some source builds to "fill in the gaps" and get to a point where cache fetches will work again? @ryantrinkle

ryantrinkle commented 6 years ago

@alexfmpe I think it's the opposite - we have to get rid of whatever has been built from source, so that the cache can be the source for everything.

ali-abrar commented 5 years ago

Looks like this is working on OSX nowadays. Closing this for now. Please re-open if you're still encountering this.