Skip to content

Commit db167ca

Browse files
authored
Merge pull request #10311 from alt-romes/wip/romes/9777
Custom-build: Document breaking change on built comps.
2 parents 3a6f73e + f501843 commit db167ca

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

release-notes/Cabal-3.12.0.0.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,42 @@ Cabal and Cabal-syntax 3.12.0.0 changelog and release notes
8383
8484
### Other changes
8585
86+
- Installing a library with a Custom setup no longer requires building the executable [#9777](https://github.com/haskell/cabal/issues/9777) [#9650](https://github.com/haskell/cabal/pull/9650) [#10311](https://github.com/haskell/cabal/pull/10311)
87+
88+
For example, if we have `pkg-a.cabal`:
89+
90+
```
91+
library
92+
build-depends: pkg-b
93+
```
94+
95+
and `pkg-b.cabal`:
96+
97+
```
98+
library
99+
exposed-modules: ...
100+
101+
executable pkg-b-exe
102+
main-is: ...
103+
```
104+
105+
106+
An invocation `cabal build pkg-a` will build `lib:pkg-a` and `lib:pkg-b`, but
107+
not `exe:pkg-b-exe` because it is not needed for building `pkg-a`! Previously the executable would be built unnecessarily.
108+
109+
If the invocation were `cabal build pkg-a exe:pkg-b-exe` then all `lib:pkg-a`, `lib:pkg-b`, and `exe:pkg-b-exe` would be built.
110+
111+
Note: There may be a package whose Custom setup expects the executable to be
112+
built together with the library always. Unfortunately, this is a breaking
113+
change for them. To migrate, packages should no longer assume the executable is
114+
built when only the library is requested (e.g. `cabal install --lib Agda` will
115+
*not* build the `Agda` executable, while `cabal install Agda` will).
116+
117+
Agda is an example of a package which expected in its `Setup.hs` copy hook the
118+
executable to already be built. This was fixed by inspecting the copy arguments
119+
and making sure we only use the executable when it is built, since it is only
120+
needed when the executable too is needed.
121+
86122
- `cabal init` should not suggest Cabal < 2.0 [#8680](https://github.com/haskell/cabal/issues/8680) [#8700](https://github.com/haskell/cabal/pull/8700)
87123
88124
'cabal init' no longer suggests users to set cabal-version to less than

0 commit comments

Comments
 (0)