Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ormolu segfaults on M1 mac #10

Open
goodlyrottenapple opened this issue Dec 27, 2022 · 3 comments
Open

Ormolu segfaults on M1 mac #10

goodlyrottenapple opened this issue Dec 27, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@goodlyrottenapple
Copy link
Contributor

Trying to enter the dev shell via nix develop on an M1 Mac segfaults with a clang linker segfault building ormolu:

➜  inferno git:(main) nix develop
warning: Using saved setting for 'extra-substituters = https://cache.iog.io' from ~/.local/share/nix/trusted-settings.json.
warning: Using saved setting for 'extra-trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=' from ~/.local/share/nix/trusted-settings.json.
error: builder for '/nix/store/a00q1phmpqq1bd9d9l256lafjqgks69f-ormolu-exe-ormolu-0.5.0.1.drv' failed with exit code 1;
       last 10 log lines:
       > Configuring executable 'ormolu' for ormolu-0.5.0.1..
       > building
       > Preprocessing executable 'ormolu' for ormolu-0.5.0.1..
       > Building executable 'ormolu' for ormolu-0.5.0.1..
       > [1 of 2] Compiling Paths_ormolu     ( dist/build/ormolu/autogen/Paths_ormolu.hs, dist/build/ormolu/ormolu-tmp/Paths_ormolu.o, dist/build/ormolu/ormolu-tmp/Paths_ormolu.dyn_o )
       > [2 of 2] Compiling Main             ( app/Main.hs, dist/build/ormolu/ormolu-tmp/Main.o, dist/build/ormolu/ormolu-tmp/Main.dyn_o )
       > Linking dist/build/ormolu/ormolu ...
       > /nix/store/48py6zrawzim9ghrnkqwm36jl4j1l23x-clang-wrapper-11.1.0/bin/ld: line 256: 56158 Segmentation fault: 11  /nix/store/5wvlj00dr22ivh210b18ccv1i60h6c1q-cctools-binutils-darwin-949.0.1/bin/ld ${extraBefore+"${extraBefore[@]}"} ${params+"${params[@]}"} ${extraAfter+"${extraAfter[@]}"}
       > clang-11: error: linker command failed with exit code 139 (use -v to see invocation)
       > `clang' failed in phase `Linker'. (Exit code: 139)
       For full logs, run 'nix log /nix/store/a00q1phmpqq1bd9d9l256lafjqgks69f-ormolu-exe-ormolu-0.5.0.1.drv'.
error: 1 dependencies of derivation '/nix/store/70cjpq6acb0zgvrjw89g8zyidy6lhwjn-ghc-shell-for-packages-env.drv' failed to build
@goodlyrottenapple goodlyrottenapple added the bug Something isn't working label Dec 27, 2022
@ngua
Copy link
Contributor

ngua commented Jan 11, 2023

