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

inspection-testing fails to build with GHC 8.10.5 #1201

Open
jkachmar opened this issue Aug 13, 2021 · 8 comments
Open

inspection-testing fails to build with GHC 8.10.5 #1201

jkachmar opened this issue Aug 13, 2021 · 8 comments
Labels
preserved Keep stale bot away

Comments

@jkachmar
Copy link
Contributor

inspection-testing fails to build with haskell.nix when using GHC 8.10.5 and 8.10.4; it succeeds when building normally (cf. the inspection-testing CI).

I've verified that this happens with GHC 8.10.5 on the latest haskell.nix 21.05 and unstable nixpkgs pins.

To reproduce the failure, clone https://github.com/jkachmar/haskell-nix-inspection-testing-bug and build it with nix build . on a system that supports Nix Flakes.

You should encounter the following error:

GHC 8.10.5 error
error: builder for '/nix/store/fk4dhplcpqgp88kj09zisan54179rxq8-inspection-testing-lib-inspection-testing-0.4.5.0.drv' failed with exit code 1;
       last 10 log lines:
       >     |
       > 224 |     go_tick :: RnEnv2 -> Tickish Id -> Tickish Id -> Bool
       >     |                          ^^^^^^^
       > 
       > src/Test/Inspection/Core.hs:224:40: error:
       >     Not in scope: type constructor or class ‘Tickish’
       >     |
       > 224 |     go_tick :: RnEnv2 -> Tickish Id -> Tickish Id -> Bool
       >     |                                        ^^^^^^^
       > 

My only thought is that this is triggered by the unboxed tuples patch being applied to GHC 8.10.5, since Tickish is exported by CoreSyn prior to GHC 9.0.1 and it looks like there's quite a bit of mucking around going on there.

cf. https://github.com/input-output-hk/haskell.nix/blob/a5b74bf002bee3ee41012c8f5e48105150892eee/overlays/patches/ghc/ghc-8.10.5-ubxt.patch


Curiously it also seems to fail when compiling with GHC 9.0.1 using the unstable nixpkgs pin, but with a completely different error.

GHC 9.0.1 error
error: builder for '/nix/store/2npb1yxswm2pn9fkw2ryqw5zqwsh2s99-inspection-testing-lib-inspection-testing-0.4.5.0.drv' failed with exit code 1;
       last 10 log lines:
       > configuring
       > Configure flags:
       > --prefix=/nix/store/44pld05ryhd70jz9vdsmb56smx0dnira-inspection-testing-lib-inspection-testing-0.4.5.0 lib:inspection-testing --package-db=clear --package-db=/nix/store/7m5zlvn3350f15sp9z5lml2h9sx0gmww-inspection-testing-lib-inspection-testing-0.4.5.0-config/lib/ghc-9.0.1/package.conf.d --flags=-more-tests --flags=-old-text-tests --exact-configuration --dependency=rts=rts --dependency=ghc-heap=ghc-heap-9.0.1 --dependency=ghc-prim=ghc-prim-0.7.0 --dependency=integer-gmp=integer-gmp-1.1 --dependency=base=base-4.15.0.0 --dependency=deepseq=deepseq-1.4.5.0 --dependency=array=array-0.5.4.0 --dependency=ghc-boot-th=ghc-boot-th-9.0.1 --dependency=pretty=pretty-1.1.3.6 --dependency=template-haskell=template-haskell-2.17.0.0 --dependency=ghc-bignum=ghc-bignum-1.0 --dependency=ghc-boot=ghc-boot-9.0.1 --dependency=ghc=ghc-9.0.1 --dependency=Cabal=Cabal-3.4.0.0 --dependency=array=array-0.5.4.0 --dependency=binary=binary-0.8.8.0 --dependency=bytestring=bytestring-0.10.12.1 --dependency=containers=containers-0.6.4.1 --dependency=directory=directory-1.3.6.1 --dependency=filepath=filepath-1.4.2.1 --dependency=ghc-boot=ghc-boot-9.0.1 --dependency=ghc-compact=ghc-compact-0.1.0.0 --dependency=ghc-prim=ghc-prim-0.7.0 --dependency=hpc=hpc-0.6.1.0 --dependency=mtl=mtl-2.2.2 --dependency=parsec=parsec-3.1.14.0 --dependency=process=process-1.6.11.0 --dependency=text=text-1.2.4.1 --dependency=time=time-1.9.3 --dependency=transformers=transformers-0.5.6.2 --dependency=unix=unix-2.7.2.2 --dependency=xhtml=xhtml-3000.2.2.1 --dependency=terminfo=terminfo-0.4.1.4 --with-ghc=ghc --with-ghc-pkg=ghc-pkg --with-hsc2hs=hsc2hs --with-gcc=cc --with-ld=ld.gold --ghc-option=-optl-fuse-ld=gold --ld-option=-fuse-ld=gold --with-ar=ar --with-strip=strip --disable-executable-stripping --disable-library-stripping --disable-library-profiling --disable-executable-profiling --enable-static --enable-shared --disable-coverage --enable-library-for-ghci --enable-split-sections
       > Configuring library for inspection-testing-0.4.5.0..
       > Warning: The flag --disable-executable-profiling is deprecated. Please use
       > --disable-profiling instead.
       > Error:
       >     The following packages are broken because other packages they depend on are missing. These broken packages must be rebuilt before they can be used.
       > installed package ghc-9.0.1 is broken due to missing package exceptions-0.10.4
       >
@TeofilC
Copy link
Contributor

TeofilC commented Aug 15, 2021

The error you get in the 9.0.1 case looks like the error from this issue #1177

I tried a version of the patch recommended there:
diff --git a/overlay.nix b/overlay.nix
index aea8c98..213eb71 100644
--- a/overlay.nix
+++ b/overlay.nix
@@ -8,6 +8,22 @@ in
 {
   example = project' {
     src = ./.;
-    compiler-nix-name = "ghc8105";
-  };
+    compiler-nix-name = "ghc901";
+    modules = [{
+      nonReinstallablePkgs = [
+      "rts" "ghc-heap" "ghc-prim" "integer-gmp" "integer-simple" "base"
+      "deepseq" "array" "ghc-boot-th" "pretty" "template-haskell"
+      # ghcjs custom packages
+      "ghcjs-prim" "ghcjs-th"
+      "ghc-bignum" "exceptions" "stm"
+      "ghc-boot"
+      "ghc" "Cabal" "Win32" "array" "binary" "bytestring" "containers"
+      "directory" "filepath" "ghc-boot" "ghc-compact" "ghc-prim"
+      # "ghci" "haskeline"
+      "hpc"
+      "mtl" "parsec" "process" "text" "time" "transformers"
+      "unix" "xhtml" "terminfo"
+    ];
+  }];
+ };
 }
and that seems to compile it fine. I'm not sure if this helps you much, but at least it narrows it down to 8.10

@gilligan
Copy link

I just ran into this myself.

The problem stems from #825 : inspection-testing needs Tickish but CoreSyn doesn't export this constructor anymore with the patch applied.

I tried to patch inspection-testing but it isn't obvious to me what I should replace Tickish Id with and this leads me down a rabbit hole pretty quickly where the Breakpoint constructor doesn't match anymore either when I use CoreTickish instead.

@gilligan
Copy link

PS: I think this is a good reason to strongly consider #1301 - This patch introduces changes which aren't required for haskell.nix to work but are causing breakage. Thus it would be great if patches like this weren't enabled by default.

@michaelpj
Copy link
Collaborator

Hmm, actually I also encountered this, and was mystified. Yeah, messing with the types exposed by the ghc package is quite risky...

@michaelpj
Copy link
Collaborator

It just looks like overlays/patches/ghc/ghc-8.10.3-ubxt.patch and overlays/patches/ghc/ghc-8.10.5-ubxt.patch contain changes from another commit 🤔 Maybe we can just delete that?

@gilligan
Copy link

FTR i got everything to build using a fork that doesn’t apply the ubxt patches (as expected).

@stale
Copy link

stale bot commented Sep 28, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Sep 28, 2022
@jkachmar
Copy link
Contributor Author

this is still an issue.

@stale stale bot removed the wontfix label Sep 28, 2022
@hamishmack hamishmack added the preserved Keep stale bot away label Sep 29, 2022
thenonameguy added a commit to thenonameguy/haskell.nix that referenced this issue Oct 25, 2022
thenonameguy added a commit to thenonameguy/haskell.nix that referenced this issue Oct 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
preserved Keep stale bot away
Projects
None yet
Development

No branches or pull requests

5 participants