Skip to content

Commit 007cec7

Browse files
committed
Refresh the CI matrix and fix warning in tests/MakeAbsolute.hs
- The matrix has been updated to include the most recent versions of GHC and Cabal. - Some of the versions in between the oldest and newest have been dropped to reduce CI workload. - Fixed a warning in tests/MakeAbsolute.hs due to use of partial function "head". Fixes #205.
1 parent 803411c commit 007cec7

2 files changed

Lines changed: 7 additions & 10 deletions

File tree

.github/workflows/build.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,13 @@ jobs:
1717
fail-fast: false
1818
matrix:
1919
include:
20-
- { os: macOS-14, stack: lts-20.26, stack-extra-deps: "bytestring-0.11.3.0, file-io-0.1.4, filepath-1.5.2.0, os-string-2.0.2, unix-2.8.5.1", stack-package-flags: "{file-io: {os-string: true}, unix: {os-string: true}}" }
20+
- { os: macos-latest, stack: lts-20.26, stack-extra-deps: "bytestring-0.11.3.0, file-io-0.1.4, filepath-1.5.2.0, os-string-2.0.2, unix-2.8.5.1", stack-package-flags: "{file-io: {os-string: true}, unix: {os-string: true}}" }
2121
- { os: macos-latest, stack: lts-24.29, ghc-flags: -Werror=deprecations }
2222
- { os: ubuntu-latest, ghc: 8.10.7, cabal: 3.8.1.0 }
23-
- { os: ubuntu-latest, ghc: 9.0.2, cabal: 3.8.1.0 }
24-
- { os: ubuntu-latest, ghc: 9.2.4, cabal: 3.8.1.0 }
25-
- { os: ubuntu-latest, ghc: 9.4.3, cabal: 3.8.1.0, upload-sdist: true }
26-
# TODO: Unpin cabal from 3.12.10 after https://github.com/haskell/cabal/issues/10718 is fixed.
27-
- { os: ubuntu-latest, ghc: latest, cabal: 3.12.1.0, cabal-package-flags: +os-string, ghc-flags: -Werror=deprecations }
28-
- { os: windows-latest, stack: lts-15.3, stack-extra-deps: "bytestring-0.11.3.0, file-io-0.1.4, filepath-1.4.100.0, time-1.9.3, Win32-2.14.1.0", overrides: "before_prepare() { sed -i.bak -e /CreateSymbolicLinkW/d -e /GetFinalPathNameByHandleW/d configure.ac; }" }
29-
- { os: windows-latest, stack: lts-17.5, stack-extra-deps: "bytestring-0.11.3.0, file-io-0.1.4, filepath-1.4.100.0, time-1.9.3, Win32-2.14.1.0" }
30-
- { os: windows-latest, stack: lts-22.7, stack-extra-deps: "bytestring-0.11.5.3, file-io-0.1.4, filepath-1.5.2.0, os-string-2.0.2, time-1.14, Win32-2.14.1.0", stack-package-flags: "{file-io: {os-string: true}, Win32: {os-string: true}}", ghc-flags: -Werror=deprecations }
23+
- { os: ubuntu-latest, ghc: 9.4.8, cabal: 3.12.1.0 }
24+
- { os: ubuntu-latest, ghc: latest, cabal: 3.16.1.0, upload-sdist: true, ghc-flags: -Werror=deprecations }
25+
- { os: windows-latest, stack: lts-16.31, stack-extra-deps: "bytestring-0.11.3.0, file-io-0.1.4, filepath-1.4.100.0, time-1.9.3, Win32-2.14.1.0", overrides: "before_prepare() { sed -i.bak -e /CreateSymbolicLinkW/d -e /GetFinalPathNameByHandleW/d configure.ac; }" }
26+
- { os: windows-latest, stack: lts-24.29, ghc-flags: -Werror=deprecations }
3127
runs-on: ${{ matrix.os }}
3228
env:
3329
CABAL_PACKAGE_FLAGS: ${{ matrix.cabal-package-flags }}

tests/MakeAbsolute.hs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ main _t = do
4343

4444
#if defined(mingw32_HOST_OS)
4545
cwd <- getCurrentDirectory
46-
let driveLetter = toUpper (toChar (head (unpack (takeDrive cwd))))
46+
cwdDriveLetter : _ <- pure (unpack (takeDrive cwd))
47+
let driveLetter = toUpper (toChar cwdDriveLetter)
4748
let driveLetter' = if driveLetter == 'Z' then 'A' else succ driveLetter
4849
drp1 <- makeAbsolute (os (driveLetter : ":foobar"))
4950
drp2 <- makeAbsolute (os (driveLetter' : ":foobar"))

0 commit comments

Comments
 (0)