diff --git a/Cabal.cabal b/Cabal.cabal
--- a/Cabal.cabal
+++ b/Cabal.cabal
@@ -1,6 +1,6 @@
 cabal-version: >=1.10
 name:          Cabal
-version:       3.2.0.0
+version:       3.2.1.0
 copyright:     2003-2020, Cabal Development Team (see AUTHORS file)
 license:       BSD3
 license-file:  LICENSE
@@ -133,6 +133,8 @@
   tests/ParserTests/regressions/common3.format
   tests/ParserTests/regressions/cxx-options-with-optimization.cabal
   tests/ParserTests/regressions/cxx-options-with-optimization.check
+  tests/ParserTests/regressions/denormalised-paths.cabal
+  tests/ParserTests/regressions/denormalised-paths.check
   tests/ParserTests/regressions/elif.cabal
   tests/ParserTests/regressions/elif.expr
   tests/ParserTests/regressions/elif.format
@@ -279,7 +281,7 @@
     filepath   >= 1.3.0.1  && < 1.5,
     pretty     >= 1.1.1    && < 1.2,
     process    >= 1.1.0.2  && < 1.7,
-    time       >= 1.4.0.1  && < 1.10
+    time       >= 1.4.0.1  && < 1.11
 
   if flag(bundled-binary-generic)
     build-depends: binary >= 0.5.1.1 && < 0.7
@@ -287,7 +289,7 @@
     build-depends: binary >= 0.7 && < 0.9
 
   if os(windows)
-    build-depends: Win32 >= 2.3.0.0 && < 2.9
+    build-depends: Win32 >= 2.3.0.0 && < 2.11
   else
     build-depends: unix  >= 2.6.0.0 && < 2.8
 
@@ -334,6 +336,7 @@
     Distribution.Compat.Newtype
     Distribution.Compat.ResponseFile
     Distribution.Compat.Prelude.Internal
+    Distribution.Compat.Process
     Distribution.Compat.Semigroup
     Distribution.Compat.Stack
     Distribution.Compat.Time
@@ -635,7 +638,7 @@
     directory,
     filepath,
     integer-logarithms >= 1.0.2 && <1.1,
-    tasty >= 1.2.3 && < 1.3,
+    tasty >= 1.2.3 && < 1.4,
     tasty-hunit,
     tasty-quickcheck,
     tagged,
@@ -643,7 +646,7 @@
     text,
     pretty,
     Diff >=0.4 && <0.5,
-    QuickCheck >= 2.13.2 && < 2.14,
+    QuickCheck >= 2.14 && < 2.15,
     Cabal
   ghc-options: -Wall
   default-language: Haskell2010
@@ -658,7 +661,7 @@
     bytestring,
     directory,
     filepath,
-    tasty >= 1.2.3 && < 1.3,
+    tasty >= 1.2.3 && < 1.4,
     tasty-hunit,
     tasty-quickcheck,
     tasty-golden >=2.3.1.1 && <2.4,
@@ -688,7 +691,7 @@
     bytestring,
     directory,
     filepath,
-    tasty >= 1.2.3 && < 1.3,
+    tasty >= 1.2.3 && < 1.4,
     tasty-golden >=2.3.1.1 && <2.4,
     Diff >=0.4 && <0.5,
     Cabal
@@ -762,7 +765,7 @@
     bytestring
 
   build-depends:
-    tasty >= 1.2.3 && < 1.3,
+    tasty >= 1.2.3 && < 1.4,
     tasty-hunit,
     tasty-quickcheck,
     QuickCheck
diff --git a/ChangeLog.md b/ChangeLog.md
--- a/ChangeLog.md
+++ b/ChangeLog.md
@@ -1,3 +1,11 @@
+# 3.2.1.0 [Oleg Grenrus](mailto:oleg.grenris@iki.fi) October 2020
+  * Pass `cxx-options` with `-optcxx` for GHC >= 8.10
+  * Use process jobs when calling subprocesses
+  * Require custom-setup for `cabal-version: 1.24` and later
+  * Accept `linux-androideabi` as an alias for Android
+  * Fix ghci being launched before other sources are built 
+  * Require cabal-versions >=1.25 to be exact
+
 # 3.2.0.0 [Herbert Valerio Riedel](mailto:hvr@gnu.org) April 2020
   * Change free text `String` fields to use `ShortText` in package description
     and installed packge info.
@@ -24,6 +32,21 @@
 # 3.0.1.0 [Herbert Valerio Riedel](mailto:hvr@gnu.org) April 2020
   * Add GHC-8.8 flags to `normaliseGhcFlags`
     ([#6379](https://github.com/haskell/cabal/pull/6379)).
+    `Language.Haskell.Extension`
+  * Use more `NonEmpty` instead of ordinary lists
+  * Add `Distribution.Utils.Structured` for fingeprinting `Binary` blobs
+  * Add `null`, `length` and `unsafeFromUTF8BS` to `Distribution.Utils.ShortText`
+  * Refactor `Distribution.Utils.IOData` module
+  * Rename `Distribution.Compat.MD5` to `Distribution.Utils.MD5`
+  * Add `safeHead`, `safeTail`, `safeLast` to `Distribution.Utils.Generic`
+  * Add `unsnoc` and `unsnocNE` to `Distribution.Utils.Generic`
+  * Add `Set'` modifier to `Distribution.Parsec.Newtypes`
+  * Add `Distribution.Compat.Async`
+  * Add `Distribution.Compat.Process` with `enableProcessJobs`
+
+# 3.0.1.0 TBW
+  * Add GHC-8.8 flags to normaliseGhcFlags
+    ([#6379](https://github.com/haskell/cabal/pull/6379))
   * Typo fixes
     ([#6372](https://github.com/haskell/cabal/pull/6372)).
   * Limit version number parts to contain at most 9 digits
diff --git a/Distribution/CabalSpecVersion.hs b/Distribution/CabalSpecVersion.hs
--- a/Distribution/CabalSpecVersion.hs
+++ b/Distribution/CabalSpecVersion.hs
@@ -53,21 +53,61 @@
 
 cabalSpecFromVersionDigits :: [Int] -> CabalSpecVersion
 cabalSpecFromVersionDigits v
-    | v >= [2,5]  = CabalSpecV3_0
-    | v >= [2,3]  = CabalSpecV2_4
-    | v >= [2,1]  = CabalSpecV2_2
-    | v >= [1,25] = CabalSpecV2_0
-    | v >= [1,23] = CabalSpecV1_24
-    | v >= [1,21] = CabalSpecV1_22
-    | v >= [1,19] = CabalSpecV1_20
-    | v >= [1,17] = CabalSpecV1_18
-    | v >= [1,11] = CabalSpecV1_12
-    | v >= [1,9]  = CabalSpecV1_10
-    | v >= [1,7]  = CabalSpecV1_8
-    | v >= [1,5]  = CabalSpecV1_6
-    | v >= [1,3]  = CabalSpecV1_4
-    | v >= [1,1]  = CabalSpecV1_2
-    | otherwise   = CabalSpecV1_0
+    = fromMaybe cabalSpecLatest (cabalSpecFromVersionDigitsMaybe v)
+
+cabalSpecFromVersionDigitsMaybe :: [Int] -> Maybe CabalSpecVersion
+cabalSpecFromVersionDigitsMaybe v
+    | v == [3,0]  = Just CabalSpecV3_0
+    | v == [2,4]  = Just CabalSpecV2_4
+    | v == [2,2]  = Just CabalSpecV2_2
+    | v == [2,0]  = Just CabalSpecV2_0
+    | v >= [1,25] = Nothing
+    | v >= [1,23] = Just CabalSpecV1_24
+    | v >= [1,21] = Just CabalSpecV1_22
+    | v >= [1,19] = Just CabalSpecV1_20
+    | v >= [1,17] = Just CabalSpecV1_18
+    | v >= [1,11] = Just CabalSpecV1_12
+    | v >= [1,9]  = Just CabalSpecV1_10
+    | v >= [1,7]  = Just CabalSpecV1_8
+    | v >= [1,5]  = Just CabalSpecV1_6
+    | v >= [1,3]  = Just CabalSpecV1_4
+    | v >= [1,1]  = Just CabalSpecV1_2
+    | otherwise   = Just CabalSpecV1_0
+
+cabalSpecToVersionDigits :: CabalSpecVersion -> [Int]
+cabalSpecToVersionDigits CabalSpecV3_0   = [3,0]
+cabalSpecToVersionDigits CabalSpecV2_4   = [2,4]
+cabalSpecToVersionDigits CabalSpecV2_2   = [2,2]
+cabalSpecToVersionDigits CabalSpecV2_0   = [2,0]
+cabalSpecToVersionDigits CabalSpecV1_24  = [1,24]
+cabalSpecToVersionDigits CabalSpecV1_22  = [1,22]
+cabalSpecToVersionDigits CabalSpecV1_20  = [1,20]
+cabalSpecToVersionDigits CabalSpecV1_18  = [1,18]
+cabalSpecToVersionDigits CabalSpecV1_12  = [1,12]
+cabalSpecToVersionDigits CabalSpecV1_10  = [1,10]
+cabalSpecToVersionDigits CabalSpecV1_8   = [1,8]
+cabalSpecToVersionDigits CabalSpecV1_6   = [1,6]
+cabalSpecToVersionDigits CabalSpecV1_4   = [1,4]
+cabalSpecToVersionDigits CabalSpecV1_2   = [1,2]
+cabalSpecToVersionDigits CabalSpecV1_0   = [1,0]
+
+-- | What is the minimum Cabal library version which knows how handle
+-- this spec version.
+--
+-- /Note:/ this is a point where we could decouple cabal-spec and Cabal
+-- versions, if we ever want that.
+--
+-- >>> cabalSpecMinimumLibraryVersion CabalSpecV3_0
+-- [2,5]
+--
+-- >>> cabalSpecMinimumLibraryVersion CabalSpecV2_4
+-- [2,3]
+--
+cabalSpecMinimumLibraryVersion :: CabalSpecVersion -> [Int]
+cabalSpecMinimumLibraryVersion CabalSpecV1_0 = [1,0]
+cabalSpecMinimumLibraryVersion csv = case cabalSpecToVersionDigits (pred csv) of
+    [x,y] -> [x, y+1]
+    xs    -> xs
 
 specHasCommonStanzas :: CabalSpecVersion -> HasCommonStanzas
 specHasCommonStanzas v =
diff --git a/Distribution/Compat/Process.hs b/Distribution/Compat/Process.hs
new file mode 100644
--- /dev/null
+++ b/Distribution/Compat/Process.hs
@@ -0,0 +1,82 @@
+{-# LANGUAGE CPP #-}
+module Distribution.Compat.Process (
+    -- * Redefined functions
+    createProcess,
+    runInteractiveProcess,
+    rawSystem,
+    -- * Additions
+    enableProcessJobs,
+    ) where
+
+import System.Exit (ExitCode (..))
+import System.IO   (Handle)
+
+import           System.Process (CreateProcess, ProcessHandle)
+import qualified System.Process as Process
+
+#if MIN_VERSION_process(1,2,0)
+import           System.Process (waitForProcess)
+#endif
+
+-------------------------------------------------------------------------------
+-- enableProcessJobs
+-------------------------------------------------------------------------------
+
+-- | Enable process jobs to ensure accurate determination of process completion
+-- in the presence of @exec(3)@ on Windows.
+--
+-- Unfortunately the process job support is badly broken in @process@ releases
+-- prior to 1.6.8, so we disable it in these versions, despite the fact that
+-- this means we may see sporatic build failures without jobs.
+enableProcessJobs :: CreateProcess -> CreateProcess
+#ifdef MIN_VERSION_process
+#if MIN_VERSION_process(1,6,8)
+enableProcessJobs cp = cp {Process.use_process_jobs = True}
+#else
+enableProcessJobs cp = cp
+#endif
+#else
+enableProcessJobs cp = cp
+#endif
+
+-------------------------------------------------------------------------------
+-- process redefinitions
+-------------------------------------------------------------------------------
+
+-- | 'System.Process.createProcess' with process jobs enabled when appropriate.
+-- See 'enableProcessJobs'.
+createProcess :: CreateProcess
+              -> IO (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle)
+createProcess = Process.createProcess . enableProcessJobs
+
+-- | 'System.Process.rawSystem' with process jobs enabled when appropriate.
+-- See 'enableProcessJobs'.
+rawSystem :: String -> [String] -> IO ExitCode
+rawSystem cmd args = do
+#if MIN_VERSION_process(1,2,0)
+  (_,_,_,p) <- createProcess (Process.proc cmd args) { Process.delegate_ctlc = True }
+  waitForProcess p
+#else
+  -- With very old 'process', just do its rawSystem
+  Process.rawSystem cmd args
+#endif
+
+-- | 'System.Process.runInteractiveProcess' with process jobs enabled when
+-- appropriate. See 'enableProcessJobs'.
+runInteractiveProcess
+  :: FilePath                   -- ^ Filename of the executable (see 'RawCommand' for details)
+  -> [String]                   -- ^ Arguments to pass to the executable
+  -> Maybe FilePath             -- ^ Optional path to the working directory
+  -> Maybe [(String,String)]    -- ^ Optional environment (otherwise inherit)
+  -> IO (Handle,Handle,Handle,ProcessHandle)
+runInteractiveProcess cmd args mb_cwd mb_env = do
+  (mb_in, mb_out, mb_err, p) <-
+      createProcess (Process.proc cmd args)
+              { Process.std_in  = Process.CreatePipe,
+                Process.std_out = Process.CreatePipe,
+                Process.std_err = Process.CreatePipe,
+                Process.env     = mb_env,
+                Process.cwd     = mb_cwd }
+  return (fromJust mb_in, fromJust mb_out, fromJust mb_err, p)
+  where
+    fromJust = maybe (error "runInteractiveProcess: fromJust") id
diff --git a/Distribution/PackageDescription/Check.hs b/Distribution/PackageDescription/Check.hs
--- a/Distribution/PackageDescription/Check.hs
+++ b/Distribution/PackageDescription/Check.hs
@@ -79,6 +79,9 @@
 import qualified Distribution.Types.GenericPackageDescription.Lens as L
 import qualified Distribution.Types.PackageDescription.Lens        as L
 
+-- $setup
+-- >>> import Control.Arrow ((&&&))
+
 -- | Results of some kind of failed package check.
 --
 -- There are a range of severities, from merely dubious to totally insane.
@@ -773,6 +776,16 @@
   , check (maybe False isAbsoluteOnAnyPlatform (repoSubdir repo)) $
       PackageDistInexcusable
         "The 'subdir' field of a source-repository must be a relative path."
+
+  , check (maybe False isAbsoluteOnAnyPlatform (repoSubdir repo)) $
+      PackageDistInexcusable
+        "The 'subdir' field of a source-repository must be a relative path."
+
+  , do
+      subdir <- repoSubdir repo
+      err    <- isGoodRelativeDirectoryPath subdir
+      return $ PackageDistInexcusable $
+        "The 'subdir' field of a source-repository is not a good relative path: " ++ show err
   ]
   | repo <- sourceRepos pkg ]
 
@@ -1049,27 +1062,42 @@
 
   where (badFlags, goodFlags) = unzip flags
 
+data PathKind
+    = PathKindFile
+    | PathKindDirectory
+    | PathKindGlob
+
 checkPaths :: PackageDescription -> [PackageCheck]
 checkPaths pkg =
   [ PackageBuildWarning $
-         quote (kind ++ ": " ++ path)
+         quote (field ++ ": " ++ path)
       ++ " is a relative path outside of the source tree. "
       ++ "This will not work when generating a tarball with 'sdist'."
-  | (path, kind) <- relPaths ++ absPaths
+  | (path, field, _) <- relPaths ++ absPaths
   , isOutsideTree path ]
   ++
   [ PackageDistInexcusable $
-      quote (kind ++ ": " ++ path) ++ " is an absolute path."
-  | (path, kind) <- relPaths
+      quote (field ++ ": " ++ path) ++ " is an absolute path."
+  | (path, field, _) <- relPaths
   , isAbsoluteOnAnyPlatform path ]
   ++
   [ PackageDistInexcusable $
-         quote (kind ++ ": " ++ path) ++ " points inside the 'dist' "
+      quote (field ++ ": " ++ path) ++ " is not good relative path: " ++ err
+  | (path, field, kind) <- relPaths
+  -- these are not paths, but globs...
+  , err <- maybeToList $ case kind of
+      PathKindFile      -> isGoodRelativeFilePath path
+      PathKindGlob      -> isGoodRelativeGlob path
+      PathKindDirectory -> isGoodRelativeDirectoryPath path
+  ]
+  ++
+  [ PackageDistInexcusable $
+         quote (field ++ ": " ++ path) ++ " points inside the 'dist' "
       ++ "directory. This is not reliable because the location of this "
       ++ "directory is configurable by the user (or package manager). In "
       ++ "addition the layout of the 'dist' directory is subject to change "
       ++ "in future versions of Cabal."
-  | (path, kind) <- relPaths ++ absPaths
+  | (path, field, _) <- relPaths ++ absPaths
   , isInsideDist path ]
   ++
   [ PackageDistInexcusable $
@@ -1109,29 +1137,34 @@
       "dist"    :_ -> True
       ".":"dist":_ -> True
       _            -> False
+
     -- paths that must be relative
+    relPaths :: [(FilePath, String, PathKind)]
     relPaths =
-         [ (path, "extra-source-files") | path <- extraSrcFiles pkg ]
-      ++ [ (path, "extra-tmp-files")    | path <- extraTmpFiles pkg ]
-      ++ [ (path, "extra-doc-files")    | path <- extraDocFiles pkg ]
-      ++ [ (path, "data-files")         | path <- dataFiles     pkg ]
-      ++ [ (path, "data-dir")           | path <- [dataDir      pkg]]
-      ++ [ (path, "license-file")       | path <- licenseFiles  pkg ]
+         [ (path, "extra-source-files", PathKindGlob) | path <- extraSrcFiles pkg ]
+      ++ [ (path, "extra-tmp-files", PathKindFile)    | path <- extraTmpFiles pkg ]
+      ++ [ (path, "extra-doc-files", PathKindGlob)    | path <- extraDocFiles pkg ]
+      ++ [ (path, "data-files", PathKindGlob)         | path <- dataFiles     pkg ]
+      ++ [ (path, "data-dir", PathKindDirectory)           | path <- [dataDir      pkg]]
+      ++ [ (path, "license-file", PathKindFile)       | path <- licenseFiles  pkg ]
       ++ concat
-         [    [ (path, "asm-sources")      | path <- asmSources      bi ]
-           ++ [ (path, "cmm-sources")      | path <- cmmSources      bi ]
-           ++ [ (path, "c-sources")        | path <- cSources        bi ]
-           ++ [ (path, "cxx-sources")      | path <- cxxSources      bi ]
-           ++ [ (path, "js-sources")       | path <- jsSources       bi ]
-           ++ [ (path, "install-includes") | path <- installIncludes bi ]
-           ++ [ (path, "hs-source-dirs")   | path <- hsSourceDirs    bi ]
+         [    [ (path, "asm-sources", PathKindFile)      | path <- asmSources      bi ]
+           ++ [ (path, "cmm-sources", PathKindFile)      | path <- cmmSources      bi ]
+           ++ [ (path, "c-sources", PathKindFile)        | path <- cSources        bi ]
+           ++ [ (path, "cxx-sources", PathKindFile)      | path <- cxxSources      bi ]
+           ++ [ (path, "js-sources", PathKindFile)       | path <- jsSources       bi ]
+           ++ [ (path, "install-includes", PathKindFile) | path <- installIncludes bi ]
+           ++ [ (path, "hs-source-dirs", PathKindDirectory)   | path <- hsSourceDirs    bi ]
          | bi <- allBuildInfo pkg ]
+
     -- paths that are allowed to be absolute
+    absPaths :: [(FilePath, String, PathKind)]
     absPaths = concat
-      [    [ (path, "includes")         | path <- includes        bi ]
-        ++ [ (path, "include-dirs")     | path <- includeDirs     bi ]
-        ++ [ (path, "extra-lib-dirs")   | path <- extraLibDirs    bi ]
-      | bi <- allBuildInfo pkg ]
+      [ [ (path, "includes",       PathKindFile)      | path <- includes     bi ] ++
+        [ (path, "include-dirs",   PathKindDirectory) | path <- includeDirs  bi ] ++
+        [ (path, "extra-lib-dirs", PathKindDirectory) | path <- extraLibDirs bi ]
+      | bi <- allBuildInfo pkg
+      ]
 
 --TODO: check sets of paths that would be interpreted differently between Unix
 -- and windows, ie case-sensitive or insensitive. Things that might clash, or
@@ -2285,3 +2318,246 @@
     extension = takeExtension path
     isHaskell = extension `elem` [".hs", ".lhs"]
     isC       = isJust (filenameCDialect extension)
+
+-- | Whether a path is a good relative path.
+--
+-- >>> let test fp = putStrLn $ show (isGoodRelativeDirectoryPath fp) ++ "; " ++ show (isGoodRelativeFilePath fp)
+--
+-- >>> test "foo/bar/quu"
+-- Nothing; Nothing
+--
+-- Trailing slash is not allowed for files, for directories it is ok.
+--
+-- >>> test "foo/"
+-- Nothing; Just "trailing slash"
+--
+-- Leading @./@ is fine, but @.@ and @./@ are not valid files.
+--
+-- >>> traverse_ test [".", "./", "./foo/bar"]
+-- Nothing; Just "trailing dot segment"
+-- Nothing; Just "trailing slash"
+-- Nothing; Nothing
+--
+-- Lastly, not good file nor directory cases:
+--
+-- >>> traverse_ test ["", "/tmp/src", "foo//bar", "foo/.", "foo/./bar", "foo/../bar", "foo*bar"]
+-- Just "empty path"; Just "empty path"
+-- Just "posix absolute path"; Just "posix absolute path"
+-- Just "empty path segment"; Just "empty path segment"
+-- Just "trailing same directory segment: ."; Just "trailing same directory segment: ."
+-- Just "same directory segment: ."; Just "same directory segment: .."
+-- Just "parent directory segment: .."; Just "parent directory segment: .."
+-- Just "reserved character '*'"; Just "reserved character '*'"
+--
+-- For the last case, 'isGoodRelativeGlob' doesn't warn:
+--
+-- >>> traverse_ (print . isGoodRelativeGlob) ["foo/../bar", "foo*bar"]
+-- Just "parent directory segment: .."
+-- Nothing
+--
+isGoodRelativeFilePath :: FilePath -> Maybe String
+isGoodRelativeFilePath = state0
+  where
+    -- Reserved characters
+    -- https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
+    isReserved c = c `elem` "<>:\"\\/|?*"
+
+    -- initial state
+    state0 []                    = Just "empty path"
+    state0 (c:cs) | c == '.'     = state1 cs
+                  | c == '/'     = Just "posix absolute path"
+                  | isReserved c = Just ("reserved character " ++ show c)
+                  | otherwise    = state3 cs
+
+    -- after .
+    state1 []                    = Just "trailing dot segment"
+    state1 (c:cs) | c == '.'     = state4 cs
+                  | c == '/'     = state2 cs
+                  | isReserved c = Just ("reserved character " ++ show c)
+                  | otherwise    = state5 cs
+
+    -- after ./
+    state2 []                    = Just "trailing slash"
+    state2 (c:cs) | c == '.'     = state3 cs
+                  | c == '/'     = Just "empty path segment"
+                  | isReserved c = Just ("reserved character " ++ show c)
+                  | otherwise    = state5 cs
+
+    -- after non-first segment's .
+    state3 []                    = Just "trailing same directory segment: ."
+    state3 (c:cs) | c == '.'     = state4 cs
+                  | c == '/'     = Just "same directory segment: .."
+                  | isReserved c = Just ("reserved character " ++ show c)
+                  | otherwise    = state5 cs
+
+    -- after non-first segment's ..
+    state4 []                    = Just "trailing parent directory segment: .."
+    state4 (c:cs) | c == '.'     = state5 cs
+                  | c == '/'     = Just "parent directory segment: .."
+                  | isReserved c = Just ("reserved character " ++ show c)
+                  | otherwise    = state5 cs
+
+    -- in a segment which is ok.
+    state5 []                    = Nothing
+    state5 (c:cs) | c == '.'     = state3 cs
+                  | c == '/'     = state2 cs
+                  | isReserved c = Just ("reserved character " ++ show c)
+                  | otherwise    = state5 cs
+
+-- | See 'isGoodRelativeFilePath'.
+--
+-- This is barebones function. We check whether the glob is a valid file
+-- by replacing stars @*@ with @x@ses.
+isGoodRelativeGlob :: FilePath -> Maybe String
+isGoodRelativeGlob = isGoodRelativeFilePath . map f where
+    f '*' = 'x'
+    f c   = c
+
+-- | See 'isGoodRelativeFilePath'.
+isGoodRelativeDirectoryPath :: FilePath -> Maybe String
+isGoodRelativeDirectoryPath = state0
+  where
+    -- Reserved characters
+    -- https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file
+    isReserved c = c `elem` "<>:\"\\/|?*"
+
+    -- initial state
+    state0 []                    = Just "empty path"
+    state0 (c:cs) | c == '.'     = state5 cs
+                  | c == '/'     = Just "posix absolute path"
+                  | isReserved c = Just ("reserved character " ++ show c)
+                  | otherwise    = state4 cs
+
+    -- after ./
+    state1 []                    = Nothing -- "./"
+    state1 (c:cs) | c == '.'     = state2 cs
+                  | c == '/'     = Just "empty path segment"
+                  | isReserved c = Just ("reserved character " ++ show c)
+                  | otherwise    = state4 cs
+
+    -- after non-first setgment's .
+    state2 []                    = Just "trailing same directory segment: ."
+    state2 (c:cs) | c == '.'     = state3 cs
+                  | c == '/'     = Just "same directory segment: ."
+                  | isReserved c = Just ("reserved character " ++ show c)
+                  | otherwise    = state4 cs
+
+    -- after non-first segment's ..
+    state3 []                    = Just "trailing parent directory segment: ."
+    state3 (c:cs) | c == '.'     = state4 cs
+                  | c == '/'     = Just "parent directory segment: .."
+                  | isReserved c = Just ("reserved character " ++ show c)
+                  | otherwise    = state4 cs
+
+    -- in a segment which is ok.
+    state4 []                    = Nothing
+    state4 (c:cs) | c == '.'     = state4 cs
+                  | c == '/'     = state1 cs
+                  | isReserved c = Just ("reserved character " ++ show c)
+                  | otherwise    = state4 cs
+
+    -- after .
+    state5 []                    = Nothing -- "."
+    state5 (c:cs) | c == '.'     = state3 cs
+                  | c == '/'     = state1 cs
+                  | isReserved c = Just ("reserved character " ++ show c)
+                  | otherwise    = state4 cs
+
+-- [Note: Good relative paths]
+--
+-- Using @kleene@ we can define an extended regex:
+--
+-- @
+-- import Algebra.Lattice
+-- import Kleene
+-- import Kleene.ERE (ERE (..), intersections)
+--
+-- data C = CDot | CSlash | COtherReserved | CChar
+--   deriving (Eq, Ord, Enum, Bounded, Show)
+--
+-- reservedR :: ERE C
+-- reservedR = notChar CSlash /\ notChar COtherReserved
+--
+-- pathPieceR :: ERE C
+-- pathPieceR = intersections
+--     [ plus reservedR
+--     , ERENot (string [CDot])
+--     , ERENot (string [CDot,CDot])
+--     ]
+--
+-- filePathR :: ERE C
+-- filePathR = optional (string [CDot, CSlash]) <> pathPieceR <> star (char CSlash <> pathPieceR)
+--
+-- dirPathR :: ERE C
+-- dirPathR = (char CDot \/ filePathR) <> optional (char CSlash)
+--
+-- plus :: ERE C -> ERE C
+-- plus r = r <> star r
+--
+-- optional :: ERE C -> ERE C
+-- optional r = mempty \/ r
+-- @
+--
+-- Results in following state machine for @filePathR@
+--
+-- @
+-- 0 -> \x -> if
+--     | x <= CDot           -> 1
+--     | x <= COtherReserved -> 6
+--     | otherwise           -> 5
+-- 1 -> \x -> if
+--     | x <= CDot           -> 4
+--     | x <= CSlash         -> 2
+--     | x <= COtherReserved -> 6
+--     | otherwise           -> 5
+-- 2 -> \x -> if
+--     | x <= CDot           -> 3
+--     | x <= COtherReserved -> 6
+--     | otherwise           -> 5
+-- 3 -> \x -> if
+--     | x <= CDot           -> 4
+--     | x <= COtherReserved -> 6
+--     | otherwise           -> 5
+-- 4 -> \x -> if
+--     | x <= CDot           -> 5
+--     | x <= COtherReserved -> 6
+--     | otherwise           -> 5
+-- 5+ -> \x -> if
+--     | x <= CDot           -> 5
+--     | x <= CSlash         -> 2
+--     | x <= COtherReserved -> 6
+--     | otherwise           -> 5
+-- 6 -> \_ -> 6 -- black hole
+-- @
+--
+-- and @dirPathR@:
+--
+-- @
+-- 0 -> \x -> if
+--     | x <= CDot           -> 5
+--     | x <= COtherReserved -> 6
+--     | otherwise           -> 4
+-- 1+ -> \x -> if
+--     | x <= CDot           -> 2
+--     | x <= COtherReserved -> 6
+--     | otherwise           -> 4
+-- 2 -> \x -> if
+--     | x <= CDot           -> 3
+--     | x <= COtherReserved -> 6
+--     | otherwise           -> 4
+-- 3 -> \x -> if
+--     | x <= CDot           -> 4
+--     | x <= COtherReserved -> 6
+--     | otherwise           -> 4
+-- 4+ -> \x -> if
+--     | x <= CDot           -> 4
+--     | x <= CSlash         -> 1
+--     | x <= COtherReserved -> 6
+--     | otherwise           -> 4
+-- 5+ -> \x -> if
+--     | x <= CDot           -> 3
+--     | x <= CSlash         -> 1
+--     | x <= COtherReserved -> 6
+--     | otherwise           -> 4
+-- 6 -> \_ -> 6 -- black hole
+-- @
diff --git a/Distribution/PackageDescription/FieldGrammar.hs b/Distribution/PackageDescription/FieldGrammar.hs
--- a/Distribution/PackageDescription/FieldGrammar.hs
+++ b/Distribution/PackageDescription/FieldGrammar.hs
@@ -100,7 +100,7 @@
     <*> pure []       -- benchmarks
     --  * Files
     <*> monoidalFieldAla    "data-files"         (alaList' VCat FilePathNT) L.dataFiles
-    <*> optionalFieldDefAla "data-dir"           FilePathNT                 L.dataDir ""
+    <*> optionalFieldDefAla "data-dir"           FilePathNT                 L.dataDir "."
     <*> monoidalFieldAla    "extra-source-files" (alaList' VCat FilePathNT) L.extraSrcFiles
     <*> monoidalFieldAla    "extra-tmp-files"    (alaList' VCat FilePathNT) L.extraTmpFiles
     <*> monoidalFieldAla    "extra-doc-files"    (alaList' VCat FilePathNT) L.extraDocFiles
diff --git a/Distribution/PackageDescription/Parsec.hs b/Distribution/PackageDescription/Parsec.hs
--- a/Distribution/PackageDescription/Parsec.hs
+++ b/Distribution/PackageDescription/Parsec.hs
@@ -179,7 +179,10 @@
 
                 return v
 
-    let specVer = cabalSpecFromVersionDigits (versionNumbers cabalVer)
+    specVer <- case cabalSpecFromVersionDigitsMaybe (versionNumbers cabalVer) of
+        Just csv -> return csv
+        Nothing  -> parseFatalFailure zeroPos $
+            "Unsupported cabal-version " ++ prettyShow cabalVer ++ ". See https://github.com/haskell/cabal/issues/4899."
 
     -- reset cabal version
     setCabalSpecVersion (Just cabalVer)
@@ -199,6 +202,7 @@
     gpd1 <- view stateGpd <$> execStateT (goSections specVer sectionFields) (SectionS gpd Map.empty)
 
     checkForUndefinedFlags gpd1
+    checkForUndefinedCustomSetup gpd1
     gpd1 `deepseq` return gpd1
   where
     safeLast :: [a] -> Maybe a
@@ -672,9 +676,14 @@
     goBranch acc (CondBranch _ t (Just e))  = go acc t && go acc e
 
 -------------------------------------------------------------------------------
--- Flag check
+-- Post parsing checks
 -------------------------------------------------------------------------------
 
+-- | Check that we 
+--
+-- * don't use undefined flags (very bad)
+-- * define flags which are unused (just bad)
+--
 checkForUndefinedFlags :: GenericPackageDescription -> ParseResult ()
 checkForUndefinedFlags gpd = do
     let definedFlags, usedFlags :: Set.Set FlagName
@@ -688,6 +697,18 @@
   where
     f :: CondTree ConfVar c a -> Const (Set.Set FlagName) (CondTree ConfVar c a)
     f ct = Const (Set.fromList (freeVars ct))
+
+-- | Since @cabal-version: 1.24@ one can specify @custom-setup@.
+-- Let us require it.
+--
+checkForUndefinedCustomSetup :: GenericPackageDescription -> ParseResult ()
+checkForUndefinedCustomSetup gpd = do
+    let pd  = packageDescription gpd
+    let csv = specVersion pd
+
+    when (buildType pd == Custom && isNothing (setupBuildInfo pd)) $
+        when (csv >= mkVersion [1,24]) $ parseFailure zeroPos $
+            "Since cabal-version: 1.24 specifying custom-setup section is mandatory"
 
 -------------------------------------------------------------------------------
 -- Old syntax
diff --git a/Distribution/PackageDescription/PrettyPrint.hs b/Distribution/PackageDescription/PrettyPrint.hs
--- a/Distribution/PackageDescription/PrettyPrint.hs
+++ b/Distribution/PackageDescription/PrettyPrint.hs
@@ -64,6 +64,7 @@
 showGenericPackageDescription :: GenericPackageDescription -> String
 showGenericPackageDescription gpd = showFields (const []) $ ppGenericPackageDescription v gpd
   where
+    v :: CabalSpecVersion
     v = cabalSpecFromVersionDigits
       $ versionNumbers
       $ specVersion
diff --git a/Distribution/PackageDescription/Quirks.hs b/Distribution/PackageDescription/Quirks.hs
--- a/Distribution/PackageDescription/Quirks.hs
+++ b/Distribution/PackageDescription/Quirks.hs
@@ -250,7 +250,24 @@
          (Fingerprint 12475837388692175691 18053834261188158945)
          (Fingerprint 16279938253437334942 15753349540193002309)
          (bsReplace "9223372036854775807" "999")
-
+    -- Not UTF8
+    , mk "Name:                     nat\nVersion:                  0.1\nDescription:            Implementation of natural numbers and integers by a binary\n                                representation. The implementation is supposed to be lazy and\n                   "
+         (Fingerprint 9222512268705577108 13085311382746579495)
+         (Fingerprint 17468921266614378430 13221316288008291892)
+         (bsReplace "\xf6" "\xc3\xb6")
+    -- cabal-version: 2
+    , mk "name:                streaming-bracketed\nversion:             0.1.0.0\nsynopsis:            A resource management decorator for \"streaming\".        \ndescription:         This package provides a decorator for the Stream type from\n                     the \"st"
+         (Fingerprint 14670044663153191927 1427497586294143829)
+         (Fingerprint 9233007756654759985 6571998449003682006)
+         (bsReplace "cabal-version:       2" "cabal-version: 2.0")
+    , mk "name:                streaming-bracketed\nversion:             0.1.0.1\nsynopsis:            A resource management decorator for \"streaming\".        \ndescription:         This package provides a decorator for the Stream type from\n                     \"stream"
+         (Fingerprint 7298738862909203815 10141693276062967842)
+         (Fingerprint 1349949738792220441 3593683359695349293)
+         (bsReplace "cabal-version:       2" "cabal-version: 2.0")
+    , mk "name:           zsyntax\nversion:        0.2.0.0\ndescription:    An automated theorem prover for Zsyntax, a\n                logical calculus for molecular biology inspired by linear logic,\n                that can be used to automatically verify biological\n"
+         (Fingerprint 17812331267506881875 3005293725141563863)
+         (Fingerprint 3445957263137759540 12472369104312474458)
+         (bsReplace "cabal-version:  2" "cabal-version: 2.0")
     ]
   where
     mk a b c d = ((a, b), (c, d))
diff --git a/Distribution/Simple/GHC.hs b/Distribution/Simple/GHC.hs
--- a/Distribution/Simple/GHC.hs
+++ b/Distribution/Simple/GHC.hs
@@ -508,7 +508,7 @@
         when (forceStatic || withStaticLib lbi)
       whenGHCiLib = when (withGHCiLib lbi)
       forRepl = maybe False (const True) mReplFlags
-      ifReplLib = when forRepl
+      whenReplLib = when forRepl
       replFlags = fromMaybe mempty mReplFlags
       comp = compiler lbi
       ghcVersion = compilerVersion comp
@@ -670,10 +670,6 @@
            unless forRepl $ whenProfLib   (runGhcProgIfNeeded   profCxxOpts)
       | filename <- cxxSources libBi]
 
-  ifReplLib $ do
-    when (null (allLibModules lib clbi)) $ warn verbosity "No exposed modules"
-    ifReplLib (runGhcProg replOpts)
-
   -- build any C sources
   unless (not has_code || null (cSources libBi)) $ do
     info verbosity "Building C Sources..."
@@ -770,6 +766,9 @@
   -- TODO: problem here is we need the .c files built first, so we can load them
   -- with ghci, but .c files can depend on .h files generated by ghc by ffi
   -- exports.
+  whenReplLib $ do
+    when (null (allLibModules lib clbi)) $ warn verbosity "No exposed modules"
+    runGhcProg replOpts
 
   -- link:
   when has_code . unless forRepl $ do
diff --git a/Distribution/Simple/Program/GHC.hs b/Distribution/Simple/Program/GHC.hs
--- a/Distribution/Simple/Program/GHC.hs
+++ b/Distribution/Simple/Program/GHC.hs
@@ -685,7 +685,11 @@
   , concat [ [ "-optP-include", "-optP" ++ inc]
            | inc <- flags ghcOptCppIncludes ]
   , [ "-optc" ++ opt | opt <- ghcOptCcOptions opts]
-  , [ "-optc" ++ opt | opt <- ghcOptCxxOptions opts]
+  , -- C++ compiler options: GHC >= 8.10 requires -optcxx, older requires -optc
+    let cxxflag = case compilerCompatVersion GHC comp of
+                Just v | v >= mkVersion [8, 10] -> "-optcxx"
+                _ -> "-optc"
+    in [ cxxflag ++ opt | opt <- ghcOptCxxOptions opts]
   , [ "-opta" ++ opt | opt <- ghcOptAsmOptions opts]
 
   -----------------
diff --git a/Distribution/Simple/Utils.hs b/Distribution/Simple/Utils.hs
--- a/Distribution/Simple/Utils.hs
+++ b/Distribution/Simple/Utils.hs
@@ -233,12 +233,11 @@
 import Data.Time.Clock.POSIX (getPOSIXTime, POSIXTime)
 import Control.Exception (IOException, evaluate, throwIO, fromException)
 import Numeric (showFFloat)
-import qualified System.Process as Process
-         ( CreateProcess(..), StdStream(..), proc)
+import Distribution.Compat.Process  (createProcess, rawSystem, runInteractiveProcess)
 import System.Process
-         ( ProcessHandle, createProcess, rawSystem, runInteractiveProcess
+         ( ProcessHandle
          , showCommandForUser, waitForProcess)
-
+import qualified System.Process as Process
 import qualified GHC.IO.Exception as GHC
 
 import qualified Text.PrettyPrint as Disp
@@ -679,6 +678,8 @@
 maybeExit cmd = do
   res <- cmd
   unless (res == ExitSuccess) $ exitWith res
+
+
 
 printRawCommandAndArgs :: Verbosity -> FilePath -> [String] -> IO ()
 printRawCommandAndArgs verbosity path args = withFrozenCallStack $
diff --git a/Distribution/System.hs b/Distribution/System.hs
--- a/Distribution/System.hs
+++ b/Distribution/System.hs
@@ -122,7 +122,8 @@
 osAliases Compat     FreeBSD = ["kfreebsdgnu"]
 osAliases Permissive Solaris = ["solaris2"]
 osAliases Compat     Solaris = ["solaris2"]
-osAliases _          Android = ["linux-android"]
+osAliases Permissive Android = ["linux-android", "linux-androideabi", "linux-androideabihf"]
+osAliases Compat     Android = ["linux-android"]
 osAliases _          _       = []
 
 instance Pretty OS where
diff --git a/Distribution/Types/PackageDescription.hs b/Distribution/Types/PackageDescription.hs
--- a/Distribution/Types/PackageDescription.hs
+++ b/Distribution/Types/PackageDescription.hs
@@ -246,7 +246,7 @@
                       testSuites   = [],
                       benchmarks   = [],
                       dataFiles    = [],
-                      dataDir      = "",
+                      dataDir      = ".",
                       extraSrcFiles = [],
                       extraTmpFiles = [],
                       extraDocFiles = []
diff --git a/Distribution/Utils/Generic.hs b/Distribution/Utils/Generic.hs
--- a/Distribution/Utils/Generic.hs
+++ b/Distribution/Utils/Generic.hs
@@ -542,6 +542,7 @@
 isAbsoluteOnAnyPlatform :: FilePath -> Bool
 -- C:\\directory
 isAbsoluteOnAnyPlatform (drive:':':'\\':_) = isAlpha drive
+isAbsoluteOnAnyPlatform (drive:':':'/':_)  = isAlpha drive
 -- UNC
 isAbsoluteOnAnyPlatform ('\\':'\\':_) = True
 -- Posix root
diff --git a/tests/CheckTests.hs b/tests/CheckTests.hs
--- a/tests/CheckTests.hs
+++ b/tests/CheckTests.hs
@@ -40,6 +40,7 @@
     , checkTest "ghc-option-j.cabal"
     , checkTest "multiple-libs-2.cabal"
     , checkTest "assoc-cpp-options.cabal"
+    , checkTest "denormalised-paths.cabal"
     ]
 
 checkTest :: FilePath -> TestTree
diff --git a/tests/HackageTests.hs b/tests/HackageTests.hs
--- a/tests/HackageTests.hs
+++ b/tests/HackageTests.hs
@@ -152,17 +152,48 @@
 -- Parsec test: whether we can parse everything
 -------------------------------------------------------------------------------
 
-parseParsecTest :: FilePath -> B.ByteString -> IO (Sum Int)
-parseParsecTest fpath bs = do
-    let (_warnings, parsec) = Parsec.runParseResult $
-                              Parsec.parseGenericPackageDescription bs
-    case parsec of
-        Right _ -> return (Sum 1)
-        Left (_, errors) -> do
+parseParsecTest :: Bool -> FilePath -> B.ByteString -> IO ParsecResult
+parseParsecTest keepGoing fpath bs = do
+    let (warnings, result) = Parsec.runParseResult $
+                             Parsec.parseGenericPackageDescription bs
+
+    let w | null warnings = 0
+          | otherwise     = 1
+
+    case result of
+        Right gpd                    -> do
+            forEachGPD fpath bs gpd
+            return (ParsecResult 1 w 0)
+
+        Left (_, errors) | keepGoing -> do
             traverse_ (putStrLn . Parsec.showPError fpath) errors
+            return (ParsecResult 1 w 1)
+                         | otherwise -> do
+            traverse_ (putStrLn . Parsec.showPError fpath) errors
             exitFailure
 
+-- | A hook to make queries on Hackage
+forEachGPD :: FilePath -> B8.ByteString -> L.GenericPackageDescription -> IO ()
+forEachGPD _ _ _ = return ()
+
 -------------------------------------------------------------------------------
+-- ParsecResult
+-------------------------------------------------------------------------------
+
+data ParsecResult = ParsecResult !Int !Int !Int
+  deriving (Eq, Show)
+
+instance Semigroup ParsecResult where
+    ParsecResult x y z <> ParsecResult u v w = ParsecResult (x + u) (y + v) (z + w)
+
+instance Monoid ParsecResult where
+    mempty  = ParsecResult 0 0 0
+    mappend = (<>)
+
+instance NFData ParsecResult where
+    rnf (ParsecResult _ _ _) = ()
+
+-------------------------------------------------------------------------------
 -- Check test
 -------------------------------------------------------------------------------
 
@@ -309,15 +340,22 @@
 
     defaultA = do
         putStrLn "Default action: parsec k"
-        parsecA (mkPredicate ["k"])
+        parsecA (mkPredicate ["k"]) False
 
     readFieldsP = readFieldsA <$> prefixP
     readFieldsA pfx = parseIndex pfx readFieldTest
 
-    parsecP = parsecA <$> prefixP
-    parsecA pfx = do
-        Sum n <- parseIndex pfx parseParsecTest
+    parsecP = parsecA <$> prefixP <*> keepGoingP
+    keepGoingP =
+        O.flag' True  (O.long "keep-going") <|>
+        O.flag' False (O.long "no-keep-going") <|>
+        pure False
+
+    parsecA pfx keepGoing = do
+        ParsecResult n w f <- parseIndex pfx (parseParsecTest keepGoing)
         putStrLn $ show n ++ " files processed"
+        putStrLn $ show w ++ " files contained warnings"
+        putStrLn $ show f ++ " files failed to parse"
 
     roundtripP = roundtripA <$> prefixP <*> testFieldsP
     roundtripA pfx testFieldsTransform = do
diff --git a/tests/ParserTests/errors/common1.cabal b/tests/ParserTests/errors/common1.cabal
--- a/tests/ParserTests/errors/common1.cabal
+++ b/tests/ParserTests/errors/common1.cabal
@@ -1,4 +1,4 @@
-cabal-version:       2.1
+cabal-version:       2.2
 name:                common
 version:             0
 synopsis:            Common-stanza demo demo
diff --git a/tests/ParserTests/errors/common1.errors b/tests/ParserTests/errors/common1.errors
--- a/tests/ParserTests/errors/common1.errors
+++ b/tests/ParserTests/errors/common1.errors
@@ -1,2 +1,2 @@
-VERSION: Just (mkVersion [2,1])
+VERSION: Just (mkVersion [2,2])
 common1.cabal:17:3: Undefined common stanza imported: windo
diff --git a/tests/ParserTests/errors/common2.cabal b/tests/ParserTests/errors/common2.cabal
--- a/tests/ParserTests/errors/common2.cabal
+++ b/tests/ParserTests/errors/common2.cabal
@@ -1,4 +1,4 @@
-cabal-version:       2.1
+cabal-version:       2.2
 name:                common
 version:             0
 synopsis:            Common-stanza demo demo
diff --git a/tests/ParserTests/errors/common2.errors b/tests/ParserTests/errors/common2.errors
--- a/tests/ParserTests/errors/common2.errors
+++ b/tests/ParserTests/errors/common2.errors
@@ -1,2 +1,2 @@
-VERSION: Just (mkVersion [2,1])
+VERSION: Just (mkVersion [2,2])
 common2.cabal:13:3: Undefined common stanza imported: windows
diff --git a/tests/ParserTests/errors/common3.cabal b/tests/ParserTests/errors/common3.cabal
--- a/tests/ParserTests/errors/common3.cabal
+++ b/tests/ParserTests/errors/common3.cabal
@@ -1,4 +1,4 @@
-cabal-version:       2.1
+cabal-version:       2.2
 name:                common
 version:             0
 synopsis:            Common-stanza demo demo
diff --git a/tests/ParserTests/errors/common3.errors b/tests/ParserTests/errors/common3.errors
--- a/tests/ParserTests/errors/common3.errors
+++ b/tests/ParserTests/errors/common3.errors
@@ -1,2 +1,2 @@
-VERSION: Just (mkVersion [2,1])
+VERSION: Just (mkVersion [2,2])
 common3.cabal:22:1: Duplicate common stanza: deps
diff --git a/tests/ParserTests/errors/forward-compat2.cabal b/tests/ParserTests/errors/forward-compat2.cabal
--- a/tests/ParserTests/errors/forward-compat2.cabal
+++ b/tests/ParserTests/errors/forward-compat2.cabal
@@ -2,7 +2,7 @@
 version:             0
 synopsis:            Common-stanza demo demo
 build-type:          Simple
-cabal-version:       2.1
+cabal-version:       2.2
 
 source-repository head
   Type:     git
diff --git a/tests/ParserTests/errors/forward-compat2.errors b/tests/ParserTests/errors/forward-compat2.errors
--- a/tests/ParserTests/errors/forward-compat2.errors
+++ b/tests/ParserTests/errors/forward-compat2.errors
@@ -1,2 +1,2 @@
-VERSION: Just (mkVersion [2,1])
+VERSION: Just (mkVersion [2,2])
 forward-compat2.cabal:5:1: cabal-version should be at the beginning of the file starting with spec version 2.2. See https://github.com/haskell/cabal/issues/4899
diff --git a/tests/ParserTests/errors/forward-compat3.errors b/tests/ParserTests/errors/forward-compat3.errors
--- a/tests/ParserTests/errors/forward-compat3.errors
+++ b/tests/ParserTests/errors/forward-compat3.errors
@@ -1,2 +1,3 @@
 VERSION: Just (mkVersion [99999,99])
+forward-compat3.cabal:0:0: Unsupported cabal-version 99999.99. See https://github.com/haskell/cabal/issues/4899.
 forward-compat3.cabal:0:0: Unsupported cabal-version. See https://github.com/haskell/cabal/issues/4899.
diff --git a/tests/ParserTests/errors/leading-comma-2c.cabal b/tests/ParserTests/errors/leading-comma-2c.cabal
--- a/tests/ParserTests/errors/leading-comma-2c.cabal
+++ b/tests/ParserTests/errors/leading-comma-2c.cabal
@@ -1,4 +1,4 @@
-cabal-version:       2.5
+cabal-version:       3.0
 name:                leading-comma
 version:             0
 synopsis:            leading comma, trailing comma, or ordinary
diff --git a/tests/ParserTests/errors/leading-comma-2c.errors b/tests/ParserTests/errors/leading-comma-2c.errors
--- a/tests/ParserTests/errors/leading-comma-2c.errors
+++ b/tests/ParserTests/errors/leading-comma-2c.errors
@@ -1,4 +1,4 @@
-VERSION: Just (mkVersion [2,5])
+VERSION: Just (mkVersion [3,0])
 leading-comma-2c.cabal:10:30: 
 unexpected 'N'
 expecting space, comma, white space or end of input
diff --git a/tests/ParserTests/errors/removed-fields.cabal b/tests/ParserTests/errors/removed-fields.cabal
--- a/tests/ParserTests/errors/removed-fields.cabal
+++ b/tests/ParserTests/errors/removed-fields.cabal
@@ -1,4 +1,4 @@
-cabal-version:       2.5
+cabal-version:       3.0
 name:                removed-fields
 version:             0
 synopsis:            some fields are removed
diff --git a/tests/ParserTests/errors/removed-fields.errors b/tests/ParserTests/errors/removed-fields.errors
--- a/tests/ParserTests/errors/removed-fields.errors
+++ b/tests/ParserTests/errors/removed-fields.errors
@@ -1,3 +1,3 @@
-VERSION: Just (mkVersion [2,5])
+VERSION: Just (mkVersion [3,0])
 removed-fields.cabal:13:3: The field "extensions" is removed in the Cabal specification version 3.0. Please use 'default-extensions' or 'other-extensions' fields.
 removed-fields.cabal:14:3: The field "extensions" is removed in the Cabal specification version 3.0. Please use 'default-extensions' or 'other-extensions' fields.
diff --git a/tests/ParserTests/errors/version-sets-1.cabal b/tests/ParserTests/errors/version-sets-1.cabal
--- a/tests/ParserTests/errors/version-sets-1.cabal
+++ b/tests/ParserTests/errors/version-sets-1.cabal
@@ -1,4 +1,4 @@
-cabal-version:       2.5
+cabal-version:       3.0
 name:                version-sets
 version:             0
 synopsis:            version set notation
diff --git a/tests/ParserTests/errors/version-sets-1.errors b/tests/ParserTests/errors/version-sets-1.errors
--- a/tests/ParserTests/errors/version-sets-1.errors
+++ b/tests/ParserTests/errors/version-sets-1.errors
@@ -1,4 +1,4 @@
-VERSION: Just (mkVersion [2,5])
+VERSION: Just (mkVersion [3,0])
 version-sets-1.cabal:8:31: 
 unexpected "}"
 expecting space or version digit (integral without leading zeroes)
diff --git a/tests/ParserTests/errors/version-sets-2.cabal b/tests/ParserTests/errors/version-sets-2.cabal
--- a/tests/ParserTests/errors/version-sets-2.cabal
+++ b/tests/ParserTests/errors/version-sets-2.cabal
@@ -1,4 +1,4 @@
-cabal-version:       2.5
+cabal-version:       3.0
 name:                version-sets
 version:             0
 synopsis:            version set notation
diff --git a/tests/ParserTests/errors/version-sets-2.errors b/tests/ParserTests/errors/version-sets-2.errors
--- a/tests/ParserTests/errors/version-sets-2.errors
+++ b/tests/ParserTests/errors/version-sets-2.errors
@@ -1,4 +1,4 @@
-VERSION: Just (mkVersion [2,5])
+VERSION: Just (mkVersion [3,0])
 version-sets-2.cabal:8:29: 
 unexpected "{"
 expecting space or version digit (integral without leading zeroes)
diff --git a/tests/ParserTests/errors/version-sets-3.cabal b/tests/ParserTests/errors/version-sets-3.cabal
--- a/tests/ParserTests/errors/version-sets-3.cabal
+++ b/tests/ParserTests/errors/version-sets-3.cabal
@@ -1,4 +1,4 @@
-cabal-version:       2.5
+cabal-version:       3.0
 name:                version-sets
 version:             0
 synopsis:            version set notation
diff --git a/tests/ParserTests/errors/version-sets-3.errors b/tests/ParserTests/errors/version-sets-3.errors
--- a/tests/ParserTests/errors/version-sets-3.errors
+++ b/tests/ParserTests/errors/version-sets-3.errors
@@ -1,4 +1,4 @@
-VERSION: Just (mkVersion [2,5])
+VERSION: Just (mkVersion [3,0])
 version-sets-3.cabal:8:40: 
 unexpected "}"
 expecting space or version digit (integral without leading zeroes)
diff --git a/tests/ParserTests/errors/version-sets-4.cabal b/tests/ParserTests/errors/version-sets-4.cabal
--- a/tests/ParserTests/errors/version-sets-4.cabal
+++ b/tests/ParserTests/errors/version-sets-4.cabal
@@ -1,4 +1,4 @@
-cabal-version:       2.5
+cabal-version:       3.0
 name:                version-sets
 version:             0
 synopsis:            version set notation
diff --git a/tests/ParserTests/errors/version-sets-4.errors b/tests/ParserTests/errors/version-sets-4.errors
--- a/tests/ParserTests/errors/version-sets-4.errors
+++ b/tests/ParserTests/errors/version-sets-4.errors
@@ -1,4 +1,4 @@
-VERSION: Just (mkVersion [2,5])
+VERSION: Just (mkVersion [3,0])
 version-sets-4.cabal:8:35: 
 unexpected "*"
 expecting version digit (integral without leading zeroes)
diff --git a/tests/ParserTests/regressions/Octree-0.5.expr b/tests/ParserTests/regressions/Octree-0.5.expr
--- a/tests/ParserTests/regressions/Octree-0.5.expr
+++ b/tests/ParserTests/regressions/Octree-0.5.expr
@@ -292,7 +292,7 @@
                            category = "Data",
                            copyright = "Copyright by Michal J. Gajda '2012",
                            customFieldsPD = [],
-                           dataDir = "",
+                           dataDir = ".",
                            dataFiles = [],
                            description = "Octree data structure is relatively shallow data structure for space partitioning.",
                            executables = [],
diff --git a/tests/ParserTests/regressions/big-version.expr b/tests/ParserTests/regressions/big-version.expr
--- a/tests/ParserTests/regressions/big-version.expr
+++ b/tests/ParserTests/regressions/big-version.expr
@@ -68,7 +68,7 @@
                            category = "",
                            copyright = "",
                            customFieldsPD = [],
-                           dataDir = "",
+                           dataDir = ".",
                            dataFiles = [],
                            description = "",
                            executables = [],
diff --git a/tests/ParserTests/regressions/common-conditional.cabal b/tests/ParserTests/regressions/common-conditional.cabal
--- a/tests/ParserTests/regressions/common-conditional.cabal
+++ b/tests/ParserTests/regressions/common-conditional.cabal
@@ -1,4 +1,4 @@
-cabal-version:       2.6
+cabal-version:       3.0
 name:                common-conditional
 version:             0
 synopsis:            Common-stanza demo demo
diff --git a/tests/ParserTests/regressions/common-conditional.expr b/tests/ParserTests/regressions/common-conditional.expr
--- a/tests/ParserTests/regressions/common-conditional.expr
+++ b/tests/ParserTests/regressions/common-conditional.expr
@@ -599,7 +599,7 @@
                            category = "",
                            copyright = "",
                            customFieldsPD = [],
-                           dataDir = "",
+                           dataDir = ".",
                            dataFiles = [],
                            description = "",
                            executables = [],
@@ -625,7 +625,7 @@
                                              repoSubdir = Nothing,
                                              repoTag = Nothing,
                                              repoType = Just Git}],
-                           specVersionRaw = Left `mkVersion [2,6]`,
+                           specVersionRaw = Left `mkVersion [3,0]`,
                            stability = "",
                            subLibraries = [],
                            synopsis = "Common-stanza demo demo",
diff --git a/tests/ParserTests/regressions/common-conditional.format b/tests/ParserTests/regressions/common-conditional.format
--- a/tests/ParserTests/regressions/common-conditional.format
+++ b/tests/ParserTests/regressions/common-conditional.format
@@ -1,4 +1,4 @@
-cabal-version: 2.6
+cabal-version: 3.0
 name:          common-conditional
 version:       0
 synopsis:      Common-stanza demo demo
diff --git a/tests/ParserTests/regressions/common.expr b/tests/ParserTests/regressions/common.expr
--- a/tests/ParserTests/regressions/common.expr
+++ b/tests/ParserTests/regressions/common.expr
@@ -138,7 +138,7 @@
                            copyright = "",
                            customFieldsPD = [_×_ "x-revision" "1",
                                              _×_ "x-follows-version-policy" ""],
-                           dataDir = "",
+                           dataDir = ".",
                            dataFiles = [],
                            description = "",
                            executables = [],
diff --git a/tests/ParserTests/regressions/common2.cabal b/tests/ParserTests/regressions/common2.cabal
--- a/tests/ParserTests/regressions/common2.cabal
+++ b/tests/ParserTests/regressions/common2.cabal
@@ -1,4 +1,4 @@
-cabal-version:       2.1
+cabal-version:       2.2
 name:                common
 version:             0
 synopsis:            Common-stanza demo demo
diff --git a/tests/ParserTests/regressions/common2.expr b/tests/ParserTests/regressions/common2.expr
--- a/tests/ParserTests/regressions/common2.expr
+++ b/tests/ParserTests/regressions/common2.expr
@@ -627,7 +627,7 @@
                            category = "",
                            copyright = "",
                            customFieldsPD = [],
-                           dataDir = "",
+                           dataDir = ".",
                            dataFiles = [],
                            description = "",
                            executables = [],
@@ -653,7 +653,7 @@
                                              repoSubdir = Nothing,
                                              repoTag = Nothing,
                                              repoType = Just Git}],
-                           specVersionRaw = Left `mkVersion [2,1]`,
+                           specVersionRaw = Left `mkVersion [2,2]`,
                            stability = "",
                            subLibraries = [],
                            synopsis = "Common-stanza demo demo",
diff --git a/tests/ParserTests/regressions/common2.format b/tests/ParserTests/regressions/common2.format
--- a/tests/ParserTests/regressions/common2.format
+++ b/tests/ParserTests/regressions/common2.format
@@ -1,4 +1,4 @@
-cabal-version: 2.1
+cabal-version: 2.2
 name:          common
 version:       0
 synopsis:      Common-stanza demo demo
diff --git a/tests/ParserTests/regressions/common3.expr b/tests/ParserTests/regressions/common3.expr
--- a/tests/ParserTests/regressions/common3.expr
+++ b/tests/ParserTests/regressions/common3.expr
@@ -162,7 +162,7 @@
                            copyright = "",
                            customFieldsPD = [_×_ "x-revision" "1",
                                              _×_ "x-follows-version-policy" ""],
-                           dataDir = "",
+                           dataDir = ".",
                            dataFiles = [],
                            description = "",
                            executables = [],
diff --git a/tests/ParserTests/regressions/denormalised-paths.cabal b/tests/ParserTests/regressions/denormalised-paths.cabal
new file mode 100644
--- /dev/null
+++ b/tests/ParserTests/regressions/denormalised-paths.cabal
@@ -0,0 +1,71 @@
+cabal-version: 2.4
+name:          assoc
+version:       1.1
+license:       BSD-3-Clause
+license-files: LICENSE LICENSE2/ .
+synopsis:      swap and assoc: Symmetric and Semigroupy Bifunctors
+category:      Data
+description:
+  Provides generalisations of
+  @swap :: (a,b) -> (b,a)@ and
+  @assoc :: ((a,b),c) -> (a,(b,c))@
+  to
+  @Bifunctor@s supporting similar operations (e.g. @Either@, @These@).
+
+author:        Oleg Grenrus <oleg.grenrus@iki.fi>
+maintainer:    Oleg Grenrus <oleg.grenrus@iki.fi>
+build-type:    Simple
+tested-with:
+  GHC ==7.0.4
+   || ==7.2.2
+   || ==7.4.2
+   || ==7.6.3
+   || ==7.8.4
+   || ==7.10.3
+   || ==8.0.2
+   || ==8.2.2
+   || ==8.4.4
+   || ==8.6.5
+   || ==8.8.1
+
+extra-source-files:
+  files/**/*.txt/
+  files/../foo.txt
+
+source-repository head
+  type:     git
+  location: https://github.com/phadej/assoc.git
+  subdir:   ./.
+
+source-repository this
+  type:     git
+  location: https://github.com/phadej/assoc.git
+  tag:      v1.1
+  subdir:   foo/
+
+library
+  default-language: Haskell2010
+  build-depends:
+      base        >=4.3   && <4.13
+    , bifunctors  >=5.5.4 && <5.6
+
+  exposed-modules:
+    Data.Bifunctor.Assoc
+    Data.Bifunctor.Swap
+
+  -- this is fine
+  hs-source-dirs:   src/
+
+  -- collection of invalid sources
+  hs-source-dirs:   src/.
+  hs-source-dirs:   src/../src
+  hs-source-dirs:   src/../../assoc/src
+  -- this is forbidden by a parser
+  -- hs-source-dirs:   C:/foo/bar
+  hs-source-dirs:   C:foo/bar
+  hs-source-dirs:   ||s
+  -- this is forbidden by a parser
+  -- hs-source-dirs:   /var/secret/source
+
+  -- this is the only case catched by Cabal-3.0.2.0
+  hs-source-dirs:   ../../assoc/src
diff --git a/tests/ParserTests/regressions/denormalised-paths.check b/tests/ParserTests/regressions/denormalised-paths.check
new file mode 100644
--- /dev/null
+++ b/tests/ParserTests/regressions/denormalised-paths.check
@@ -0,0 +1,12 @@
+The 'subdir' field of a source-repository is not a good relative path: "trailing same directory segment: ."
+'hs-source-dirs: ../../assoc/src' is a relative path outside of the source tree. This will not work when generating a tarball with 'sdist'.
+'extra-source-files: files/**/*.txt/' is not good relative path: trailing slash
+'extra-source-files: files/../foo.txt' is not good relative path: parent directory segment: ..
+'license-file: LICENSE2/' is not good relative path: trailing slash
+'license-file: .' is not good relative path: trailing dot segment
+'hs-source-dirs: src/.' is not good relative path: trailing same directory segment: .
+'hs-source-dirs: src/../src' is not good relative path: parent directory segment: ..
+'hs-source-dirs: src/../../assoc/src' is not good relative path: parent directory segment: ..
+'hs-source-dirs: C:foo/bar' is not good relative path: reserved character ':'
+'hs-source-dirs: ||s' is not good relative path: reserved character '|'
+'hs-source-dirs: ../../assoc/src' is not good relative path: parent directory segment: ..
diff --git a/tests/ParserTests/regressions/elif.expr b/tests/ParserTests/regressions/elif.expr
--- a/tests/ParserTests/regressions/elif.expr
+++ b/tests/ParserTests/regressions/elif.expr
@@ -140,7 +140,7 @@
                            category = "",
                            copyright = "",
                            customFieldsPD = [],
-                           dataDir = "",
+                           dataDir = ".",
                            dataFiles = [],
                            description = "",
                            executables = [],
diff --git a/tests/ParserTests/regressions/elif2.cabal b/tests/ParserTests/regressions/elif2.cabal
--- a/tests/ParserTests/regressions/elif2.cabal
+++ b/tests/ParserTests/regressions/elif2.cabal
@@ -1,4 +1,4 @@
-cabal-version:       2.1
+cabal-version:       2.2
 name:                elif
 version:             0
 synopsis:            The elif demo
diff --git a/tests/ParserTests/regressions/elif2.expr b/tests/ParserTests/regressions/elif2.expr
--- a/tests/ParserTests/regressions/elif2.expr
+++ b/tests/ParserTests/regressions/elif2.expr
@@ -336,7 +336,7 @@
                            category = "",
                            copyright = "",
                            customFieldsPD = [],
-                           dataDir = "",
+                           dataDir = ".",
                            dataFiles = [],
                            description = "",
                            executables = [],
@@ -362,7 +362,7 @@
                                              repoSubdir = Nothing,
                                              repoTag = Nothing,
                                              repoType = Just Git}],
-                           specVersionRaw = Left `mkVersion [2,1]`,
+                           specVersionRaw = Left `mkVersion [2,2]`,
                            stability = "",
                            subLibraries = [],
                            synopsis = "The elif demo",
diff --git a/tests/ParserTests/regressions/elif2.format b/tests/ParserTests/regressions/elif2.format
--- a/tests/ParserTests/regressions/elif2.format
+++ b/tests/ParserTests/regressions/elif2.format
@@ -1,4 +1,4 @@
-cabal-version: 2.1
+cabal-version: 2.2
 name:          elif
 version:       0
 synopsis:      The elif demo
diff --git a/tests/ParserTests/regressions/encoding-0.8.expr b/tests/ParserTests/regressions/encoding-0.8.expr
--- a/tests/ParserTests/regressions/encoding-0.8.expr
+++ b/tests/ParserTests/regressions/encoding-0.8.expr
@@ -89,7 +89,7 @@
                            category = "",
                            copyright = "",
                            customFieldsPD = [],
-                           dataDir = "",
+                           dataDir = ".",
                            dataFiles = [],
                            description = "",
                            executables = [],
diff --git a/tests/ParserTests/regressions/generics-sop.expr b/tests/ParserTests/regressions/generics-sop.expr
--- a/tests/ParserTests/regressions/generics-sop.expr
+++ b/tests/ParserTests/regressions/generics-sop.expr
@@ -655,7 +655,7 @@
                            category = "Generics",
                            copyright = "",
                            customFieldsPD = [],
-                           dataDir = "",
+                           dataDir = ".",
                            dataFiles = [],
                            description = concat
                                            ["A library to support the definition of generic functions.\n",
diff --git a/tests/ParserTests/regressions/hidden-main-lib.cabal b/tests/ParserTests/regressions/hidden-main-lib.cabal
--- a/tests/ParserTests/regressions/hidden-main-lib.cabal
+++ b/tests/ParserTests/regressions/hidden-main-lib.cabal
@@ -1,4 +1,4 @@
-cabal-version:       2.5
+cabal-version:       3.0
 name:                hidden-main-lib
 version:             0
 synopsis:            main lib have to be visible
diff --git a/tests/ParserTests/regressions/hidden-main-lib.expr b/tests/ParserTests/regressions/hidden-main-lib.expr
--- a/tests/ParserTests/regressions/hidden-main-lib.expr
+++ b/tests/ParserTests/regressions/hidden-main-lib.expr
@@ -75,7 +75,7 @@
                            category = "",
                            copyright = "",
                            customFieldsPD = [],
-                           dataDir = "",
+                           dataDir = ".",
                            dataFiles = [],
                            description = "",
                            executables = [],
@@ -94,7 +94,7 @@
                            pkgUrl = "",
                            setupBuildInfo = Nothing,
                            sourceRepos = [],
-                           specVersionRaw = Left `mkVersion [2,5]`,
+                           specVersionRaw = Left `mkVersion [3,0]`,
                            stability = "",
                            subLibraries = [],
                            synopsis = "main lib have to be visible",
diff --git a/tests/ParserTests/regressions/hidden-main-lib.format b/tests/ParserTests/regressions/hidden-main-lib.format
--- a/tests/ParserTests/regressions/hidden-main-lib.format
+++ b/tests/ParserTests/regressions/hidden-main-lib.format
@@ -1,5 +1,5 @@
 hidden-main-lib.cabal:11:3: Unknown field: "visibility"
-cabal-version: 2.5
+cabal-version: 3.0
 name:          hidden-main-lib
 version:       0
 synopsis:      main lib have to be visible
diff --git a/tests/ParserTests/regressions/indentation.expr b/tests/ParserTests/regressions/indentation.expr
--- a/tests/ParserTests/regressions/indentation.expr
+++ b/tests/ParserTests/regressions/indentation.expr
@@ -68,7 +68,7 @@
                            category = "",
                            copyright = "",
                            customFieldsPD = [],
-                           dataDir = "",
+                           dataDir = ".",
                            dataFiles = [],
                            description = concat
                                            ["* foo\n",
diff --git a/tests/ParserTests/regressions/indentation2.expr b/tests/ParserTests/regressions/indentation2.expr
--- a/tests/ParserTests/regressions/indentation2.expr
+++ b/tests/ParserTests/regressions/indentation2.expr
@@ -68,7 +68,7 @@
                            category = "",
                            copyright = "",
                            customFieldsPD = [],
-                           dataDir = "",
+                           dataDir = ".",
                            dataFiles = [],
                            description = concat ["foo\n", "  indent2\n", "    indent4"],
                            executables = [],
diff --git a/tests/ParserTests/regressions/indentation3.expr b/tests/ParserTests/regressions/indentation3.expr
--- a/tests/ParserTests/regressions/indentation3.expr
+++ b/tests/ParserTests/regressions/indentation3.expr
@@ -68,7 +68,7 @@
                            category = "",
                            copyright = "",
                            customFieldsPD = [],
-                           dataDir = "",
+                           dataDir = ".",
                            dataFiles = [],
                            description = concat
                                            ["indent0\n",
diff --git a/tests/ParserTests/regressions/issue-5055.expr b/tests/ParserTests/regressions/issue-5055.expr
--- a/tests/ParserTests/regressions/issue-5055.expr
+++ b/tests/ParserTests/regressions/issue-5055.expr
@@ -210,7 +210,7 @@
                            category = "Test",
                            copyright = "",
                            customFieldsPD = [],
-                           dataDir = "",
+                           dataDir = ".",
                            dataFiles = [],
                            description = "no type in all branches.",
                            executables = [],
diff --git a/tests/ParserTests/regressions/issue-5846.expr b/tests/ParserTests/regressions/issue-5846.expr
--- a/tests/ParserTests/regressions/issue-5846.expr
+++ b/tests/ParserTests/regressions/issue-5846.expr
@@ -118,7 +118,7 @@
                            category = "",
                            copyright = "",
                            customFieldsPD = [],
-                           dataDir = "",
+                           dataDir = ".",
                            dataFiles = [],
                            description = "",
                            executables = [],
diff --git a/tests/ParserTests/regressions/issue-6083-pkg-pkg.expr b/tests/ParserTests/regressions/issue-6083-pkg-pkg.expr
--- a/tests/ParserTests/regressions/issue-6083-pkg-pkg.expr
+++ b/tests/ParserTests/regressions/issue-6083-pkg-pkg.expr
@@ -84,7 +84,7 @@
                            category = "",
                            copyright = "",
                            customFieldsPD = [],
-                           dataDir = "",
+                           dataDir = ".",
                            dataFiles = [],
                            description = "",
                            executables = [],
diff --git a/tests/ParserTests/regressions/issue-774.expr b/tests/ParserTests/regressions/issue-774.expr
--- a/tests/ParserTests/regressions/issue-774.expr
+++ b/tests/ParserTests/regressions/issue-774.expr
@@ -73,7 +73,7 @@
                            category = "",
                            copyright = "",
                            customFieldsPD = [],
-                           dataDir = "",
+                           dataDir = ".",
                            dataFiles = [],
                            description = concat
                                            ["Here is some C code:\n",
diff --git a/tests/ParserTests/regressions/jaeger-flamegraph.expr b/tests/ParserTests/regressions/jaeger-flamegraph.expr
--- a/tests/ParserTests/regressions/jaeger-flamegraph.expr
+++ b/tests/ParserTests/regressions/jaeger-flamegraph.expr
@@ -343,7 +343,7 @@
                            category = "Testing",
                            copyright = "(c) 2018 Symbiont.io",
                            customFieldsPD = [],
-                           dataDir = "",
+                           dataDir = ".",
                            dataFiles = [],
                            description = concat
                                            ["This is a small tool to convert JSON dumps obtained from a Jaeger\n",
diff --git a/tests/ParserTests/regressions/leading-comma-2.cabal b/tests/ParserTests/regressions/leading-comma-2.cabal
--- a/tests/ParserTests/regressions/leading-comma-2.cabal
+++ b/tests/ParserTests/regressions/leading-comma-2.cabal
@@ -1,4 +1,4 @@
-cabal-version:       2.5
+cabal-version:       3.0
 name:                leading-comma
 version:             0
 synopsis:            leading comma, trailing comma, or ordinary
diff --git a/tests/ParserTests/regressions/leading-comma-2.expr b/tests/ParserTests/regressions/leading-comma-2.expr
--- a/tests/ParserTests/regressions/leading-comma-2.expr
+++ b/tests/ParserTests/regressions/leading-comma-2.expr
@@ -127,7 +127,7 @@
                            category = "",
                            copyright = "",
                            customFieldsPD = [],
-                           dataDir = "",
+                           dataDir = ".",
                            dataFiles = [],
                            description = "",
                            executables = [],
@@ -146,7 +146,7 @@
                            pkgUrl = "",
                            setupBuildInfo = Nothing,
                            sourceRepos = [],
-                           specVersionRaw = Left `mkVersion [2,5]`,
+                           specVersionRaw = Left `mkVersion [3,0]`,
                            stability = "",
                            subLibraries = [],
                            synopsis = "leading comma, trailing comma, or ordinary",
diff --git a/tests/ParserTests/regressions/leading-comma-2.format b/tests/ParserTests/regressions/leading-comma-2.format
--- a/tests/ParserTests/regressions/leading-comma-2.format
+++ b/tests/ParserTests/regressions/leading-comma-2.format
@@ -1,4 +1,4 @@
-cabal-version: 2.5
+cabal-version: 3.0
 name:          leading-comma
 version:       0
 synopsis:      leading comma, trailing comma, or ordinary
diff --git a/tests/ParserTests/regressions/leading-comma.cabal b/tests/ParserTests/regressions/leading-comma.cabal
--- a/tests/ParserTests/regressions/leading-comma.cabal
+++ b/tests/ParserTests/regressions/leading-comma.cabal
@@ -1,4 +1,4 @@
-cabal-version:       2.1
+cabal-version:       2.2
 name:                leading-comma
 version:             0
 synopsis:            leading comma, trailing comma, or ordinary
diff --git a/tests/ParserTests/regressions/leading-comma.expr b/tests/ParserTests/regressions/leading-comma.expr
--- a/tests/ParserTests/regressions/leading-comma.expr
+++ b/tests/ParserTests/regressions/leading-comma.expr
@@ -120,7 +120,7 @@
                            category = "",
                            copyright = "",
                            customFieldsPD = [],
-                           dataDir = "",
+                           dataDir = ".",
                            dataFiles = [],
                            description = "",
                            executables = [],
@@ -139,7 +139,7 @@
                            pkgUrl = "",
                            setupBuildInfo = Nothing,
                            sourceRepos = [],
-                           specVersionRaw = Left `mkVersion [2,1]`,
+                           specVersionRaw = Left `mkVersion [2,2]`,
                            stability = "",
                            subLibraries = [],
                            synopsis = "leading comma, trailing comma, or ordinary",
diff --git a/tests/ParserTests/regressions/leading-comma.format b/tests/ParserTests/regressions/leading-comma.format
--- a/tests/ParserTests/regressions/leading-comma.format
+++ b/tests/ParserTests/regressions/leading-comma.format
@@ -1,4 +1,4 @@
-cabal-version: 2.1
+cabal-version: 2.2
 name:          leading-comma
 version:       0
 synopsis:      leading comma, trailing comma, or ordinary
diff --git a/tests/ParserTests/regressions/libpq1.expr b/tests/ParserTests/regressions/libpq1.expr
--- a/tests/ParserTests/regressions/libpq1.expr
+++ b/tests/ParserTests/regressions/libpq1.expr
@@ -581,7 +581,7 @@
                            copyright = concat
                                          ["(c) 2010 Grant Monroe\n", "(c) 2011 Leon P Smith"],
                            customFieldsPD = [],
-                           dataDir = "",
+                           dataDir = ".",
                            dataFiles = [],
                            description = concat
                                            ["This is a binding to libpq: the C application\n",
diff --git a/tests/ParserTests/regressions/libpq2.expr b/tests/ParserTests/regressions/libpq2.expr
--- a/tests/ParserTests/regressions/libpq2.expr
+++ b/tests/ParserTests/regressions/libpq2.expr
@@ -581,7 +581,7 @@
                            copyright = concat
                                          ["(c) 2010 Grant Monroe\n", "(c) 2011 Leon P Smith"],
                            customFieldsPD = [],
-                           dataDir = "",
+                           dataDir = ".",
                            dataFiles = [],
                            description = concat
                                            ["This is a binding to libpq: the C application\n",
diff --git a/tests/ParserTests/regressions/mixin-1.cabal b/tests/ParserTests/regressions/mixin-1.cabal
--- a/tests/ParserTests/regressions/mixin-1.cabal
+++ b/tests/ParserTests/regressions/mixin-1.cabal
@@ -1,6 +1,7 @@
 cabal-version: 2.0
 name: mixin
 version: 0
+build-type: Simple
 
 executable str-example
   main-is:             Main.hs
diff --git a/tests/ParserTests/regressions/mixin-1.expr b/tests/ParserTests/regressions/mixin-1.expr
--- a/tests/ParserTests/regressions/mixin-1.expr
+++ b/tests/ParserTests/regressions/mixin-1.expr
@@ -88,11 +88,11 @@
                           {author = "",
                            benchmarks = [],
                            bugReports = "",
-                           buildTypeRaw = Nothing,
+                           buildTypeRaw = Just Simple,
                            category = "",
                            copyright = "",
                            customFieldsPD = [],
-                           dataDir = "",
+                           dataDir = ".",
                            dataFiles = [],
                            description = "",
                            executables = [],
diff --git a/tests/ParserTests/regressions/mixin-1.format b/tests/ParserTests/regressions/mixin-1.format
--- a/tests/ParserTests/regressions/mixin-1.format
+++ b/tests/ParserTests/regressions/mixin-1.format
@@ -1,6 +1,7 @@
 cabal-version: 2.0
 name:          mixin
 version:       0
+build-type:    Simple
 
 executable str-example
     main-is:        Main.hs
diff --git a/tests/ParserTests/regressions/mixin-2.expr b/tests/ParserTests/regressions/mixin-2.expr
--- a/tests/ParserTests/regressions/mixin-2.expr
+++ b/tests/ParserTests/regressions/mixin-2.expr
@@ -92,7 +92,7 @@
                            category = "",
                            copyright = "",
                            customFieldsPD = [],
-                           dataDir = "",
+                           dataDir = ".",
                            dataFiles = [],
                            description = "",
                            executables = [],
diff --git a/tests/ParserTests/regressions/mixin-3.expr b/tests/ParserTests/regressions/mixin-3.expr
--- a/tests/ParserTests/regressions/mixin-3.expr
+++ b/tests/ParserTests/regressions/mixin-3.expr
@@ -91,7 +91,7 @@
                            category = "",
                            copyright = "",
                            customFieldsPD = [],
-                           dataDir = "",
+                           dataDir = ".",
                            dataFiles = [],
                            description = "",
                            executables = [],
diff --git a/tests/ParserTests/regressions/multiple-libs-2.expr b/tests/ParserTests/regressions/multiple-libs-2.expr
--- a/tests/ParserTests/regressions/multiple-libs-2.expr
+++ b/tests/ParserTests/regressions/multiple-libs-2.expr
@@ -140,7 +140,7 @@
                            category = "",
                            copyright = "",
                            customFieldsPD = [],
-                           dataDir = "",
+                           dataDir = ".",
                            dataFiles = [],
                            description = "",
                            executables = [],
diff --git a/tests/ParserTests/regressions/noVersion.expr b/tests/ParserTests/regressions/noVersion.expr
--- a/tests/ParserTests/regressions/noVersion.expr
+++ b/tests/ParserTests/regressions/noVersion.expr
@@ -81,7 +81,7 @@
                            category = "",
                            copyright = "",
                            customFieldsPD = [],
-                           dataDir = "",
+                           dataDir = ".",
                            dataFiles = [],
                            description = "",
                            executables = [],
diff --git a/tests/ParserTests/regressions/nothing-unicode.expr b/tests/ParserTests/regressions/nothing-unicode.expr
--- a/tests/ParserTests/regressions/nothing-unicode.expr
+++ b/tests/ParserTests/regressions/nothing-unicode.expr
@@ -136,7 +136,7 @@
                            category = "",
                            copyright = "",
                            customFieldsPD = [_×_ "x-\28961" "\28961"],
-                           dataDir = "",
+                           dataDir = ".",
                            dataFiles = [],
                            description = "",
                            executables = [],
diff --git a/tests/ParserTests/regressions/shake.expr b/tests/ParserTests/regressions/shake.expr
--- a/tests/ParserTests/regressions/shake.expr
+++ b/tests/ParserTests/regressions/shake.expr
@@ -2059,7 +2059,7 @@
                            category = "Development, Shake",
                            copyright = "Neil Mitchell 2011-2017",
                            customFieldsPD = [],
-                           dataDir = "",
+                           dataDir = ".",
                            dataFiles = ["html/viz.js",
                                         "html/profile.html",
                                         "html/progress.html",
diff --git a/tests/ParserTests/regressions/spdx-1.expr b/tests/ParserTests/regressions/spdx-1.expr
--- a/tests/ParserTests/regressions/spdx-1.expr
+++ b/tests/ParserTests/regressions/spdx-1.expr
@@ -68,7 +68,7 @@
                            category = "",
                            copyright = "",
                            customFieldsPD = [],
-                           dataDir = "",
+                           dataDir = ".",
                            dataFiles = [],
                            description = "",
                            executables = [],
diff --git a/tests/ParserTests/regressions/spdx-2.expr b/tests/ParserTests/regressions/spdx-2.expr
--- a/tests/ParserTests/regressions/spdx-2.expr
+++ b/tests/ParserTests/regressions/spdx-2.expr
@@ -68,7 +68,7 @@
                            category = "",
                            copyright = "",
                            customFieldsPD = [],
-                           dataDir = "",
+                           dataDir = ".",
                            dataFiles = [],
                            description = "",
                            executables = [],
diff --git a/tests/ParserTests/regressions/spdx-3.expr b/tests/ParserTests/regressions/spdx-3.expr
--- a/tests/ParserTests/regressions/spdx-3.expr
+++ b/tests/ParserTests/regressions/spdx-3.expr
@@ -68,7 +68,7 @@
                            category = "",
                            copyright = "",
                            customFieldsPD = [],
-                           dataDir = "",
+                           dataDir = ".",
                            dataFiles = [],
                            description = "",
                            executables = [],
diff --git a/tests/ParserTests/regressions/th-lift-instances.expr b/tests/ParserTests/regressions/th-lift-instances.expr
--- a/tests/ParserTests/regressions/th-lift-instances.expr
+++ b/tests/ParserTests/regressions/th-lift-instances.expr
@@ -476,7 +476,7 @@
                            category = "Template Haskell",
                            copyright = "Copyright (C) 2013-2014 Benno F\252nfst\252ck",
                            customFieldsPD = [_×_ "x-revision" "1"],
-                           dataDir = "",
+                           dataDir = ".",
                            dataFiles = [],
                            description = concat
                                            ["Most data types in haskell platform do not have Lift instances. This package provides orphan instances\n",
diff --git a/tests/ParserTests/regressions/version-sets.cabal b/tests/ParserTests/regressions/version-sets.cabal
--- a/tests/ParserTests/regressions/version-sets.cabal
+++ b/tests/ParserTests/regressions/version-sets.cabal
@@ -1,4 +1,4 @@
-cabal-version:       2.5
+cabal-version:       3.0
 name:                version-sets
 version:             0
 synopsis:            version set notation
diff --git a/tests/ParserTests/regressions/version-sets.expr b/tests/ParserTests/regressions/version-sets.expr
--- a/tests/ParserTests/regressions/version-sets.expr
+++ b/tests/ParserTests/regressions/version-sets.expr
@@ -198,7 +198,7 @@
                            category = "",
                            copyright = "",
                            customFieldsPD = [],
-                           dataDir = "",
+                           dataDir = ".",
                            dataFiles = [],
                            description = "",
                            executables = [],
@@ -217,7 +217,7 @@
                            pkgUrl = "",
                            setupBuildInfo = Nothing,
                            sourceRepos = [],
-                           specVersionRaw = Left `mkVersion [2,5]`,
+                           specVersionRaw = Left `mkVersion [3,0]`,
                            stability = "",
                            subLibraries = [],
                            synopsis = "version set notation",
diff --git a/tests/ParserTests/regressions/version-sets.format b/tests/ParserTests/regressions/version-sets.format
--- a/tests/ParserTests/regressions/version-sets.format
+++ b/tests/ParserTests/regressions/version-sets.format
@@ -1,4 +1,4 @@
-cabal-version: 2.5
+cabal-version: 3.0
 name:          version-sets
 version:       0
 tested-with:
diff --git a/tests/ParserTests/regressions/wl-pprint-indef.expr b/tests/ParserTests/regressions/wl-pprint-indef.expr
--- a/tests/ParserTests/regressions/wl-pprint-indef.expr
+++ b/tests/ParserTests/regressions/wl-pprint-indef.expr
@@ -165,7 +165,7 @@
                            category = "Text",
                            copyright = "",
                            customFieldsPD = [],
-                           dataDir = "",
+                           dataDir = ".",
                            dataFiles = [],
                            description = concat
                                            ["This is a pretty printing library based on Wadler's paper \"A Prettier\n",
