haskell / haskell/cabal

Refactor tests/benchmarks to be expanded at configure time

Open
#3,599 3 comments 0 reactions 0 assignees View on GitHub
Cabal: other
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

Presently, a test is expanded into a, e.g., library and executable, immediately before we build it. This is dumb. Let's expand it at configure-time. Then "building" a test suite and benchmark is a no-op, and these only matter when you run the subcommand in question.

I need this change so because the rewrite of `depLibraryPaths` in #3595 requires the component graph to make sense for any CLBI we pass it.

```
- let -- TODO: this is kind of inefficient
- internalDeps = [ cid
- | (cid, _) <- componentPackageDeps clbi
- -- Test that it's internal
- , (sub_clbi, _) <- componentsConfigs lbi
- , componentUnitId sub_clbi == cid ]
- internalLibs = [ getLibDir sub_clbi
- | sub_clbi <- componentsInBuildOrder'
- lbi internalDeps ]
+ let internalCLBIs = filter ((/= componentUnitId clbi) . componentUnitId)
+ . map targetCLBI
+ $ neededTargetsInBuildOrder lbi [componentUnitId clbi]
+ internalLibs = map getLibDir internalCLBIs
```

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.