forked from haskell/cabal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace FilePath in PackageDB with SymbolicPath in Cabal
This refactoring enforces a simple property * We use symbolic paths in Cabal in order to represent that paths to package databases. These paths is relative to the package root. * We use normal filepaths in cabal-install to represent the path to a package database. These are relative to the current working directory. Paths are explicitly converted from one type to the other at the interface of `cabal-install` and `Cabal`, see `setupHsConfigureArgs` for where this happens. In order to achieve this `PackageDB` is abstracted over what the type of filepaths a specific package db points to. ``` type PackageDBX fp = ... | SpecificPackageDB fp | ... ``` If you are using the Cabal library then you probably want to migrate to use `PackageDBCWD` and `PackageDBStackCWD`. ``` type PackageDBCWD = PackageDBX FilePath type PackageDBStackCWD = [PackageDBCWD] ``` Then at the point where you call commands in the `Cabal` library convert these paths into paths relative to the root of the relevant package. The easiest way to do this is convert any paths into an absolute path. This patch fixes a double interpretation issue when the `--working-dir` option was used and package db paths were offset incorrectly.
- Loading branch information
1 parent
08f028f
commit 90fbf08
Showing
51 changed files
with
367 additions
and
318 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.