haskell / haskell/cabal

`cabal build package-name` builds more than asked in multipackage project

Open
#6,468 1 comment 1 reaction 0 assignees View on GitHub
type: enhancement type: user-question
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

I am working on the [`co-log`](https://github.com/kowainik/co-log/) project which is a multipackage project. It has the following `cabal.project` file:

```
packages:
co-log-core
co-log
co-log-polysemy
co-log-benchmark
```

I want to build only `co-log-core`, `co-log` and `co-log-polysemy` packages on Appveyor's Windows machines (as `co-log-benchmark` is using `unix` library as a dependency). The command I run:

```
cabal v2-build co-log-core co-log co-log-polysemy
```

However, it starts to build `co-log-benchmark`:

```
[__2] trying: co-log-benchmark-0.0.0.0 (user goal)
```

and obviously fails.

How could I restrict the build of a certain package with Cabal?

## Expected behaviour

Cabal builds only those packages of the multipackage project that I specified in the command.

## System information

- Operating system: Windows
- `cabal-3.0.0.0`, `ghc-8.8.1`

## Additional context

Appveyor full output: https://ci.appveyor.com/project/kowainik/co-log/builds/29774908
Corresponding `co-log` PR: https://github.com/kowainik/co-log/pull/160

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.