Make Cabal agnostic about working directory
This commit makes the library functions in Cabal agnostic of the working directory. In practice, this means that we distinguish `FilePath`s from un-interpreted `SymbolicPath`s. The latter may be paths that are relative to the working directory, and need to be interpreted with respect to a passed-in argument specifying the working directory, instead of using the working directory of the current process. See Note [Symbolic paths] in Distribution.Utils.Path. In particular, paths in the package description now use the SymbolicPath abstraction, which allows specifying whether they are allowed to be absolute, and, if they are relative, what they are relative to. For example, source files are relative to a source search directory, data files are relative to the data directory, and doc files are relative to the package root. Fixes #9702
Showing
- Cabal-described/src/Distribution/Described.hs 13 additions, 6 deletionsCabal-described/src/Distribution/Described.hs
- Cabal-syntax/Cabal-syntax.cabal 7 additions, 1 deletionCabal-syntax/Cabal-syntax.cabal
- Cabal-syntax/src/Distribution/FieldGrammar/Newtypes.hs 40 additions, 0 deletionsCabal-syntax/src/Distribution/FieldGrammar/Newtypes.hs
- Cabal-syntax/src/Distribution/PackageDescription/Configuration.hs 1 addition, 1 deletion...ntax/src/Distribution/PackageDescription/Configuration.hs
- Cabal-syntax/src/Distribution/PackageDescription/FieldGrammar.hs 83 additions, 85 deletions...yntax/src/Distribution/PackageDescription/FieldGrammar.hs
- Cabal-syntax/src/Distribution/Types/BenchmarkInterface.hs 3 additions, 1 deletionCabal-syntax/src/Distribution/Types/BenchmarkInterface.hs
- Cabal-syntax/src/Distribution/Types/BuildInfo.hs 18 additions, 15 deletionsCabal-syntax/src/Distribution/Types/BuildInfo.hs
- Cabal-syntax/src/Distribution/Types/BuildInfo/Lens.hs 16 additions, 14 deletionsCabal-syntax/src/Distribution/Types/BuildInfo/Lens.hs
- Cabal-syntax/src/Distribution/Types/Executable.hs 11 additions, 3 deletionsCabal-syntax/src/Distribution/Types/Executable.hs
- Cabal-syntax/src/Distribution/Types/Executable/Lens.hs 4 additions, 1 deletionCabal-syntax/src/Distribution/Types/Executable/Lens.hs
- Cabal-syntax/src/Distribution/Types/ForeignLib.hs 3 additions, 1 deletionCabal-syntax/src/Distribution/Types/ForeignLib.hs
- Cabal-syntax/src/Distribution/Types/ForeignLib/Lens.hs 4 additions, 1 deletionCabal-syntax/src/Distribution/Types/ForeignLib/Lens.hs
- Cabal-syntax/src/Distribution/Types/PackageDescription.hs 10 additions, 7 deletionsCabal-syntax/src/Distribution/Types/PackageDescription.hs
- Cabal-syntax/src/Distribution/Types/PackageDescription/Lens.hs 8 additions, 7 deletions...-syntax/src/Distribution/Types/PackageDescription/Lens.hs
- Cabal-syntax/src/Distribution/Types/TestSuiteInterface.hs 3 additions, 1 deletionCabal-syntax/src/Distribution/Types/TestSuiteInterface.hs
- Cabal-syntax/src/Distribution/Utils/Path.hs 434 additions, 48 deletionsCabal-syntax/src/Distribution/Utils/Path.hs
- Cabal-tests/Cabal-tests.cabal 1 addition, 1 deletionCabal-tests/Cabal-tests.cabal
- Cabal-tests/lib/Test/Utils/TempTestDir.hs 2 additions, 3 deletionsCabal-tests/lib/Test/Utils/TempTestDir.hs
- Cabal-tests/tests/NoThunks.hs 3 additions, 2 deletionsCabal-tests/tests/NoThunks.hs
- Cabal-tests/tests/ParserTests/regressions/Octree-0.5.expr 4 additions, 3 deletionsCabal-tests/tests/ParserTests/regressions/Octree-0.5.expr
Loading
Please register or sign in to comment