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

Unusual strange errors after recent stack updates #2047

Closed
gromakovsky opened this issue Apr 19, 2016 · 17 comments
Closed

Unusual strange errors after recent stack updates #2047

gromakovsky opened this issue Apr 19, 2016 · 17 comments

Comments

@gromakovsky
Copy link

First of all, I want to notice that I feel a bit awkward writting it, because I have no idea how to reproduce these errors and maybe they are not reproducible on other machines at all. Anyway, after such errors started happenning too often and for more than project I decided that I shouldn't silently ignore them and rebuild, but open an issue.

I use stack version 1.0.4.3-5 from official Archlinux package (community/stack). I have been using it for a long time and everything was fine. However, after I started writing a new project some strange errors started to occur. It's worth mentioning that before it there were multiple updates of community/stack package. For the first time I didn't care much about these errors, stack clean && stack build usually was enough (though sometimes build failed even after clean). Then I started testing my code, so I needed to rebuild it frequently and I got too much errors so that I even made screenshots to share with my colleagues. Here they are:

There were other errors too, I can collect more if needed, but I guess these 4 are enough to see that something is broken. Unfortunately, I don't have printed versions, because I didn't plan to open an issue at that time.

Today I switched to work on another project, I never had any difficulties building it. Before it I removed ~/.stack directory, so stack build had to download whole lts-5.8 snapshot used in that project. Running stack build rscoin resulted into this error:

lens-4.13: configure
Progress: 75/77
--  While building package lens-4.13 using:
      /tmp/stack13392/lens-4.13/.stack-work/dist/x86_64-linux/Cabal-1.22.5.0/setup/setup --builddir=.stack-work/dist/x86_64-linux/Cabal-1.22.5.0 configure --with-ghc=/usr/sbin/ghc --with-ghc-pkg=/usr/sbin/ghc-pkg --user --package-db=clear --package-db=global --package-db=/home/gromak/.stack/snapshots/x86_64-linux/lts-5.8/7.10.3/pkgdb --libdir=/home/gromak/.stack/snapshots/x86_64-linux/lts-5.8/7.10.3/lib --bindir=/home/gromak/.stack/snapshots/x86_64-linux/lts-5.8/7.10.3/bin --datadir=/home/gromak/.stack/snapshots/x86_64-linux/lts-5.8/7.10.3/share --libexecdir=/home/gromak/.stack/snapshots/x86_64-linux/lts-5.8/7.10.3/libexec --sysconfdir=/home/gromak/.stack/snapshots/x86_64-linux/lts-5.8/7.10.3/etc --docdir=/home/gromak/.stack/snapshots/x86_64-linux/lts-5.8/7.10.3/doc/lens-4.13 --htmldir=/home/gromak/.stack/snapshots/x86_64-linux/lts-5.8/7.10.3/doc/lens-4.13 --haddockdir=/home/gromak/.stack/snapshots/x86_64-linux/lts-5.8/7.10.3/doc/lens-4.13 --dependency=array=array-0.5.1.0-960bf9ae8875cc30355e086f8853a049 --dependency=base=base-4.8.2.0-0d6d1084fbc041e1cded9228e80e264d --dependency=base-orphans=base-orphans-0.5.3-d2110f3b0d07b67c48bf5cca13f2d1ca --dependency=bifunctors=bifunctors-5.2-8e9eb5f30e00ac757b85f60097b2d87f --dependency=bytestring=bytestring-0.10.6.0-c60f4c543b22c7f7293a06ae48820437 --dependency=comonad=comonad-4.2.7.2-2902545df4237661cfc48aebbdfc77b0 --dependency=containers=containers-0.5.6.2-e59c9b78d840fa743d4169d4bea15592 --dependency=contravariant=contravariant-1.4-7424e4eaef22fe87466b122448986ba0 --dependency=distributive=distributive-0.5.0.2-315fc6024941769bf6205f1e052600ca --dependency=exceptions=exceptions-0.8.2.1-08ed62d2282590eb80eba3e5c42a5f4e --dependency=filepath=filepath-1.4.0.0-f97d1e4aebfd7a03be6980454fe31d6e --dependency=free=free-4.12.4-a17433356b93fe942aae4e06aa7e9d53 --dependency=ghc-prim=ghc-prim-0.4.0.0-6cdc86811872333585fa98756aa7c51e --dependency=hashable=hashable-1.2.4.0-1c5b5b3e4d9b3066cec16b077238de40 --dependency=kan-extensions=kan-extensions-4.2.3-7c0f83b6feb557d22ba17f71ec2cac8d --dependency=mtl=mtl-2.2.1-3af90341e75ee52dfc4e3143b4e5d219 --dependency=parallel=parallel-3.2.1.0-13fa56575e4752a542f0b618706881f7 --dependency=profunctors=profunctors-5.2-f5770bf0201a96b9d6b05ea06a58777d --dependency=reflection=reflection-2.1.2-a1800076486d650159694cb5f635481f --dependency=semigroupoids=semigroupoids-5.0.1-c2fda9d86385e6999b70b52df403fdca --dependency=semigroups=semigroups-0.18.1-9f7035f24a4808c366583d94ad55bc8e --dependency=tagged=tagged-0.8.3-21c7d9e94c80e78986722ec9a3df67cf --dependency=template-haskell=template-haskell-2.10.0.0-3c4cb52230f347282af9b2817f013181 --dependency=text=text-1.2.2.0-daec687352505adca80a15e023cbae5c --dependency=transformers=transformers-0.4.2.0-81450cd8f86b36eaa8fa0cbaf6efc3a3 --dependency=transformers-compat=transformers-compat-0.4.0.4-8aa4073730c676dbe210ea8bffd8d092 --dependency=unordered-containers=unordered-containers-0.2.5.1-6ad25c3b0727ccd065df1f0dd244dbf2 --dependency=vector=vector-0.11.0.0-299aefb173ce5a731565d31f609a0cfd --dependency=void=void-0.7.1-67d9e27bca8d1d87341bea03c23b37c5
    Process exited with code: ExitFailure 1
    Logs have been written to: /home/gromak/Work/rscoin/.stack-work/logs/lens-4.13.log

    [1 of 1] Compiling Main             ( /tmp/stack13392/lens-4.13/Setup.lhs, /tmp/stack13392/lens-4.13/.stack-work/dist/x86_64-linux/Cabal-1.22.5.0/setup/Main.o )
    Linking /tmp/stack13392/lens-4.13/.stack-work/dist/x86_64-linux/Cabal-1.22.5.0/setup/setup ...
    Configuring lens-4.13...
    setup: The following installed packages are broken because other packages they
    depend on are missing. These broken packages must be rebuilt before they can
    be used.
    package parallel-3.2.1.0 is broken due to missing package
    containers-0.5.6.2-59326c33e30ec8f6afd574cbac625bbb

