Fix issues with GHC outside of stdenv on Darwin#125367
Merged
sternenseemann merged 1 commit intoNixOS:haskell-updatesfrom Jun 8, 2021
Merged
Fix issues with GHC outside of stdenv on Darwin#125367sternenseemann merged 1 commit intoNixOS:haskell-updatesfrom
sternenseemann merged 1 commit intoNixOS:haskell-updatesfrom
Conversation
Member
Author
|
$ nix-build -A tests.writers
these derivations will be built:
/nix/store/hkpg0m44v3kvkgcjhzklbzhy7hyqbw1w-test_writers.drv
/nix/store/1laarw0v4xnl6jdancfswa9imzddad85-test-writers.drv
/nix/store/zmzl0phrj8fkzr8zch1xizysyybj7fbs-test_writers.drv
/nix/store/awn033v3vlj7g31mcznd9caq6cr5vdvq-test-writers.drv
/nix/store/fvsjrpls1apn2z6qcxz77cyz8z0rdl7c-test_haskell.drv
/nix/store/xnkdwkv55xqahvqh2rsifasnha5li7rw-test_haskell.drv
/nix/store/kx2l83gyvryka0x3nlkw8323kgs6qil3-test-writers.drv
/nix/store/xcn490j6jsgji1mrgsvpvlx3pjjlpzqg-test-writers.drv
/nix/store/vl2imbpfjhqc8cxqidpk3kfdvvqgj8dy-test-writers.drv
building '/nix/store/fvsjrpls1apn2z6qcxz77cyz8z0rdl7c-test_haskell.drv'...
[1 of 1] Compiling Main ( tmp.hs, tmp.o )
Linking tmp ...
building '/nix/store/xnkdwkv55xqahvqh2rsifasnha5li7rw-test_haskell.drv'...
[1 of 1] Compiling Main ( tmp.hs, tmp.o )
Linking tmp ...
building '/nix/store/xcn490j6jsgji1mrgsvpvlx3pjjlpzqg-test-writers.drv'...
building '/nix/store/kx2l83gyvryka0x3nlkw8323kgs6qil3-test-writers.drv'...
building '/nix/store/hkpg0m44v3kvkgcjhzklbzhy7hyqbw1w-test_writers.drv'...
error: linking with `cc` failed: exit code: 1
|
= note: "cc" "-m64" "-arch" "x86_64" "-L" "/nix/store/ly04c58zsvb4c219sv6q393dik249hjy-rustc-1.52.1/lib/rustlib/x86_64-apple-darwin/lib" "/nix/store/6zvgl3gafnk8k16ksxfhzg2az9ars84n-test_writers.tmp.7rcbfp3g-cgu.0.rcgu.o" "/nix/store/6zvgl3gafnk8k16ksxfhzg2az9ars84n-test_writers.tmp.7rcbfp3g-cgu.1.rcgu.o" "/nix/store/6zvgl3gafnk8k16ksxfhzg2az9ars84n-test_writers.tmp.7rcbfp3g-cgu.2.rcgu.o" "/nix/store/6zvgl3gafnk8k16ksxfhzg2az9ars84n-test_writers.tmp.7rcbfp3g-cgu.3.rcgu.o" "/nix/store/6zvgl3gafnk8k16ksxfhzg2az9ars84n-test_writers.tmp.7rcbfp3g-cgu.4.rcgu.o" "/nix/store/6zvgl3gafnk8k16ksxfhzg2az9ars84n-test_writers.tmp.7rcbfp3g-cgu.5.rcgu.o" "/nix/store/6zvgl3gafnk8k16ksxfhzg2az9ars84n-test_writers.tmp.7rcbfp3g-cgu.6.rcgu.o" "/nix/store/6zvgl3gafnk8k16ksxfhzg2az9ars84n-test_writers.tmp.7rcbfp3g-cgu.7.rcgu.o" "-o" "/nix/store/6zvgl3gafnk8k16ksxfhzg2az9ars84n-test_writers" "/nix/store/6zvgl3gafnk8k16ksxfhzg2az9ars84n-test_writers.4i0hgzmnpf4h2pz.rcgu.o" "-Wl,-dead_strip" "-nodefaultlibs" "-L" "/nix/store/ly04c58zsvb4c219sv6q393dik249hjy-rustc-1.52.1/lib/rustlib/x86_64-apple-darwin/lib" "/nix/store/ly04c58zsvb4c219sv6q393dik249hjy-rustc-1.52.1/lib/rustlib/x86_64-apple-darwin/lib/libstd-8ecebea30c961804.rlib" "/nix/store/ly04c58zsvb4c219sv6q393dik249hjy-rustc-1.52.1/lib/rustlib/x86_64-apple-darwin/lib/libpanic_unwind-78b8371c8829edb9.rlib" "/nix/store/ly04c58zsvb4c219sv6q393dik249hjy-rustc-1.52.1/lib/rustlib/x86_64-apple-darwin/lib/libobject-11c2250f76ee79de.rlib" "/nix/store/ly04c58zsvb4c219sv6q393dik249hjy-rustc-1.52.1/lib/rustlib/x86_64-apple-darwin/lib/libaddr2line-138200afe481d69a.rlib" "/nix/store/ly04c58zsvb4c219sv6q393dik249hjy-rustc-1.52.1/lib/rustlib/x86_64-apple-darwin/lib/libgimli-50edf7ed96dca7d7.rlib" "/nix/store/ly04c58zsvb4c219sv6q393dik249hjy-rustc-1.52.1/lib/rustlib/x86_64-apple-darwin/lib/librustc_demangle-f5add760ba32d8c5.rlib" "/nix/store/ly04c58zsvb4c219sv6q393dik249hjy-rustc-1.52.1/lib/rustlib/x86_64-apple-darwin/lib/libhashbrown-107795e7ae43b1fc.rlib" "/nix/store/ly04c58zsvb4c219sv6q393dik249hjy-rustc-1.52.1/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_alloc-1a28e1881ca37aeb.rlib" "/nix/store/ly04c58zsvb4c219sv6q393dik249hjy-rustc-1.52.1/lib/rustlib/x86_64-apple-darwin/lib/libunwind-0b60cab5e184de42.rlib" "/nix/store/ly04c58zsvb4c219sv6q393dik249hjy-rustc-1.52.1/lib/rustlib/x86_64-apple-darwin/lib/libcfg_if-20066734a370e7ce.rlib" "/nix/store/ly04c58zsvb4c219sv6q393dik249hjy-rustc-1.52.1/lib/rustlib/x86_64-apple-darwin/lib/liblibc-0688efbb4c57e170.rlib" "/nix/store/ly04c58zsvb4c219sv6q393dik249hjy-rustc-1.52.1/lib/rustlib/x86_64-apple-darwin/lib/liballoc-0c8da59b450dd54a.rlib" "/nix/store/ly04c58zsvb4c219sv6q393dik249hjy-rustc-1.52.1/lib/rustlib/x86_64-apple-darwin/lib/librustc_std_workspace_core-159337c2037ece59.rlib" "/nix/store/ly04c58zsvb4c219sv6q393dik249hjy-rustc-1.52.1/lib/rustlib/x86_64-apple-darwin/lib/libcore-1ba7a3965a87fb70.rlib" "/nix/store/ly04c58zsvb4c219sv6q393dik249hjy-rustc-1.52.1/lib/rustlib/x86_64-apple-darwin/lib/libcompiler_builtins-2f50c7e4a63f3402.rlib" "-lSystem" "-lresolv" "-lc" "-lm" "-liconv"
= note: ld: library not found for -liconv
collect2: error: ld returned 1 exit status
error: aborting due to previous error
builder for '/nix/store/hkpg0m44v3kvkgcjhzklbzhy7hyqbw1w-test_writers.drv' failed with exit code 1
cannot build derivation '/nix/store/1laarw0v4xnl6jdancfswa9imzddad85-test-writers.drv': 1 dependencies couldn't be built
building '/nix/store/zmzl0phrj8fkzr8zch1xizysyybj7fbs-test_writers.drv'...
cannot build derivation '/nix/store/vl2imbpfjhqc8cxqidpk3kfdvvqgj8dy-test-writers.drv': 1 dependencies couldn't be built
error: build of '/nix/store/vl2imbpfjhqc8cxqidpk3kfdvvqgj8dy-test-writers.drv' failed |
This was referenced Jun 2, 2021
Member
|
cc @Ericson2314 & @matthewbauer if they can help out somehow. |
0465d0c to
57f3c27
Compare
Member
Author
|
Okay turns out, I fixed the issue on darwin indeed, the issue pasted above is with the rust writer. I got confused because the derivation names are generic in many cases, something I'll also go ahead and fix. See #126182. |
Member
|
@sternenseemann does this need to be backported to older GHCs? |
Member
Author
|
I suspect so, which is why I'm still marking this as a draft. I'll add the fix to the other GHCs later and merge this into Eventually I want to separate the wrapper script and the GHC derivation, so we don't need to port such fixes all the time (#123599), but one step at a time. |
57f3c27 to
8365f06
Compare
GHC calls otool on darwin which is contained in the stdenv.cc.bintools.bintools derivation and thus needs adding to the runtime PATH of GHC. Since this is toolchain specific technically, we check for cctools instead of darwin (although I don't know if GHC or nixpkgs work on macOS without cctools). This fixes usage of GHC in an environment where otool is not available and more specifically in stdenvNoCC which is used by writers.writeHaskell. Resolves NixOS#123228.
7720995 to
13c72a9
Compare
8365f06 to
97e0f42
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation for this change
Things done
sandboxinnix.confon non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"./result/bin/)