diff --git a/.github/workflows/haskell-ci.yml b/.github/workflows/haskell-ci.yml new file mode 100644 index 0000000..195ac50 --- /dev/null +++ b/.github/workflows/haskell-ci.yml @@ -0,0 +1,276 @@ +# This GitHub workflow config has been generated by a script via +# +# haskell-ci 'github' 'cabal.project' +# +# To regenerate the script (for example after adjusting tested-with) run +# +# haskell-ci regenerate +# +# For more information, see https://github.com/andreasabel/haskell-ci +# +# version: 0.19.20241111 +# +# REGENDATA ("0.19.20241111",["github","cabal.project"]) +# +name: Haskell-CI +on: + push: + branches: + - master + pull_request: + branches: + - master +jobs: + linux: + name: Haskell-CI - Linux - ${{ matrix.compiler }} + runs-on: ubuntu-20.04 + timeout-minutes: + 60 + container: + image: buildpack-deps:jammy + continue-on-error: ${{ matrix.allow-failure }} + strategy: + matrix: + include: + - compiler: ghc-9.12.0.20241031 + compilerKind: ghc + compilerVersion: 9.12.0.20241031 + setup-method: ghcup + allow-failure: false + - compiler: ghc-9.10.1 + compilerKind: ghc + compilerVersion: 9.10.1 + setup-method: ghcup + allow-failure: false + - compiler: ghc-9.8.2 + compilerKind: ghc + compilerVersion: 9.8.2 + setup-method: ghcup + allow-failure: false + - compiler: ghc-9.6.6 + compilerKind: ghc + compilerVersion: 9.6.6 + setup-method: ghcup + allow-failure: false + - compiler: ghc-9.4.8 + compilerKind: ghc + compilerVersion: 9.4.8 + setup-method: ghcup + allow-failure: false + - compiler: ghc-9.2.8 + compilerKind: ghc + compilerVersion: 9.2.8 + setup-method: ghcup + allow-failure: false + - compiler: ghc-9.0.2 + compilerKind: ghc + compilerVersion: 9.0.2 + setup-method: ghcup + allow-failure: false + - compiler: ghc-8.10.7 + compilerKind: ghc + compilerVersion: 8.10.7 + setup-method: ghcup + allow-failure: false + - compiler: ghc-8.8.4 + compilerKind: ghc + compilerVersion: 8.8.4 + setup-method: ghcup + allow-failure: false + - compiler: ghc-8.6.5 + compilerKind: ghc + compilerVersion: 8.6.5 + setup-method: ghcup + allow-failure: false + - compiler: ghc-8.4.4 + compilerKind: ghc + compilerVersion: 8.4.4 + setup-method: ghcup + allow-failure: false + - compiler: ghc-8.2.2 + compilerKind: ghc + compilerVersion: 8.2.2 + setup-method: ghcup + allow-failure: false + - compiler: ghc-8.0.2 + compilerKind: ghc + compilerVersion: 8.0.2 + setup-method: ghcup + allow-failure: false + fail-fast: false + steps: + - name: apt + run: | + apt-get update + apt-get install -y --no-install-recommends gnupg ca-certificates dirmngr curl git software-properties-common libtinfo5 libnuma-dev + mkdir -p "$HOME/.ghcup/bin" + curl -sL https://downloads.haskell.org/ghcup/0.1.30.0/x86_64-linux-ghcup-0.1.30.0 > "$HOME/.ghcup/bin/ghcup" + chmod a+x "$HOME/.ghcup/bin/ghcup" + "$HOME/.ghcup/bin/ghcup" config add-release-channel https://raw.githubusercontent.com/haskell/ghcup-metadata/master/ghcup-prereleases-0.0.8.yaml; + "$HOME/.ghcup/bin/ghcup" install ghc "$HCVER" || (cat "$HOME"/.ghcup/logs/*.* && false) + "$HOME/.ghcup/bin/ghcup" install cabal 3.12.1.0 || (cat "$HOME"/.ghcup/logs/*.* && false) + env: + HCKIND: ${{ matrix.compilerKind }} + HCNAME: ${{ matrix.compiler }} + HCVER: ${{ matrix.compilerVersion }} + - name: Set PATH and environment variables + run: | + echo "$HOME/.cabal/bin" >> $GITHUB_PATH + echo "LANG=C.UTF-8" >> "$GITHUB_ENV" + echo "CABAL_DIR=$HOME/.cabal" >> "$GITHUB_ENV" + echo "CABAL_CONFIG=$HOME/.cabal/config" >> "$GITHUB_ENV" + HCDIR=/opt/$HCKIND/$HCVER + HC=$("$HOME/.ghcup/bin/ghcup" whereis ghc "$HCVER") + HCPKG=$(echo "$HC" | sed 's#ghc$#ghc-pkg#') + HADDOCK=$(echo "$HC" | sed 's#ghc$#haddock#') + echo "HC=$HC" >> "$GITHUB_ENV" + echo "HCPKG=$HCPKG" >> "$GITHUB_ENV" + echo "HADDOCK=$HADDOCK" >> "$GITHUB_ENV" + echo "CABAL=$HOME/.ghcup/bin/cabal-3.12.1.0 -vnormal+nowrap" >> "$GITHUB_ENV" + HCNUMVER=$(${HC} --numeric-version|perl -ne '/^(\d+)\.(\d+)\.(\d+)(\.(\d+))?$/; print(10000 * $1 + 100 * $2 + ($3 == 0 ? $5 != 1 : $3))') + echo "HCNUMVER=$HCNUMVER" >> "$GITHUB_ENV" + echo "ARG_TESTS=--disable-tests" >> "$GITHUB_ENV" + echo "ARG_BENCH=--enable-benchmarks" >> "$GITHUB_ENV" + if [ $((HCNUMVER >= 91200)) -ne 0 ] ; then echo "HEADHACKAGE=true" >> "$GITHUB_ENV" ; else echo "HEADHACKAGE=false" >> "$GITHUB_ENV" ; fi + echo "ARG_COMPILER=--$HCKIND --with-compiler=$HC" >> "$GITHUB_ENV" + echo "GHCJSARITH=0" >> "$GITHUB_ENV" + env: + HCKIND: ${{ matrix.compilerKind }} + HCNAME: ${{ matrix.compiler }} + HCVER: ${{ matrix.compilerVersion }} + - name: env + run: | + env + - name: write cabal config + run: | + mkdir -p $CABAL_DIR + cat >> $CABAL_CONFIG <> $CABAL_CONFIG <> $CABAL_CONFIG < cabal-plan.xz + echo 'f62ccb2971567a5f638f2005ad3173dba14693a45154c1508645c52289714cb2 cabal-plan.xz' | sha256sum -c - + xz -d < cabal-plan.xz > $HOME/.cabal/bin/cabal-plan + rm -f cabal-plan.xz + chmod a+x $HOME/.cabal/bin/cabal-plan + cabal-plan --version + - name: checkout + uses: actions/checkout@v4 + with: + path: source + - name: initial cabal.project for sdist + run: | + touch cabal.project + echo "packages: $GITHUB_WORKSPACE/source/system-fileio" >> cabal.project + echo "packages: $GITHUB_WORKSPACE/source/system-filepath" >> cabal.project + cat cabal.project + - name: sdist + run: | + mkdir -p sdist + $CABAL sdist all --output-dir $GITHUB_WORKSPACE/sdist + - name: unpack + run: | + mkdir -p unpacked + find sdist -maxdepth 1 -type f -name '*.tar.gz' -exec tar -C $GITHUB_WORKSPACE/unpacked -xzvf {} \; + - name: generate cabal.project + run: | + PKGDIR_system_fileio="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/system-fileio-[0-9.]*')" + echo "PKGDIR_system_fileio=${PKGDIR_system_fileio}" >> "$GITHUB_ENV" + PKGDIR_system_filepath="$(find "$GITHUB_WORKSPACE/unpacked" -maxdepth 1 -type d -regex '.*/system-filepath-[0-9.]*')" + echo "PKGDIR_system_filepath=${PKGDIR_system_filepath}" >> "$GITHUB_ENV" + rm -f cabal.project cabal.project.local + touch cabal.project + touch cabal.project.local + echo "packages: ${PKGDIR_system_fileio}" >> cabal.project + echo "packages: ${PKGDIR_system_filepath}" >> cabal.project + if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package system-fileio" >> cabal.project ; fi + if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi + if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo "package system-filepath" >> cabal.project ; fi + if [ $((HCNUMVER >= 80200)) -ne 0 ] ; then echo " ghc-options: -Werror=missing-methods" >> cabal.project ; fi + cat >> cabal.project <> cabal.project + fi + $HCPKG list --simple-output --names-only | perl -ne 'for (split /\s+/) { print "constraints: any.$_ installed\n" unless /^(system-fileio|system-filepath)$/; }' >> cabal.project.local + cat cabal.project + cat cabal.project.local + - name: dump install plan + run: | + $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dry-run all + cabal-plan + - name: restore cache + uses: actions/cache/restore@v4 + with: + key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} + path: ~/.cabal/store + restore-keys: ${{ runner.os }}-${{ matrix.compiler }}- + - name: install dependencies + run: | + $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks --dependencies-only -j2 all + $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH --dependencies-only -j2 all + - name: build w/o tests + run: | + $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all + - name: build + run: | + $CABAL v2-build $ARG_COMPILER $ARG_TESTS $ARG_BENCH all --write-ghc-environment-files=always + - name: cabal check + run: | + cd ${PKGDIR_system_fileio} || false + ${CABAL} -vnormal check + cd ${PKGDIR_system_filepath} || false + ${CABAL} -vnormal check + - name: haddock + run: | + $CABAL v2-haddock --disable-documentation --haddock-all $ARG_COMPILER --with-haddock $HADDOCK $ARG_TESTS $ARG_BENCH all + - name: unconstrained build + run: | + rm -f cabal.project.local + $CABAL v2-build $ARG_COMPILER --disable-tests --disable-benchmarks all + - name: save cache + uses: actions/cache/save@v4 + if: always() + with: + key: ${{ runner.os }}-${{ matrix.compiler }}-${{ github.sha }} + path: ~/.cabal/store diff --git a/.gitignore b/.gitignore index 0111a35..398474a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,7 @@ /.shelly/ dist/ +dist-newstyle/ tarballs/ *.swp +.stack-work/ +stack*.yaml.lock diff --git a/cabal.haskell-ci b/cabal.haskell-ci new file mode 100644 index 0000000..85b6564 --- /dev/null +++ b/cabal.haskell-ci @@ -0,0 +1,3 @@ +branches: master + +tests: False \ No newline at end of file diff --git a/cabal.project b/cabal.project new file mode 100644 index 0000000..3d51178 --- /dev/null +++ b/cabal.project @@ -0,0 +1,3 @@ +packages: + system-fileio + system-filepath diff --git a/stack-9.4.yaml b/stack-9.4.yaml new file mode 100644 index 0000000..c4c2684 --- /dev/null +++ b/stack-9.4.yaml @@ -0,0 +1,5 @@ +resolver: lts-21.25 + +packages: +- system-fileio +- system-filepath diff --git a/stack-9.6.yaml b/stack-9.6.yaml new file mode 100644 index 0000000..35e351b --- /dev/null +++ b/stack-9.6.yaml @@ -0,0 +1,10 @@ +resolver: lts-22.41 + +packages: +- system-fileio +- system-filepath + +extra-deps: +- chell-0.5.0.2 +- chell-quickcheck-0.2.5.4 +- patience-0.3 diff --git a/stack.yaml b/stack.yaml new file mode 100644 index 0000000..ac2f477 --- /dev/null +++ b/stack.yaml @@ -0,0 +1,10 @@ +resolver: nightly-2024-10-21 + +packages: +- system-fileio +- system-filepath + +extra-deps: +- chell-0.5.0.2 +- chell-quickcheck-0.2.5.4 +- patience-0.3 diff --git a/system-fileio/ChangeLog.md b/system-fileio/ChangeLog.md index 0cf677c..161d3ee 100644 --- a/system-fileio/ChangeLog.md +++ b/system-fileio/ChangeLog.md @@ -1,16 +1,21 @@ # Changelog for system-fileio +## 0.3.16.5 + +* Fix building of the testsuite with `unix-2.8`. +* Tested with GHC 8.0 - 9.12.0. + ## 0.3.16.4 -* Fix for Win32 2.6 and above [#21](https://github.com/fpco/haskell-filesystem/pull/21) +* Fix for Win32 2.6 and above [#21](https://github.com/fpco/haskell-filesystem/pull/21). ## 0.3.16.2 -* withHANDLE (Win32) now works on directories [#8](https://github.com/fpco/haskell-filesystem/issues/8) [#10](https://github.com/fpco/haskell-filesystem/pull/10) +* `withHANDLE` (Win32) now works on directories [#8](https://github.com/fpco/haskell-filesystem/issues/8) [#10](https://github.com/fpco/haskell-filesystem/pull/10). ## 0.3.16.1 -* Use different path encoding on Darwin in POSIX tests [#6](https://github.com/fpco/haskell-filesystem/pull/6) +* Use different path encoding on Darwin in POSIX tests [#6](https://github.com/fpco/haskell-filesystem/pull/6). ## 0.3.16 diff --git a/system-fileio/README.md b/system-fileio/README.md index 01ec5af..06fc6f2 100644 --- a/system-fileio/README.md +++ b/system-fileio/README.md @@ -1,6 +1,6 @@ ## system-fileio -Please see [deprecation announcement](https://plus.google.com/+MichaelSnoyman/posts/Ft5hnPqpgEx) +Legacy package (deprecated). This is a small wrapper around the `directory`, `unix`, and `Win32` packages, for use with `system-filepath`. It provides a consistent API diff --git a/system-fileio/system-fileio.cabal b/system-fileio/system-fileio.cabal index ecd02de..ab75b25 100644 --- a/system-fileio/system-fileio.cabal +++ b/system-fileio/system-fileio.cabal @@ -1,22 +1,24 @@ +cabal-version: 1.18 name: system-fileio -version: 0.3.16.4 +version: 0.3.16.5 license: MIT license-file: license.txt author: John Millikin -maintainer: FP Complete +maintainer: https://github.com/fpco/haskell-filesystem build-type: Simple -cabal-version: >= 1.8 category: System stability: experimental homepage: https://github.com/fpco/haskell-filesystem bug-reports: https://github.com/fpco/haskell-filesystem/issues synopsis: Consistent filesystem interaction across GHC versions (deprecated) -description: Please see: https://plus.google.com/+MichaelSnoyman/posts/Ft5hnPqpgEx +description: Consistent filesystem interaction across GHC versions (deprecated package). -extra-source-files: +extra-doc-files: README.md ChangeLog.md + +extra-source-files: lib/hssystemfileio-unix.h lib/hssystemfileio-win32.h -- @@ -26,6 +28,21 @@ extra-source-files: tests/FilesystemTests/Util.hs tests/FilesystemTests/Windows.hs +tested-with: + GHC == 9.12.0 + GHC == 9.10.1 + GHC == 9.8.2 + GHC == 9.6.6 + GHC == 9.4.8 + GHC == 9.2.8 + GHC == 9.0.2 + GHC == 8.10.7 + GHC == 8.8.4 + GHC == 8.6.5 + GHC == 8.4.4 + GHC == 8.2.2 + GHC == 8.0.2 + source-repository head type: git location: https://github.com/fpco/haskell-filesystem.git @@ -35,11 +52,11 @@ library hs-source-dirs: lib build-depends: - base >= 4.0 && < 5.0 + base >= 4.0 && < 5 , bytestring >= 0.9 , system-filepath >= 0.3.1 && < 0.5 , text >= 0.7.1 - , time >= 1.0 && < 2.0 + , time >= 1.0 && < 2 if os(windows) cpp-options: -DCABAL_OS_WINDOWS @@ -57,6 +74,8 @@ library exposed-modules: Filesystem + default-language: Haskell2010 + test-suite filesystem_tests type: exitcode-stdio-1.0 main-is: FilesystemTests.hs @@ -66,14 +85,14 @@ test-suite filesystem_tests hs-source-dirs: tests build-depends: - base >= 4.0 && < 5.0 + base >= 4.0 && < 5 , bytestring >= 0.9 , chell >= 0.4 && < 0.6 , system-fileio , system-filepath - , temporary >= 1.1 && < 2.0 + , temporary >= 1.1 && < 2 , text - , time >= 1.0 && < 2.0 + , time >= 1.0 && < 2 , transformers >= 0.2 if os(windows) @@ -89,3 +108,5 @@ test-suite filesystem_tests FilesystemTests.Posix FilesystemTests.Util FilesystemTests.Windows + + default-language: Haskell2010 diff --git a/system-filepath/ChangeLog.md b/system-filepath/ChangeLog.md index ce0460d..5856db7 100644 --- a/system-filepath/ChangeLog.md +++ b/system-filepath/ChangeLog.md @@ -1,6 +1,13 @@ +## 0.4.14.1 + +* Remove custom setup script [#27](https://github.com/fpco/haskell-filesystem/pull/27) +* Fix warning `-Wtabs` (replaced tabs by spaces). +* Allow `deepseq-1.5`. +* Test build with GHC 8.0 - 9.12.0 + ## 0.4.14 -* Add a Semigroup instance [#20 ](https://github.com/fpco/haskell-filesystem/pull/20) +* Add a Semigroup instance [#20](https://github.com/fpco/haskell-filesystem/pull/20) ## 0.4.13.3 @@ -12,7 +19,7 @@ ## 0.4.13.1 -Allow deepseq 1.4 +* Allow `deepseq-1.4`. ## 0.4.13 diff --git a/system-filepath/README.md b/system-filepath/README.md index e622034..2872cba 100644 --- a/system-filepath/README.md +++ b/system-filepath/README.md @@ -1,6 +1,6 @@ ## system-filepath -Please see [deprecation announcement](https://plus.google.com/+MichaelSnoyman/posts/Ft5hnPqpgEx) +Legacy package (deprecated). Provides a `FilePath` datatype and utility functions for operating on it. Unlike the `filepath` package, this package does not simply reuse `String`, diff --git a/system-filepath/system-filepath.cabal b/system-filepath/system-filepath.cabal index c3b2713..4dc3058 100644 --- a/system-filepath/system-filepath.cabal +++ b/system-filepath/system-filepath.cabal @@ -1,19 +1,37 @@ cabal-version: 2.0 name: system-filepath -version: 0.4.14 +version: 0.4.14.1 synopsis: High-level, byte-based file and directory path manipulations (deprecated) -description: Please see: https://plus.google.com/+MichaelSnoyman/posts/Ft5hnPqpgEx +description: High-level, byte-based file and directory path manipulations (deprecated). license: MIT license-file: license.txt author: John Millikin -maintainer: FP Complete +maintainer: https://github.com/fpco/haskell-filesystem copyright: John Millikin 2010-2012 build-type: Simple category: System stability: experimental homepage: https://github.com/fpco/haskell-filesystem bug-reports: https://github.com/fpco/haskell-filesystem/issues -extra-source-files: README.md ChangeLog.md + +extra-doc-files: + README.md + ChangeLog.md + +tested-with: + GHC == 9.12.0 + GHC == 9.10.1 + GHC == 9.8.2 + GHC == 9.6.6 + GHC == 9.4.8 + GHC == 9.2.8 + GHC == 9.0.2 + GHC == 8.10.7 + GHC == 8.8.4 + GHC == 8.6.5 + GHC == 8.4.4 + GHC == 8.2.2 + GHC == 8.0.2 source-repository head type: git @@ -24,9 +42,9 @@ library hs-source-dirs: lib build-depends: - base >= 4.0 && < 5.0 + base >= 4.0 && < 5 , bytestring >= 0.9 - , deepseq >= 1.1 && < 1.5 + , deepseq >= 1.1 && < 1.6 , text >= 0.11.0.6 if !impl(ghc >= 8.0) build-depends: @@ -46,6 +64,8 @@ library other-modules: Filesystem.Path.Internal + default-language: Haskell2010 + test-suite filesystem_path_tests type: exitcode-stdio-1.0 main-is: FilesystemPathTests.hs @@ -55,10 +75,12 @@ test-suite filesystem_path_tests hs-source-dirs: tests build-depends: - base > 4.0 && < 5.0 + base > 4.0 && < 5 , bytestring - , chell >= 0.4 && < 0.5 + , chell >= 0.4 && < 0.6 , chell-quickcheck >= 0.2 && < 0.3 , QuickCheck , system-filepath , text + + default-language: Haskell2010