Then I tried to rebuild it, but error didn't disappear. Then I tried lts-5.12 and got another error:

Progress: 7/63
--  While building package ansi-terminal-0.6.2.3 using:
      /home/gromak/.stack/setup-exe-cache/x86_64-linux/setup-Simple-Cabal-1.22.5.0-ghc-7.10.3 --builddir=.stack-work/dist/x86_64-linux/Cabal-1.22.5.0 configure --with-ghc=/usr/sbin/ghc --with-ghc-pkg=/usr/sbin/ghc-pkg --user --package-db=clear --package-db=global --package-db=/home/gromak/.stack/snapshots/x86_64-linux/lts-5.12/7.10.3/pkgdb --libdir=/home/gromak/.stack/snapshots/x86_64-linux/lts-5.12/7.10.3/lib --bindir=/home/gromak/.stack/snapshots/x86_64-linux/lts-5.12/7.10.3/bin --datadir=/home/gromak/.stack/snapshots/x86_64-linux/lts-5.12/7.10.3/share --libexecdir=/home/gromak/.stack/snapshots/x86_64-linux/lts-5.12/7.10.3/libexec --sysconfdir=/home/gromak/.stack/snapshots/x86_64-linux/lts-5.12/7.10.3/etc --docdir=/home/gromak/.stack/snapshots/x86_64-linux/lts-5.12/7.10.3/doc/ansi-terminal-0.6.2.3 --htmldir=/home/gromak/.stack/snapshots/x86_64-linux/lts-5.12/7.10.3/doc/ansi-terminal-0.6.2.3 --haddockdir=/home/gromak/.stack/snapshots/x86_64-linux/lts-5.12/7.10.3/doc/ansi-terminal-0.6.2.3 --dependency=base=base-4.8.2.0-0d6d1084fbc041e1cded9228e80e264d --dependency=unix=unix-2.7.1.0-343d4f566f30113da92e819f4a148640
    Process exited with code: ExitFailure 1
    Logs have been written to: /home/gromak/Work/rscoin/.stack-work/logs/ansi-terminal-0.6.2.3.log

    Configuring ansi-terminal-0.6.2.3...
    setup-Simple-Cabal-1.22.5.0-ghc-7.10.3: '/usr/sbin/ghc-pkg' exited with an
    error:
    ghc-pkg:
    /home/gromak/.stack/snapshots/x86_64-linux/lts-5.12/7.10.3/pkgdb/cereal-0.5.1.0-b8a30f8877fa63f4f84ceceaab55715e.conf:
    openFile: does not exist (No such file or directory)

However, running stack clean; stack build eliminated this error.

Here is a gist containing two logs (building with 5.8 and 5.12): https://gist.github.com/gromakovsky/4f38f05c44e3a525f9d2c3fa1a0d0b97

In coclusion I want to apologise for not providing ways to reproduce any of these errors. First of all, I don't know how to reproduce it on my machine (as I said, these errors happen non-deterministically) and don't have enough time to research it, trying to find a deterministically reproducible example. Also I have a feeling that such problems may be related to Archlinux, or maybe even my particular machine, so I'm not sure if it will be possible to reproduce them somewhere else.

@mgsloan
Copy link
Contributor

mgsloan commented Apr 19, 2016

Thanks, I'm not sure what's up with that. All the issues are happening with programs invoked by Cabal. Is it possible that you also updated your snapshot version around when updating your stack version? Not sure what we could pass to configure which would cause this.

So, other than this being associated with a stack update, this is seeming like an upstream issue - marking as such. Does it go away if you downgrade to the version you were using?

@luigy
Copy link
Contributor

luigy commented Apr 20, 2016

I have a feeling that the underlying problem is maybe related to #1957

non stack managed compilers and global pkgs installed can lead to this kind of behavior and maybe there is a way for stack to handle it better

Can you try to reproduce this using a compiler managed by stack?
stack --no-system-ghc --install-ghc build

@gromakovsky
Copy link
Author

gromakovsky commented Apr 20, 2016

@mgsloan

Is it possible that you also updated your snapshot version around when updating your stack version?

As I remember, I was using LTS-5.12 from the bery beginning.

Does it go away if you downgrade to the version you were using?

I have downgraded both cabal-install and stack packages to the versions of the middle of March. Unfortunatelly, today I had some errors too. Example of a new error (not present on screenshots):

Orchid-0.1.0.0: build
Preprocessing library Orchid-0.1.0.0...
[7 of 9] Compiling Orchid.Codegen   ( src/Orchid/Codegen.hs, .stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/Orchid/Codegen.o )
.stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/Orchid/Codegen.o: getFileStatus: does not exist (No such file or directory)

--  While building package Orchid-0.1.0.0 using:
      /home/gromak/.stack/setup-exe-cache/x86_64-linux/setup-Simple-Cabal-1.22.5.0-ghc-7.10.3 --builddir=.stack-work/dist/x86_64-linux/Cabal-1.22.5.0 build lib:Orchid exe:orchid --ghc-options " -ddump-hi -ddump-to-file"
    Process exited with code: ExitFailure 1

And gcc error:

rchid-0.1.0.0: build
Preprocessing library Orchid-0.1.0.0...
[8 of 9] Compiling Orchid.Translator ( src/Orchid/Translator.hs, .stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/Orchid/Translator.o )
[9 of 9] Compiling Orchid.Compiler  ( src/Orchid/Compiler.hs, .stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/Orchid/Compiler.o ) [Orchid.Translator changed]
In-place registering Orchid-0.1.0.0...
Preprocessing executable 'orchid' for Orchid-0.1.0.0...
[1 of 2] Compiling Options          ( src/app/Options.hs, .stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/orchid/orchid-tmp/Options.o )
[2 of 2] Compiling Main             ( src/app/Main.hs, .stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/orchid/orchid-tmp/Main.o )
Linking .stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/orchid/orchid ...
gcc: error: .stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/orchid/orchid-tmp/Options.o: No such file or directory
gcc: error: .stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/orchid/orchid-tmp/Main.o: No such file or directory

--  While building package Orchid-0.1.0.0 using:
      /home/gromak/.stack/setup-exe-cache/x86_64-linux/setup-Simple-Cabal-1.22.5.0-ghc-7.10.3 --builddir=.stack-work/dist/x86_64-linux/Cabal-1.22.5.0 build lib:Orchid exe:orchid --ghc-options " -ddump-hi -ddump-to-file"
    Process exited with code: ExitFailure 1

@gromakovsky
Copy link
Author

@luigy

Can you try to reproduce this using a compiler managed by stack?

I have a system-ghc: false in my stack.yaml. Those errors occur with stack's own ghc.

@gromakovsky
Copy link
Author

Here are a bit more details on error happening while building lens. This is a more detailed info I get with stack build --cabal-verbose:

--  While building package lens-4.13 using:
      /tmp/stack20890/lens-4.13/.stack-work/dist/x86_64-linux/Cabal-1.22.5.0/setup/setup --verbose --builddir=.stack-work/dist/x86_64-linux/Cabal-1.22.5.0 configure --with-ghc=/usr/sbin/ghc --with-ghc-pkg=/usr/sbin/ghc-pkg --user --package-db=clear --package-db=global --package-db=/home/gromak/.stack/snapshots/x86_64-linux/lts-5.8/7.10.3/pkgdb --libdir=/home/gromak/.stack/snapshots/x86_64-linux/lts-5.8/7.10.3/lib --bindir=/home/gromak/.stack/snapshots/x86_64-linux/lts-5.8/7.10.3/bin --datadir=/home/gromak/.stack/snapshots/x86_64-linux/lts-5.8/7.10.3/share --libexecdir=/home/gromak/.stack/snapshots/x86_64-linux/lts-5.8/7.10.3/libexec --sysconfdir=/home/gromak/.stack/snapshots/x86_64-linux/lts-5.8/7.10.3/etc --docdir=/home/gromak/.stack/snapshots/x86_64-linux/lts-5.8/7.10.3/doc/lens-4.13 --htmldir=/home/gromak/.stack/snapshots/x86_64-linux/lts-5.8/7.10.3/doc/lens-4.13 --haddockdir=/home/gromak/.stack/snapshots/x86_64-linux/lts-5.8/7.10.3/doc/lens-4.13 --dependency=array=array-0.5.1.0-960bf9ae8875cc30355e086f8853a049 --dependency=base=base-4.8.2.0-0d6d1084fbc041e1cded9228e80e264d --dependency=base-orphans=base-orphans-0.5.3-d2110f3b0d07b67c48bf5cca13f2d1ca --dependency=bifunctors=bifunctors-5.2-8e9eb5f30e00ac757b85f60097b2d87f --dependency=bytestring=bytestring-0.10.6.0-c60f4c543b22c7f7293a06ae48820437 --dependency=comonad=comonad-4.2.7.2-2902545df4237661cfc48aebbdfc77b0 --dependency=containers=containers-0.5.6.2-e59c9b78d840fa743d4169d4bea15592 --dependency=contravariant=contravariant-1.4-7424e4eaef22fe87466b122448986ba0 --dependency=distributive=distributive-0.5.0.2-315fc6024941769bf6205f1e052600ca --dependency=exceptions=exceptions-0.8.2.1-08ed62d2282590eb80eba3e5c42a5f4e --dependency=filepath=filepath-1.4.0.0-f97d1e4aebfd7a03be6980454fe31d6e --dependency=free=free-4.12.4-a17433356b93fe942aae4e06aa7e9d53 --dependency=ghc-prim=ghc-prim-0.4.0.0-6cdc86811872333585fa98756aa7c51e --dependency=hashable=hashable-1.2.4.0-1c5b5b3e4d9b3066cec16b077238de40 --dependency=kan-extensions=kan-extensions-4.2.3-7c0f83b6feb557d22ba17f71ec2cac8d --dependency=mtl=mtl-2.2.1-3af90341e75ee52dfc4e3143b4e5d219 --dependency=parallel=parallel-3.2.1.0-13fa56575e4752a542f0b618706881f7 --dependency=profunctors=profunctors-5.2-f5770bf0201a96b9d6b05ea06a58777d --dependency=reflection=reflection-2.1.2-a1800076486d650159694cb5f635481f --dependency=semigroupoids=semigroupoids-5.0.1-c2fda9d86385e6999b70b52df403fdca --dependency=semigroups=semigroups-0.18.1-9f7035f24a4808c366583d94ad55bc8e --dependency=tagged=tagged-0.8.3-21c7d9e94c80e78986722ec9a3df67cf --dependency=template-haskell=template-haskell-2.10.0.0-3c4cb52230f347282af9b2817f013181 --dependency=text=text-1.2.2.0-daec687352505adca80a15e023cbae5c --dependency=transformers=transformers-0.4.2.0-81450cd8f86b36eaa8fa0cbaf6efc3a3 --dependency=transformers-compat=transformers-compat-0.4.0.4-8aa4073730c676dbe210ea8bffd8d092 --dependency=unordered-containers=unordered-containers-0.2.5.1-6ad25c3b0727ccd065df1f0dd244dbf2 --dependency=vector=vector-0.11.0.0-299aefb173ce5a731565d31f609a0cfd --dependency=void=void-0.7.1-67d9e27bca8d1d87341bea03c23b37c5
    Process exited with code: ExitFailure 1
    Logs have been written to: /home/gromak/Work/rscoin/.stack-work/logs/lens-4.13.log

    [1 of 1] Compiling Main             ( /tmp/stack20890/lens-4.13/Setup.lhs, /tmp/stack20890/lens-4.13/.stack-work/dist/x86_64-linux/Cabal-1.22.5.0/setup/Main.o )
    Linking /tmp/stack20890/lens-4.13/.stack-work/dist/x86_64-linux/Cabal-1.22.5.0/setup/setup ...
    Configuring lens-4.13...
    Flags chosen: j=False, trustworthy=True, safe=False, test-templates=True,
    test-properties=True, test-hunit=True, test-doctests=True, test-hlint=True,
    dump-splices=False, old-inline-pragmas=False, inlining=True,
    benchmark-uniplate=False
    Dependency array ==0.5.1.0: using array-0.5.1.0
    Dependency base ==4.8.2.0: using base-4.8.2.0
    Dependency base-orphans ==0.5.3: using base-orphans-0.5.3
    Dependency bifunctors ==5.2: using bifunctors-5.2
    Dependency bytestring ==0.10.6.0: using bytestring-0.10.6.0
    Dependency comonad ==4.2.7.2: using comonad-4.2.7.2
    Dependency containers ==0.5.6.2: using containers-0.5.6.2
    Dependency contravariant ==1.4: using contravariant-1.4
    Dependency distributive ==0.5.0.2: using distributive-0.5.0.2
    Dependency exceptions ==0.8.2.1: using exceptions-0.8.2.1
    Dependency filepath ==1.4.0.0: using filepath-1.4.0.0
    Dependency free ==4.12.4: using free-4.12.4
    Dependency ghc-prim ==0.4.0.0: using ghc-prim-0.4.0.0
    Dependency hashable ==1.2.4.0: using hashable-1.2.4.0
    Dependency kan-extensions ==4.2.3: using kan-extensions-4.2.3
    Dependency mtl ==2.2.1: using mtl-2.2.1
    Dependency parallel ==3.2.1.0: using parallel-3.2.1.0
    Dependency profunctors ==5.2: using profunctors-5.2
    Dependency reflection ==2.1.2: using reflection-2.1.2
    Dependency semigroupoids ==5.0.1: using semigroupoids-5.0.1
    Dependency semigroups ==0.18.1: using semigroups-0.18.1
    Dependency tagged ==0.8.3: using tagged-0.8.3
    Dependency template-haskell ==2.10.0.0: using template-haskell-2.10.0.0
    Dependency text ==1.2.2.0: using text-1.2.2.0
    Dependency transformers ==0.4.2.0: using transformers-0.4.2.0
    Dependency transformers-compat ==0.4.0.4: using transformers-compat-0.4.0.4
    Dependency unordered-containers ==0.2.5.1: using unordered-containers-0.2.5.1
    Dependency vector ==0.11.0.0: using vector-0.11.0.0
    Dependency void ==0.7.1: using void-0.7.1
    setup: The following installed packages are broken because other packages they
    depend on are missing. These broken packages must be rebuilt before they can
    be used.
    package parallel-3.2.1.0 is broken due to missing package
    containers-0.5.6.2-59326c33e30ec8f6afd574cbac625bbb

Here we see that /tmp/stack20890/lens-4.13/.stack-work/dist/x86_64-linux/Cabal-1.22.5.0/setup/setup is run with --dependency=containers=containers-0.5.6.2-e59c9b78d840fa743d4169d4bea15592 flag. However, there is an error: package parallel-3.2.1.0 is broken due to missing package containers-0.5.6.2-59326c33e30ec8f6afd574cbac625bbb. How is it possible that this package is missing and why is it chose if it is missing? Is cabal responsible for it or stack?

Even ater removing .stack-work I get this error as well (along with the same error for hspec-core for which unix-2.7.1.0-bb54ee8f9f6b2600aae7a748eb88a610 is reported as missing).

Btw, it happens for the second project for which I use LTS 5.8.

The only way to fix it is to remove ~/.stack.

While I was writting this message I thought that I know why it happens and then I tried to reproduce it on my machine using the following steps:

  1. Clean ~/.stack.
  2. Build project A with LTS 5.12 and system-ghc: false
  3. Build project B with LTS 5.8 and system-ghc: true.

But magically project B was built successfully, so once again I have no idea what's going on and what can I do. :( And I can't reproduce it now, but chances are something similar will happen again later.

@mgsloan
Copy link
Contributor

mgsloan commented Apr 25, 2016