@goodlyrottenapple, do you have the same issue if you build haskellPackages.ormolu_0_5_0_1 (on nixpkgs' release-22.11 branch)?

@goodlyrottenapple
Copy link
Contributor Author

different error

@nix { "action": "setPhase", "phase": "setupCompilerEnvironmentPhase" }
setupCompilerEnvironmentPhase
Build with /nix/store/qfavpv5wdjaadrlihdka7mv32raa99wb-ghc-9.0.2.
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
unpacking source archive /nix/store/25dxzsb36n96ibm6c9lbagvswxw6l95w-ormolu-0.5.0.1.tar.gz
source root is ormolu-0.5.0.1
setting SOURCE_DATE_EPOCH to timestamp 1000000000 of file ormolu-0.5.0.1/tests/Spec.hs
@nix { "action": "setPhase", "phase": "patchPhase" }
patching sources
@nix { "action": "setPhase", "phase": "compileBuildDriverPhase" }
compileBuildDriverPhase
setupCompileFlags: -package-db=/private/tmp/nix-build-ormolu-0.5.0.1.drv-0/tmp.uFFynq4slC/setup-package.conf.d -j8 -threaded -rtsopts
[1 of 1] Compiling Main             ( Setup.hs, /private/tmp/nix-build-ormolu-0.5.0.1.drv-0/tmp.uFFynq4slC/Main.o )
Linking Setup ...
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
updateAutotoolsGnuConfigScriptsPhase
@nix { "action": "setPhase", "phase": "configurePhase" }
configuring
configureFlags: --verbose --prefix=/nix/store/j0kdyhwlb6ykcdr80zy5jaha90vmf3iy-ormolu-0.5.0.1 --libdir=$prefix/lib/$compiler --libsubdir=$abi/$libname --docdir=/nix/store/y0rsbpg3gwya9z8d0qd2lakrpcl008rl-ormolu-0.5.0.1-doc/share/doc/ormolu-0.5.0.1 --with-gcc=clang --package-db=/private/tmp/nix-build-ormolu-0.5.0.1.drv-0/tmp.uFFynq4slC/package.conf.d --ghc-options=-j8 --disable-split-objs --disable-library-profiling --disable-profiling --enable-shared --disable-coverage --enable-static --disable-executable-dynamic --enable-tests --disable-benchmarks --enable-library-vanilla --disable-library-for-ghci --ghc-options=-haddock -f-fixity-th --extra-lib-dirs=/nix/store/8h7609yp0qw6yj8hd6662w7ahmamjsad-ncurses-6.3-p20220507/lib --extra-lib-dirs=/nix/store/xvbyb8wxgaa760b6v1mpj96z33ssfzxj-libffi-3.4.4/lib --extra-lib-dirs=/nix/store/fzf4716m9p1k9cyqq32n5pzxd82xjxfp-gmp-with-cxx-6.2.1/lib --extra-include-dirs=/nix/store/rhl9q5gk6f37d0jk55z6bhdhl43xz6yn-libiconv-50/include --extra-lib-dirs=/nix/store/rhl9q5gk6f37d0jk55z6bhdhl43xz6yn-libiconv-50/lib --extra-include-dirs=/nix/store/80pvq927ij4gnrjblr158c2fys7v7nfh-libcxx-11.1.0-dev/include --extra-lib-dirs=/nix/store/wlqz9dhf202ir0wddbcicqm737vznf80-libcxx-11.1.0/lib --extra-include-dirs=/nix/store/f3s72pm62z5ygp099nx49nbkmxwwmr41-libcxxabi-11.1.0-dev/include --extra-lib-dirs=/nix/store/1vngndxhl8pw2p925y7icx8j58ndksn4-libcxxabi-11.1.0/lib --extra-lib-dirs=/nix/store/n5z71i1l7jr8qg75vavf7374axvwpsaa-compiler-rt-libc-11.1.0/lib --extra-framework-dirs=/nix/store/9akqcl59rcicfyfxqqnk6qsc4xv1aww7-apple-framework-CoreFoundation-11.0.0/Library/Frameworks --extra-include-dirs=/nix/store/pvypwlaxj3zzmb8n2yvapqdknpk73kvh-libobjc-11.0.0/include --extra-lib-dirs=/nix/store/pvypwlaxj3zzmb8n2yvapqdknpk73kvh-libobjc-11.0.0/lib
Using Parsec parser
Configuring ormolu-0.5.0.1...

Setup: Encountered missing or private dependencies:
Cabal >=3.6 && <3.7, ghc-lib-parser >=9.2 && <9.3

@goodlyrottenapple
Copy link
Contributor Author

the command was nix shell nixpkgs/nixos-22.11#haskellPackages.ormolu_0_5_0_1

ngua added a commit that referenced this issue Jan 12, 2023
Closes #22, closes #23 and improves the necessary workarounds for #10
(previously Ormolu would have been built by `checks.formatting` and
`packages.default` even on `aarch64-darwin`, now it's never built)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants