cabal keeps relinking on FreeBSD in rebuilds and retests
- Dominant language
- Haskell
- Stars
- 1.7k
- Forks
- 750
- Avg merge
- 4d 3h
- Merged PRs (30d)
- 28
Description
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:
10a11
> [1 of 1] Compiling CabalTest ( src/CabalTest.hs, dist/build/CabalTest.p_o )
> 14a16,17
> [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 )
> 25d27
> < Linking dist/build/cabalTest/cabalTest ...
> 27c29
> ## < [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 )
> 39d40
> < Linking dist/build/cabalTest/cabalTest ...
> 41d41
> < Linking dist/build/CabalTestTest/CabalTestTest ...
> 47d46
> < Linking dist/build/cabalTest/cabalTest ...
> 49d47
> < 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 1.22.0.0
using version 1.22.0.0 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-0.1.0.0...
Preprocessing executable 'cabalTest' for cabalTest-0.1.0.0...
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.
Contributor guide
Research direction
Reproduce the five-command sequence with Cabal 1.22.0.0 on FreeBSD and compare its build and test output with the Linux output described in the issue. Trace why the second build and test runs relink the listed executables; done means repeated builds and tests avoid those unnecessary Linking messages.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100