@gromakovsky Thanks for all the info. I have no idea what's going on there :/

It'd be helpful to create a dockerfile (and ideally, an uploaded docker image) which reproduces the issue.

@luigy
Copy link
Contributor

luigy commented Apr 25, 2016

I have a system-ghc: false in my stack.yaml. Those errors occur with stack's own ghc.

@gromakovsky hmm interesting, Stack seems to be ignoring the config(?) under some cases since both failing logs show --with-ghc* pointing to non stack managed tools/compiler

@gromakovsky
Copy link
Author

@mgsloan

It'd be helpful to create a dockerfile (and ideally, an uploaded docker image) which reproduces the issue.

I stil don't know a stable way to reproduce these errors on my machine. Sometimes some ideas come into my mind, I try them, but suddenly there is no error. Then I think: well, errors magically disappeared, everything is fine now, I can be happy. But after some time I get such errors again and this story happens again :(

@luigy
There are two differents projects I'm working on currently (let's call them A and B). Errors like file doesn't exist happen when I build project A during the last step (when my files are being built). Errors like from my last message (broken packages) happen when I build project B during the step when dependencies are being built. Project B uses system-ghc, so the fact that:

both failing logs show --with-ghc* pointing to non stack managed tools/compiler

is expectable. I can try building project B with stack's GHC, but as I said, this problem doesn't happen anymore.

Maybe it would be better to create two issues for these two types of errors, but when I created this issue I was sure they are related to each other.

@runeksvendsen
Copy link

I'm experiencing this after changing the snapshot for my project from lts-5.3 to lts-5.2.

I've wiped the .stack-work folder inside the project, but it seems stack insists on using the global GHC, even though the stack.yaml contains system-ghc: false.

Here's the build log:

rune@Runes-MacBook-Pro:~/IdeaProjects/payment-channel-protocol$ stack --no-system-ghc --install-ghc build
void-0.7.1: copying precompiled package
pbkdf-1.1.1.1: configure
pbkdf-1.1.1.1: build
secp256k1-0.4.4: configure
pbkdf-1.1.1.1: copy/register
secp256k1-0.4.4: build
contravariant-1.4: configure
murmur3-1.0.1: configure
murmur3-1.0.1: build
murmur3-1.0.1: copy/register
secp256k1-0.4.4: copy/register
Progress: 5/22
--  While building package contravariant-1.4 using:
      /Users/rune/.stack/setup-exe-cache/x86_64-osx/setup-Simple-Cabal-1.22.5.0-ghc-7.10.3 --builddir=.stack-work/dist/x86_64-osx/Cabal-1.22.5.0 configure --with-ghc=/Users/rune/.stack/programs/x86_64-osx/ghc-7.10.3/bin/ghc --with-ghc-pkg=/Users/rune/.stack/programs/x86_64-osx/ghc-7.10.3/bin/ghc-pkg --user --package-db=clear --package-db=global --package-db=/Users/rune/.stack/snapshots/x86_64-osx/lts-5.2/7.10.3/pkgdb --libdir=/Users/rune/.stack/snapshots/x86_64-osx/lts-5.2/7.10.3/lib --bindir=/Users/rune/.stack/snapshots/x86_64-osx/lts-5.2/7.10.3/bin --datadir=/Users/rune/.stack/snapshots/x86_64-osx/lts-5.2/7.10.3/share --libexecdir=/Users/rune/.stack/snapshots/x86_64-osx/lts-5.2/7.10.3/libexec --sysconfdir=/Users/rune/.stack/snapshots/x86_64-osx/lts-5.2/7.10.3/etc --docdir=/Users/rune/.stack/snapshots/x86_64-osx/lts-5.2/7.10.3/doc/contravariant-1.4 --htmldir=/Users/rune/.stack/snapshots/x86_64-osx/lts-5.2/7.10.3/doc/contravariant-1.4 --haddockdir=/Users/rune/.stack/snapshots/x86_64-osx/lts-5.2/7.10.3/doc/contravariant-1.4 --dependency=StateVar=StateVar-1.1.0.3-8283c9355d2fc1ad397281acceca5467 --dependency=base=base-4.8.2.0-cc43d8e06aa74e9c4c0132becc49ee25 --dependency=semigroups=semigroups-0.18.1-caadf8a34cfe264cbde5b7eb72cf8aeb --dependency=transformers=transformers-0.4.2.0-81450cd8f86b36eaa8fa0cbaf6efc3a3 --dependency=transformers-compat=transformers-compat-0.4.0.4-8aa4073730c676dbe210ea8bffd8d092 --dependency=void=void-0.7.1-67d9e27bca8d1d87341bea03c23b37c5 --extra-include-dirs=/usr/local/include/ --extra-lib-dirs=/usr/local/lib/
    Process exited with code: ExitFailure 1
    Logs have been written to: /Users/rune/IdeaProjects/payment-channel-protocol/.stack-work/logs/contravariant-1.4.log

    Configuring contravariant-1.4...
    setup-Simple-Cabal-1.22.5.0-ghc-7.10.3: The following installed packages are
    broken because other packages they depend on are missing. These broken
    packages must be rebuilt before they can be used.
    package void-0.7.1 is broken due to missing package
    hashable-1.2.4.0-52ad677f1b4d6f2f99386efa581d3396,
    semigroups-0.18.1-54d1935c745dd1f1df1745cd406cb4e7

@luigy
Copy link
Contributor

luigy commented May 11, 2016

@runeksvendsen in this case it doesn't seem to be using a non-stack managed compiler directly, but it could be that the snapshot-db registered packages are still pointing at outdated package-ids

It's been a bit since the last time I took a look at this, but I vaguely recall that this might happen when manually nuking files within ~/.stack/snapshot or when at the time the snapshot packages were registered the installed package IDs of global packages from the compiler differ from the current compiler stack is trying to use.

Usually the second should happen with non-stack managed compilers, since probably a package manager is usually messing with flags + global db which may render different installed package IDs leaving the precompiled cache with outdated information

Can you lpaste the output from:

$ stack exec -- ghc-pkg describe void
$ stack exec -- ghc-pkg describe hashable
$ stack exec -- ghc-pkg describe semigroups
$ stack exec -- ghc-pkg dump

WARN: I was also wondering how unsafe would it be to simply run and wether it fixes anything 🙈
stack exec -- ghc-pkg --verbose=2 recache --package-db=$(stack path --snapshot-pkg-db)

@mgsloan the above might help, but it still means that the precompiled cache is still carrying outdated information, right? or actually it might get updated correctly after a successful stack build. Anyhow, these edge cases should be improved with newer cabal/compiler, but that backwards compat though -.-

either way when in doubt the answer is always nuke ~/.stack... maybe stack doctor someday xD

@mgsloan
Copy link
Contributor

mgsloan commented May 11, 2016

when in doubt the answer is always nuke ~/.stack

I think we should definitely avoid that. I really don't want people to feel like they need to nuke it all the time. I haven't needed to in months, so it sucks to see people hitting issues like this.

@mgsloan the above might help, but it still means that the precompiled cache is still carrying outdated information, right?

True, but I don't think that's much of a problem. I moved a comment around while looking into this - the code here checks if the precompiled cache refers to something that exists 0bc1946

@runeksvendsen
Copy link

@luigy Here is the requested info:

