haskell / haskell/cabal

cabal fails to recompile test when quasiquoter changes

Open
#2,723 9 comments 0 reactions 0 assignees View on GitHub
blocked: info-needed Cabal: cmd/test type: bug
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

Using cabal `1.22.6.0`, building https://github.com/shlevy/ip-quoter/tree/v1.0.1.1 (I tried making a minimal test case but failed to reproduce the issue):
1. `$ cabal clean`
2. `$ cabal configure --enable-tests`
3. `$ cabal build`
4. `$ cabal test`

> Preprocessing library ip-quoter-1.0.1.1...
> In-place registering ip-quoter-1.0.1.1...
> Preprocessing test suite 'test' for ip-quoter-1.0.1.1...
> Running 1 test suites...
> Test suite test: RUNNING...
> Test suite test: PASS
> Test suite logged to: dist/test/ip-quoter-1.0.1.1-test.log
> 1 of 1 test suites (1 of 1 test cases) passed.
5. Change https://github.com/shlevy/ip-quoter/blob/v1.0.1.1/Network/IP/Quoter.hs#L46 to `hostW32 = (fromBE32 addr) + 1`
6. `$ cabal build`
7. `$ cabal test`

> Preprocessing library ip-quoter-1.0.1.1...
> In-place registering ip-quoter-1.0.1.1...
> Preprocessing test suite 'test' for ip-quoter-1.0.1.1...
> Running 1 test suites...
> Test suite test: RUNNING...
> Test suite test: PASS
> Test suite logged to: dist/test/ip-quoter-1.0.1.1-test.log
> 1 of 1 test suites (1 of 1 test cases) passed.
8. `$ cabal clean`
9. `$ cabal configure --enable-tests`
10. `$ cabal build`
11. `$ cabal test`

> Preprocessing library ip-quoter-1.0.1.1...
> In-place registering ip-quoter-1.0.1.1...
> Preprocessing test suite 'test' for ip-quoter-1.0.1.1...
> Running 1 test suites...
> Test suite test: RUNNING...
> tests
> localhost: FAIL
> expected: 33554559
> but got: 16777343
> v6localhost: OK
>
> 1 out of 2 tests failed (0.00s)
> Test suite test: FAIL
> Test suite logged to: dist/test/ip-quoter-1.0.1.1-test.log
> 0 of 1 test suites (0 of 1 test cases) passed.

The failure in step 11 is **expected**. The success in step 7 is **erroneous**.

Contributor guide

Open the contributing guide

Research direction

Reproduce the sequence in the issue using the linked ip-quoter example, focusing on the change to Network/IP/Quoter.hs and the differing results from cabal build followed by cabal test. Trace Cabal's recompilation and test dependency handling. Done means the changed quasiquoter causes the test to rerun and report the expected failure without requiring cabal clean.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
build-system, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.