weird ghcide error - Polysemy

Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.

Torsten Schmits

as of a few days ago, ghcide always shows me this error message:

  Bad interface file:
  /nix/store/ph44jry464pgkb6fssdgjjmi553kxk5j-polysemy-1.3.0.0/lib/ghc-8.10.1/x86_64-linux-ghc-8.10.1/polysemy-1.3.0.0-HG7iVIxbcLzLoj08Qvtejl/Polysemy/Internal/Union.hi
  Something is amiss; requested module polysemy-1.3.0.0:Polysemy.Internal.Union differs from name
  found in the interface file profunctors-5.5.2:Polysemy.Internal.Union (if these names look the
  same, try again with -dppr-debug)

It's always a different package instead of profunctors, but it's always Polysemy.Internal.Union. any idea what could be up here?

Georgi Lyubenov // googleson78

this isn't related to nix caching a bad build?

Georgi Lyubenov // googleson78

I've seen the "bad interface file" issues, but they usually go away once I do rm .stack-work

Georgi Lyubenov // googleson78

(and have not been necessarily related to polysemy, at least in their error output)

Torsten Schmits

that's what I suspected as well, and I fiddled around but couldn't fix it. I'm just wondering why it happens in multiple projects with different packages for the interface file

Torsten Schmits

also ghcid and nix-build work fine, and they use the same package set

Georgi Lyubenov // googleson78

do you have a consistent reproducer?

Torsten Schmits

yeah, the polysemy-test project should do it, with ghc8101 in ops/nix/default.nix. but I really doubt it's not related to nix

Georgi Lyubenov // googleson78

what polysemy-plugin are you using?

Torsten Schmits

though I tried switching to the latest releaeseā€¦I think

Torsten Schmits

maybe it's another ghc 8.10.1 issue. for now I'll just use 8.8.4 for development

Georgi Lyubenov // googleson78

it built successfully for me, from the uploaded release on hackage

Georgi Lyubenov // googleson78

with stack and this stack.yaml

resolver: nightly-2020-08-16

packages:
- .

extra-deps:
- base-noprelude-4.13.0.0@sha256:3cccbfda38e1422ca5cc436d58858ba51ff9114d2ed87915a6569be11e4e5a90,6842
- git: https://github.com/polysemy-research/polysemy
  commit: de19721ef5d3dc64d50a1571c45d933e7f17305a
  subdirs:
  - .
  - polysemy-plugin

allow-newer: true
Georgi Lyubenov // googleson78

I'm guessing there are some new things that aren't uploaded, but I didn't manage to find the source repo

Torsten Schmits

ok. guess I'll have to try and clean up the nix store

Torsten Schmits

I'd just really like to know why the package name in the error keeps changing