http://lpaste.net/163098
http://lpaste.net/163099
http://lpaste.net/163100
http://lpaste.net/163101

For some reason I expected nuking the project's .stack-work directory would be sufficient, but it did require nuking ~/.stack, as you say (but I kept the old ~/.stack in order to reproduce these errors).

Is there a bona fide way of changing the resolver for a project? Or is nuking .stack-work and ~/.stack the only answer?

WARN: I was also wondering how unsafe would it be to simply run and wether it fixes anything

Let me know if you want me to run that. As long as it only affects ~/.stack and/or .stack-work I don't mind running it to see what would happen.

@mgsloan
Copy link
Contributor

mgsloan commented May 13, 2016

Is there a bona fide way of changing the resolver for a project? Or is nuking .stack-work and ~/.stack the only answer?

It shouldn't be necessary to nuke ~/.stack, but if something does go wrong then unfortunately it could be needed.

Simply changing stack.yaml should be enough to have the effect you want on build results. It is tricky to get this 100% correct, though, particularly when we do not control the build process (delegated to Cabal)

@gromakovsky
Copy link
Author

He-he, now I get even more strange errors:

Preprocessing test suite 'orchid-test' for Orchid-0.1.0.0...
[2 of 8] Compiling Test.Orchid.Data ( test/Test/Orchid/Data.hs, .stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/orchid-test/orchid-test-tmp/Test/Orchid/Data.o ) [test/data/type_error.orc changed]
Linking .stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/orchid-test/orchid-test ...
/usr/sbin/ld: reopening .stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/orchid-test/orchid-test-tmp/Test/Orchid/CompilerSpec.o: No such file or directory

/usr/sbin/ld:.stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/orchid-test/orchid-test-tmp/Test/Orchid/CompilerSpec.o: bfd_stat failed: No such file or directory
/usr/sbin/ld: reopening .stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/orchid-test/orchid-test-tmp/Test/Orchid/LexerSpec.o: No such file or directory

/usr/sbin/ld:.stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/orchid-test/orchid-test-tmp/Test/Orchid/LexerSpec.o: bfd_stat failed: No such file or directory
/usr/sbin/ld: reopening .stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/orchid-test/orchid-test-tmp/Test/Orchid/ParserSpec.o: No such file or directory

/usr/sbin/ld:.stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/orchid-test/orchid-test-tmp/Test/Orchid/ParserSpec.o: bfd_stat failed: No such file or directory
/usr/sbin/ld: reopening .stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/orchid-test/orchid-test-tmp/Test/Orchid/Arbitrary.o: No such file or directory

/usr/sbin/ld:.stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/orchid-test/orchid-test-tmp/Test/Orchid/Arbitrary.o: bfd_stat failed: No such file or directory
/usr/sbin/ld: reopening .stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/orchid-test/orchid-test-tmp/Test/Orchid/Data.o: No such file or directory

/usr/sbin/ld:.stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/orchid-test/orchid-test-tmp/Test/Orchid/Data.o: bfd_stat failed: No such file or directory
/usr/sbin/ld: reopening .stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/orchid-test/orchid-test-tmp/Test/Orchid/Util.o: No such file or directory

/usr/sbin/ld:.stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/orchid-test/orchid-test-tmp/Test/Orchid/Util.o: bfd_stat failed: No such file or directory
/usr/sbin/ld: reopening .stack-work/dist/x86_64-linux/Cabal-1.22.5.0/build/orchid-test/orchid-test-tmp/Test/Orchid/CompilerSpec.o: No such file or directory

/usr/sbin/ld: BFD (GNU Binutils) 2.26.0.20160501 internal error, aborting at ../../binutils-gdb/bfd/merge.c:905 in _bfd_merged_section_offset

/usr/sbin/ld: Please report this bug.

collect2: error: ld returned 1 exit status

@mgsloan
Copy link
Contributor

mgsloan commented May 18, 2016

Are all of your modules listed in your cabal file?

@gromakovsky
Copy link
Author

Yes, they are. In fact this error (internal error in ld) happens very rarely and it's enough to rerun stack build to make it disappear.

Maybe the reason is that archlinux's version of ld has bug…

@snoyberg
Copy link
Contributor

snoyberg commented Apr 7, 2019

Closing this issue due to lack of repro and potential ld bug

@snoyberg snoyberg closed this as completed Apr 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants