Skip to content

Commit

Permalink
Merge pull request #121 from rzk-lang/fix-windows-build
Browse files Browse the repository at this point in the history
Fix windows build
  • Loading branch information
fizruk authored Oct 1, 2023
2 parents 9e8fd94 + 87b2dd1 commit 119d1ee
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
10 changes: 7 additions & 3 deletions .github/workflows/ghc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ permissions:
jobs:
build:
name: "Build and test with GHC"
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
- name: 📥 Checkout repository
Expand All @@ -47,12 +50,13 @@ jobs:
mkdir -p bin/
cp $(stack exec -- which rzk) bin/.
tar -cvzf rzk-bin.tar.gz bin/
shell: bash

- name: Upload rzk binary as Artifact
uses: actions/upload-artifact@v3
with:
path: rzk-bin.tar.gz
name: rzk-bin
name: rzk-${{ runner.os }}-${{ runner.arch }}.tar.gz
if-no-files-found: error

haddock:
Expand Down Expand Up @@ -95,7 +99,7 @@ jobs:
id: download
uses: actions/download-artifact@v3
with:
name: rzk-bin
name: rzk-${{ runner.os }}-${{ runner.arch }}.tar.gz

- name: Unpack rzk-bin.tar.gz
run: |
Expand Down
3 changes: 3 additions & 0 deletions rzk/Setup.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE CPP #-}
-- Source: https://github.com/haskell/cabal/issues/6726#issuecomment-918663262

-- | Custom Setup that runs bnfc to generate the language sub-libraries
Expand All @@ -18,7 +19,9 @@ main :: IO ()
main = defaultMainWithHooks $ simpleUserHooks
{ hookedPrograms = [ bnfcProgram ]
, postConf = \args flags packageDesc localBuildInfo -> do
#ifndef mingw32_HOST_OS
_ <- system "bnfc -d -p Language.Rzk --generic --functor -o src/ grammar/Syntax.cf"
#endif
postConf simpleUserHooks args flags packageDesc localBuildInfo
}

Expand Down
1 change: 1 addition & 0 deletions rzk/package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ ghc-options:
- -Wmissing-home-modules
- -Wpartial-fields
- -Wredundant-constraints
- -optP-Wno-nonportable-include-path

library:
source-dirs: src
Expand Down
8 changes: 4 additions & 4 deletions rzk/rzk.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ library
Paths_rzk
hs-source-dirs:
src
ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints
ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -optP-Wno-nonportable-include-path
build-tools:
alex >=3.2.4
, happy >=1.19.9
Expand Down Expand Up @@ -99,7 +99,7 @@ executable rzk
Paths_rzk
hs-source-dirs:
app
ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -threaded -rtsopts -with-rtsopts=-N
ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -optP-Wno-nonportable-include-path -threaded -rtsopts -with-rtsopts=-N
build-tools:
alex >=3.2.4
, happy >=1.19.9
Expand Down Expand Up @@ -128,7 +128,7 @@ test-suite doctests
main-is: doctests.hs
hs-source-dirs:
test
ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints
ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -optP-Wno-nonportable-include-path
build-tools:
alex >=3.2.4
, happy >=1.19.9
Expand Down Expand Up @@ -157,7 +157,7 @@ test-suite rzk-test
Paths_rzk
hs-source-dirs:
test
ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -threaded -rtsopts -with-rtsopts=-N
ghc-options: -Wall -Wcompat -Widentities -Wincomplete-record-updates -Wincomplete-uni-patterns -Wmissing-home-modules -Wpartial-fields -Wredundant-constraints -optP-Wno-nonportable-include-path -threaded -rtsopts -with-rtsopts=-N
build-tools:
alex >=3.2.4
, happy >=1.19.9
Expand Down

0 comments on commit 119d1ee

Please sign in to comment.