Skip to content

Commit

Permalink
Add migration guide for #9718 (#10578)
Browse files Browse the repository at this point in the history
* Remove duplicated “Other changes” subtitle

* Add migration guide for #9718

PR #9718 and related PRs reshuffled and refactored Cabal API.
This patch adds a simple migration guide for Cabal library
users.

Authored-by: Maxim Ivanov

* Update release-notes/Cabal-3.14.0.0.md

Co-authored-by: Maxim Ivanov <[email protected]>

---------

Co-authored-by: Maxim Ivanov <[email protected]>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Nov 30, 2024
1 parent 8144494 commit 3917567
Showing 1 changed file with 52 additions and 2 deletions.
54 changes: 52 additions & 2 deletions release-notes/Cabal-3.14.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ Cabal and Cabal-syntax 3.14.0.0 changelog and release notes

* `extra-doc-files`: Copied by Haddock to the html directory.

### Other changes

- Include package version when passing `--promised-dependency` flag [#10166](https://github.com/haskell/cabal/issues/10166) [#10248](https://github.com/haskell/cabal/pull/10248)

The `--promised-dependency` flag now expects an argument in the format
Expand Down Expand Up @@ -157,6 +155,58 @@ Cabal and Cabal-syntax 3.14.0.0 changelog and release notes
configure"). This has recently caught out even Cabal devs. Clarify these
messages. [#9476](https://github.com/haskell/cabal/pull/9476)

- In [#9718](https://github.com/haskell/cabal/pull/9718) constructors
`PackageDB`: `GlobalPackageDB`, `UserPackageDB`, `SpecificPackageDB` have
been moved to an auxiliary datatatype `PackageDBX`.

Change imports:

```haskell
import Distribution.Simple.Compiler
(PackageDB, PackageDBX (GlobalPackageDB,
UserPackageDB,
SpecificPackageDB))
```

- **Fields of `ConfigFlags`, `BuildFlags`, `InstallFlags`, `TestFlags`,
`BenchmarkFlags`, `HaddockFlags`, `HscolourFlags`, `SDistFlags`,
`CopyFlags`, `RegisterFlags`, `CleanFlags`, `ReplFlags`**

These fields have partially moved to `CommonFlags`. Use corresponding
pattern synonyms and/or Monoid instance of `CommonSetupFlags`.

Example for haddock command:

```diff
import Distribution.Simple.Setup (HaddockFlags(..))
+import Distribution.Simple.Setup.Common (CommonSetupFlags(..))

example =
someHaddockFlags
- { haddockVerbosity = a
- , haddockTargets = b
+ { haddockCommonFlags = mempty
+ { setupVerbosity = a
+ , setupTargets = b
+ }
}
```

- **Additions to `SymbolicPath`, `RelativePath`**

Module
[Distribution.Utils.Path](https://hackage.haskell.org/package/Cabal-syntax-3.14.0.0/docs/Distribution-Utils-Path.html),
now provides more nuanced API that Cabal uses to keep track of filepath
locations. (Hopefully, avoiding confusion which things should go where and
how.)

In your specific circumstance, you'll need to decide how much of that nuance
to keep. The function `getSymbolicPath` discards all of it, getting back the
raw `FilePath`; but see the linked module's haddocks for caveats and less
drastic options.

It may help to introduce a `CompatSymPath` typeclass.

- Update the SPDX License List to version 3.25

The LicenseId and LicenseExceptionId types are updated to reflect the SPDX
Expand Down

0 comments on commit 3917567

Please sign in to comment.