haskell / haskell/cabal

[nix-local-build] Toggling --enable-tests triggers rebuild even with test target

Open
#3,342 1 comment 1 reaction 0 assignees View on GitHub
cabal-install: v2-build system type: bug
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

This bug applies even when patch #3341 is applied.

Steps to reproduce:
1. Create a package `foo` with a library and a test suite named `footest`
2. `cabal new-build --enable-tests footest`
3. `cabal new-build footest`

Expected result: (3) is a complete noop and we don't try to build the `foo` package

Actual result: Cabal attempts to build `footest` in `foo` (which turns out to be a no-op, but not until after it spends a lot of time pondering.)

Unfortunately, I don't know if this is actually bug. One could argue that all bets are off when you change the flags passed to `new-build`. But it still seems a bit fishy.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the two `cabal new-build` commands with a package containing `foo` and the `footest` test suite. Investigate the `nix-local-build` build-planning path and how changing `--enable-tests` affects the test target; done means the second command is a complete noop without attempting to build `foo`.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.