cabal keeps relinking on FreeBSD in rebuilds and retests #2384

trygub opened this Issue Jan 23, 2015 · 1 comment


None yet

2 participants

trygub commented Jan 23, 2015

I ran the following five commands:

cabal clean
cabal build
cabal test
cabal build
cabal test

For the second build and test commands there are extra "Linking ..." messages when compared to the same output from a Linux box:


[1 of 1] Compiling CabalTest ( src/CabalTest.hs, dist/build/CabalTest.p_o )
[1 of 2] Compiling CabalTest ( src/CabalTest.hs, dist/build/cabalTest/cabalTest-tmp/CabalTest.p_o )
[2 of 2] Compiling Main ( src/cabalTest.hs, dist/build/cabalTest/cabalTest-tmp/Main.p_o )
< Linking dist/build/cabalTest/cabalTest ...

< [1 of 1] Compiling Main ( test/cabalTest.hs, dist/build/CabalTestTest/CabalTestTest-tmp/Main.o )

[1 of 1] Compiling Main ( test/cabalTest.hs, dist/build/CabalTestTest/CabalTestTest-tmp/Main.p_o )
< Linking dist/build/cabalTest/cabalTest ...
< Linking dist/build/CabalTestTest/CabalTestTest ...
< Linking dist/build/cabalTest/cabalTest ...
< Linking dist/build/CabalTestTest/CabalTestTest ...

This was discussed on Haskell-Cafe (post with subject "cabal keeps relinking").

I've re-run the test since then with the latest cabal

cabal --version
cabal-install version
using version of the Cabal library

, and the problem is still present (although one Linking ... line has disappeared when moving from 1.20):

There's an improvement in both "cabal test" steps when moving to 1.22 in the sense
that the following lines have disappeared:

Building cabalTest-
Preprocessing executable 'cabalTest' for cabalTest-
Linking dist/build/cabalTest/cabalTest ...

(i.e., when running test target the exe itself (named cabalTest) is no longer relinked unnecessarily,
only the test for it (named cabalTestTest).

However, when compared with old output on Linux there are still some
extra relinks present:

For the second run of "cabal bulid" I still see

Linking dist/build/cabalTest/cabalTest …
Linking dist/build/CabalTestTest/CabalTestTest …

For the second run of "cabal test" I still see

Linking dist/build/CabalTestTest/CabalTestTest ...

So it seems that the problem is still present in the latest version.

ttuegel commented Apr 24, 2015

Do you see extra relinking steps on FreeBSD when using GHC by itself? IIRC Cabal does not control when GHC chooses to relink.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment