miso icon indicating copy to clipboard operation
miso copied to clipboard

Build error in macOS 11

Open tkx68 opened this issue 3 years ago • 11 comments

Describe the bug I get the following build error after following the getting started instructions:

tkx@Torstens-MBP-3 [18:28:27] [~/devel/miso/sample-app] [master]
-> % nix-build 
these derivations will be built:
  /nix/store/h0s3aagn5ry0c8i21c82zkk07rnf0zgd-miso-1.6.0.0.drv
  /nix/store/4afismzhx4arim5mk95rm3kydbl9cps5-app-0.1.0.0.drv
building '/nix/store/h0s3aagn5ry0c8i21c82zkk07rnf0zgd-miso-1.6.0.0.drv'...
setupCompilerEnvironmentPhase
Build with /nix/store/938hj0i46icly476hfdg7yic1j10xk65-ghcjs-8.6.0.1.
unpacking sources
unpacking source archive /nix/store/9v9cz7r5fi291n6y3ss7mm4phjfkhnjr-6rkh6h6n36kc035fd6gs99rp51c01rww-source
source root is 6rkh6h6n36kc035fd6gs99rp51c01rww-source
patching sources
compileBuildDriverPhase
setupCompileFlags: -package-db=/private/tmp/nix-build-miso-1.6.0.0.drv-0/setup-package.conf.d -j4 -threaded
[1 of 1] Compiling Main             ( Setup.hs, /private/tmp/nix-build-miso-1.6.0.0.drv-0/Main.o )
Linking Setup ...
ld: file not found: /usr/lib/system/libcache.dylib for architecture x86_64
clang-7: error: linker command failed with exit code 1 (use -v to see invocation)
`cc' failed in phase `Linker'. (Exit code: 1)
builder for '/nix/store/h0s3aagn5ry0c8i21c82zkk07rnf0zgd-miso-1.6.0.0.drv' failed with exit code 1
cannot build derivation '/nix/store/4afismzhx4arim5mk95rm3kydbl9cps5-app-0.1.0.0.drv': 1 dependencies couldn't be built
error: build of '/nix/store/4afismzhx4arim5mk95rm3kydbl9cps5-app-0.1.0.0.drv' failed

Desktop (please complete the following information):

  • OS: macOS 11.1
  • Browser NA
  • Version: current

tkx68 avatar Dec 19 '20 17:12 tkx68

@tkx68 I believe this to be a bug with nix and MacOS that indirectly affects miso. Will triage with the nixpkgs issue tracker to see what solutions they've come up with.

dmjio avatar Dec 24 '20 14:12 dmjio

Seems to be still an issue. Checking over at NixOS, it looks like they've "solved it", but I'm still not able to build either. Any news on this front?

elland avatar Feb 27 '21 09:02 elland

Also not working for me. I tried updating to the newest release in default.nix but same error.

yobson avatar Apr 17 '21 19:04 yobson

I'm having the same error

nicu-chiciuc avatar May 18 '21 07:05 nicu-chiciuc

This is fixed by https://github.com/NixOS/nixpkgs/pull/98541/, which is included in the latest stable release, 21.05. So Miso needs to bump its Nixpkgs version.

georgefst avatar Jul 16 '21 09:07 georgefst

@georgefst I would upgrade, but they've removed ghcjs from nixpkgs for some reason.

nix-repl> lib.version
"21.11pre302194.91ffffd9040"

nix-repl> haskell.compiler.      
haskell.compiler.ghc8102Binary         haskell.compiler.ghc884                haskell.compiler.native-bignum
haskell.compiler.ghc8102BinaryMinimal  haskell.compiler.ghc901
haskell.compiler.ghc8104               haskell.compiler.ghcHEAD
haskell.compiler.ghc865Binary          haskell.compiler.integer-simple

dmjio avatar Jul 16 '21 21:07 dmjio

Ah, that's a pretty big issue. @cdepillabout, any idea why that is?

georgefst avatar Jul 17 '21 09:07 georgefst

they've removed ghcjs from nixpkgs for some reason

I can't find where we originally had this discussion, but if I remember correctly, ghcjs stopped building in nixpkgs at some point. None of the maintainers on the Haskell team in Nixpkgs use ghcjs or know anything about it, so we just left it broken (or possibly just completely removed it). There are also no users that actively send fixes

If you (or anyone else) is interested in ghcjs being available in Nixpkgs, we'd almost certainly accept PRs getting it working again. Especially if you're willing to become a maintainer for it and fix it whenever it breaks. We would of course be willing to help you with any Nix/Nixpkgs-related questions you had.

cdepillabout avatar Jul 17 '21 10:07 cdepillabout

None of the maintainers on the Haskell team in Nixpkgs use ghcjs or know anything about it

@Sonarpulse used to maintain it, I believe, and I know a lot of folks at Obsidian use GHCJS still. I have maintained GHCs on nixpkgs before, like HaLVM, but it was also removed for some reason.

It seems all development has gone towards https://github.com/input-output-hk/haskell.nix, IOHK is a huge contributor to nixpkgs and they actively maintain GHCJS, and fund its development.

cc @cdepillabout

dmjio avatar Jul 17 '21 17:07 dmjio

Anyone got any progress here?

GHCJS not being in Nixpkgs is a huge issue for Miso, given that it's the recommended installation method.

georgefst avatar Mar 14 '22 11:03 georgefst

GHCJS was recently added back to Nixpkgs by Obsidian: https://github.com/NixOS/nixpkgs/pull/137066

There are a few other related PRs since that one if you search for GHCJS: https://github.com/NixOS/nixpkgs/pulls?q=is%3Apr+label%3A%226.topic%3A+haskell%22+ghcjs+is%3Aclosed

cdepillabout avatar Mar 14 '22 13:03 cdepillabout