commercialhaskell / commercialhaskell/stack

Link-time error after changing a dependency

Open
#5,473 14 comments 4 reactions 0 assignees View on GitHub
type: bug
Dominant language
Haskell
Stars
4.1k
Forks
850
Avg merge
10h 37m
Merged PRs (30d)
4

Description

On Stack 2.5.1, I am using the following resolver file:

```
name: clash-HEAD
resolver: lts-16.21

packages:
- github: gergoerdi/clash-compiler
commit: d83b5cc58816654c84537b0b049b32ce899e179e
subdirs:
- clash-ghc
- clash-prelude
- clash-lib

- concurrent-supply-0.1.8
- ghc-typelits-extra-0.4.1

flags:
clash-prelude:
multiple-hidden: false
```

After a full `stack build` in my project, I then want to change the version of Clash used, so I change the git commit hash to `62411778020b09433744d267acd5aa3deb85b04f`. Subsequently, `stack build` fails at link time with an error message referencing a symbol that has been removed from Clash between the two Git commits:

```
17:47:46 [cactus@galaxy space-invaders-book2]$ stack build
Building all executables for `clashilator' once. After a successful build of all of them, only specified executables will be rebuilt.
clash-shake > configure (lib)
clash-shake > Configuring clash-shake-0.0.0...
clash-shake > build (lib)
clashilator > configure (lib + exe)
clash-shake > Preprocessing library for clash-shake-0.0.0..
clash-shake > Building library for clash-shake-0.0.0..
clash-shake > [2 of 3] Compiling Clash.Shake.Xilinx
clashilator > Configuring clashilator-0.1.0...
clashilator > build (lib + exe)
retroclash-lib > configure (lib)
clashilator > Preprocessing library for clashilator-0.1.0..
clashilator > Building library for clashilator-0.1.0..
clashilator > [1 of 3] Compiling Clash.Clashilator
retroclash-lib > Configuring retroclash-lib-0.0.0...
clashilator > : /home/cactus/sdk/stack/snapshots/x86_64-linux-tinfo6/ec9124c0759d4a86157169cae10f6eb8fa7c593cc5806c7a1c85f1b2d4175440/8.8.4/lib/x86_64-linux-ghc-8.8.4/libHSclash-ghc-1.3.0-J8pqPdvV3DI3lqfzkVaQji-ghc8.8.4.so: undefined symbol: clashzmpreludezm1zi3zi0zmBPZZ7kiQNy99ISBL1Pghy2m_ClashziAnnotationsziPrimitive_zdfDataPrimitiveGuard5_info
retroclash-lib > build (lib)
retroclash-lib > Preprocessing library for retroclash-lib-0.0.0..
retroclash-lib > Building library for retroclash-lib-0.0.0..
clash-shake > : /home/cactus/sdk/stack/snapshots/x86_64-linux-tinfo6/ec9124c0759d4a86157169cae10f6eb8fa7c593cc5806c7a1c85f1b2d4175440/8.8.4/lib/x86_64-linux-ghc-8.8.4/libHSclash-ghc-1.3.0-J8pqPdvV3DI3lqfzkVaQji-ghc8.8.4.so: undefined symbol: clashzmpreludezm1zi3zi0zmBPZZ7kiQNy99ISBL1Pghy2m_ClashziAnnotationsziPrimitive_zdfDataPrimitiveGuard5_info
retroclash-lib > : /home/cactus/sdk/stack/snapshots/x86_64-linux-tinfo6/ec9124c0759d4a86157169cae10f6eb8fa7c593cc5806c7a1c85f1b2d4175440/8.8.4/lib/x86_64-linux-ghc-8.8.4/libHSclash-ghc-1.3.0-J8pqPdvV3DI3lqfzkVaQji-ghc8.8.4.so: undefined symbol: clashzmpreludezm1zi3zi0zmBPZZ7kiQNy99ISBL1Pghy2m_ClashziAnnotationsziPrimitive_zdfDataPrimitiveGuard5_info
Progress 3/6

-- While building package clash-shake-0.0.0 (scroll up to its section to see the error) using:
/home/cactus/sdk/stack/setup-exe-cache/x86_64-linux-tinfo6/Cabal-simple_mPHDZzAJ_3.0.1.0_ghc-8.8.4 --builddir=.stack-work/dist/x86_64-linux-tinfo6/Cabal-3.0.1.0 build lib:clash-shake --ghc-options " -fdiagnostics-color=always"
Process exited with code: ExitFailure 1

-- While building package retroclash-lib-0.0.0 (scroll up to its section to see the error) using:
/home/cactus/sdk/stack/setup-exe-cache/x86_64-linux-tinfo6/Cabal-simple_mPHDZzAJ_3.0.1.0_ghc-8.8.4 --builddir=.stack-work/dist/x86_64-linux-tinfo6/Cabal-3.0.1.0 build lib:retroclash-lib --ghc-options " -fdiagnostics-color=always"
Process exited with code: ExitFailure 1

-- While building package clashilator-0.1.0 (scroll up to its section to see the error) using:
/home/cactus/sdk/stack/setup-exe-cache/x86_64-linux-tinfo6/Cabal-simple_mPHDZzAJ_3.0.1.0_ghc-8.8.4 --builddir=.stack-work/dist/x86_64-linux-tinfo6/Cabal-3.0.1.0 build lib:clashilator exe:clashilator --ghc-options " -fdiagnostics-color=always"
Process exited with code: ExitFailure 1
```

I tried removing `.stack-work` and `*/.stack-work`, but the problem persists. It seems like I would need to nuke `~/.stack/`, just like in the bad old Cabal days.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.