diff --git a/changelog.d/pr-10646 b/changelog.d/pr-10646 deleted file mode 100644 index ab1366afaa9..00000000000 --- a/changelog.d/pr-10646 +++ /dev/null @@ -1,34 +0,0 @@ ---- -synopsis: Deduplicate path separator duplicates -packages: [cabal-install-solver] -prs: 10646 -issues: 10645 ---- - -The "using configuration from" message no longer has duplicates on Windows when -the `cabal.project` uses forward slashes for its imports but the message reports -imports with backslashes. - -```diff -$ cat cabal.project -import: dir-a/b.config - -$ cabal build all --dry-run -... -When using configuration from: -- - dir-a/b.config - - dir-a\b.config - - cabal.project -``` - -## Ord ProjectConfigPath Instance Changes - -For comparison purposes, path separators are normalized to the @buildOS@ -platform's path separator. - -```haskell --- >>> let abFwd = ProjectConfigPath $ "a/b.config" :| [] --- >>> let abBwd = ProjectConfigPath $ "a\\b.config" :| [] --- >>> compare abFwd abBwd --- EQ -``` diff --git a/changelog.d/pr-10646.md b/changelog.d/pr-10646.md new file mode 100644 index 00000000000..065f7800710 --- /dev/null +++ b/changelog.d/pr-10646.md @@ -0,0 +1,71 @@ +--- +synopsis: Configuration messages without duplicates +packages: [cabal-install-solver] +prs: 10646 +issues: 10645 +--- + +The "using configuration from" message no longer has duplicates on Windows when +the `cabal.project` uses forward slashes for its imports but the message reports +imports with backslashes. + +```diff +$ cat cabal.project +import: dir-a/b.config + +$ cabal build all --dry-run +... +When using configuration from: +- - dir-a/b.config + - dir-a\b.config + - cabal.project +``` + +## Changed `Ord ProjectConfigPath` Instance + +For comparison purposes, path separators are normalized to the `buildOS` +platform's path separator. + +```haskell +-- >>> let abFwd = ProjectConfigPath $ "a/b.config" :| [] +-- >>> let abBwd = ProjectConfigPath $ "a\\b.config" :| [] +-- >>> compare abFwd abBwd +-- EQ +``` + +## Changes in `cabal-testsuite` + +With `ghc-9.12.1` adding `-XMultilineStrings` it would be easier to write +multiline strings in `cabal-testsuite/PackageTests/**/*.test.hs` scripts but the +catch is we run these tests with older `GHC` versions so would need to use +`-XCPP` for those versions and the C preprocessor does not play nicely with +string gaps. To avoid these problems a `readVerbatimFile` function can be used +to read the expected multiline output for tests verbatim. This has the same +implementation as `readFile` from the `strict-io` package to avoid problems at +cleanup. + +``` +Warning: Windows file locking hack: hit the retry limit 3 while trying to +remove C:\Users\phild\AppData\Local\Temp\cabal-testsuite-8376 +cabal.test.hs: +C:\Users\\AppData\Local\Temp\cabal-testsuite-8376\errors.expect.txt: +removePathForcibly:DeleteFile +"\\\\?\\C:\\Users\\\\AppData\\Local\\Temp\\cabal-testsuite-8376\\errors.expect.txt": +permission denied (The process cannot access the file because it is being +used by another process.) +``` + +The other process accessing the file is `C:\WINDOWS\System32\svchost.exe` +running a `QueryDirectory` event and this problem only occurs when the test +fails. + +The `assertOutputContains` function was modifying the output but in a way not +"visible" enough. An added `assertOn` function (that `assertOutputContains` +calls) takes a `NeedleHaystack` configuration for how the search is made, what +to expect and and how to display the expected and actual values. A pilcrow ΒΆ is +often used to visibly display line endings but our terminal output is restricted +to ASCII so lines are visibly delimited between `^` and `$` visible markers. The +needle (the expected output fragment) is shown annotated this way and the +haystack (the output) can optionally be shown this way too. + +The `concatOutput` function is renamed to `lineBreaksToSpaces`.