Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support ghc9.4 #35

Merged
merged 2 commits into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 88 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
on: [push, pull_request]
name: ci

jobs:
build:
name: GHC ${{ matrix.ghc-version }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
ghc-version: ["9.2", "9.4"]
cabal: ["3.8"]
avx_flag: ["", '--constraint="Z-Data +use-avx2"']
env:
CONFIG: "--enable-tests --enable-benchmarks"

steps:
- name: CPU info
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get install cpuid
cpuid
elif [ "$RUNNER_OS" == "macOS" ]; then
brew install cpuid
cpuid
fi
shell: bash

- uses: actions/checkout@v4
with:
submodules: "recursive"

- name: Set up GHC ${{ matrix.ghc-version }}
uses: haskell-actions/setup@v2
id: setup
with:
ghc-version: ${{ matrix.ghc-version }}
cabal-version: ${{ matrix.cabal }}
cabal-update: true

- name: Configure the build
run: |
cabal configure ${{ matrix.avx_flag }} $CONFIG
cabal build all --dry-run

- name: Restore cached dependencies
uses: actions/cache/restore@v3
id: cache
env:
key: ${{ runner.os }}-ghc-${{ steps.setup.outputs.ghc-version }}-cabal-${{ steps.setup.outputs.cabal-version }}
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ env.key }}-plan-${{ hashFiles('**/plan.json') }}
restore-keys: ${{ env.key }}-

- name: Install dependencies
# If we had an exact cache hit, the dependencies will be up to date.
if: steps.cache.outputs.cache-hit != 'true'
run: cabal build all --only-dependencies

# Cache dependencies already here, so that we do not have to rebuild them should the subsequent steps fail.
- name: Save cached dependencies
uses: actions/cache/save@v3
# If we had an exact cache hit, trying to save the cache would error because of key clash.
if: steps.cache.outputs.cache-hit != 'true'
with:
path: ${{ steps.setup.outputs.cabal-store }}
key: ${{ steps.cache.outputs.cache-primary-key }}

- name: Build
run: cabal build $CONFIG

- name: Run tests
# https://github.com/haskell/cabal/issues/7883
run: |
if [ "$RUNNER_OS" == "Windows" ]; then
# windows need permission to open pipes
cabal test --enable-tests --test-show-details=direct --test-options='--skip=IPC --skip=Process'
else
cabal test --enable-tests --test-show-details=direct
fi
shell: bash

- run: |
cabal haddock
cabal check
cabal sdist
54 changes: 0 additions & 54 deletions .github/workflows/osxCI.yml

This file was deleted.

53 changes: 0 additions & 53 deletions .github/workflows/ubuntuCI.yml

This file was deleted.

47 changes: 0 additions & 47 deletions .github/workflows/winCI.yml

This file was deleted.

3 changes: 0 additions & 3 deletions Z-IO.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -389,9 +389,6 @@ test-suite Z-IO-Test
Z.IO.ProcessSpec
Z.IO.ResourceSpec

if os(linux)
other-modules: Z.IO.Network.IPCSpec

ghc-options: -threaded
default-language: Haskell2010
build-tool-depends: hspec-discover:hspec-discover ==2.*
Expand Down
12 changes: 7 additions & 5 deletions Z/IO/FileSystem/FilePath.hsc
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,22 @@ module Z.IO.FileSystem.FilePath
) where

import Control.Monad hiding (join)
import Data.Word
import Data.Bits
import qualified Data.List as List
import qualified Data.List as List
import Data.Word
import GHC.Exts
import GHC.Generics
import Prelude hiding (concat)
import qualified Z.Data.CBytes as CB
import Z.Data.CBytes (CBytes(CB), allocCBytesUnsafe, withCBytesUnsafe, withCBytesListUnsafe)
import Z.Data.CBytes (CBytes (CB), allocCBytesUnsafe,
withCBytesListUnsafe, withCBytesUnsafe)
import Z.Data.JSON (JSON)
import qualified Z.Data.Text as T
import qualified Z.Data.Vector.Base as V
import qualified Z.Data.Vector as V
import qualified Z.Data.Vector.Base as V
import Z.Foreign
import Z.IO.Environment (getEnv')
import Z.IO.Exception
import Prelude hiding (concat)

#include "hs_cwalk.h"
-- \
Expand Down
15 changes: 8 additions & 7 deletions Z/IO/UV/FFI.hsc
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,21 @@ module Z.IO.UV.FFI where

import Data.Bits
import Data.Int
import Data.Primitive.Types (Prim)
import Data.Word
import Data.Primitive.Types (Prim)
import Foreign.C.String
import Foreign.C.Types
import Foreign.Ptr
import Foreign.Storable
import GHC.Exts
import GHC.Generics
import System.Posix.Types (CSsize (..))
import Z.Data.Array.Unaligned
import Z.Data.Text.Print (Print(..))
import Z.Data.JSON (JSON)
import Z.Data.CBytes as CBytes
import Z.Data.CBytes as CBytes
import Z.Data.JSON (JSON)
import Z.Data.Text.Print (Print (..))
import Z.Foreign
import Z.IO.Network.SocketAddr (SocketAddr)
import System.Posix.Types (CSsize (..))
import GHC.Generics
import Z.IO.Network.SocketAddr (SocketAddr)

#include "hs_uv.h"
#if HAVE_UNISTD_H
Expand Down
Loading