From e61661e9e490ced0f69f2277db1d3c52f82e9b03 Mon Sep 17 00:00:00 2001 From: Andreas Abel Date: Wed, 3 Apr 2024 16:15:49 +0200 Subject: [PATCH 1/4] Cabal files updated for 0.9.5.0 --- frontend/granule-frontend.cabal | 4 ++-- interpreter/granule-interpreter.cabal | 7 +++++-- repl/granule-repl.cabal | 4 ++-- server/granule-language-server.cabal | 4 ++-- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/frontend/granule-frontend.cabal b/frontend/granule-frontend.cabal index 11c72dc25..73aa3f584 100644 --- a/frontend/granule-frontend.cabal +++ b/frontend/granule-frontend.cabal @@ -1,11 +1,11 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.35.2. +-- This file has been generated from package.yaml by hpack version 0.36.0. -- -- see: https://github.com/sol/hpack name: granule-frontend -version: 0.9.4.0 +version: 0.9.5.0 synopsis: The Granule abstract-syntax-tree, parser and type checker libraries homepage: https://github.com/granule-project/granule#readme bug-reports: https://github.com/granule-project/granule/issues diff --git a/interpreter/granule-interpreter.cabal b/interpreter/granule-interpreter.cabal index fba48a242..6dfc96114 100644 --- a/interpreter/granule-interpreter.cabal +++ b/interpreter/granule-interpreter.cabal @@ -1,11 +1,11 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.35.2. +-- This file has been generated from package.yaml by hpack version 0.36.0. -- -- see: https://github.com/sol/hpack name: granule-interpreter -version: 0.9.4.0 +version: 0.9.5.0 synopsis: The Granule interpreter homepage: https://github.com/dorchard/granule#readme bug-reports: https://github.com/dorchard/granule/issues @@ -42,6 +42,7 @@ library , base >=4.10 && <5 , clock , concurrent-extra + , containers , directory , extra , filepath @@ -77,6 +78,7 @@ executable gr , base >=4.10 && <5 , clock , concurrent-extra + , containers , directory , extra , filepath @@ -112,6 +114,7 @@ test-suite gr-golden , base >=4.10 && <5 , clock , concurrent-extra + , containers , directory , extra , filepath diff --git a/repl/granule-repl.cabal b/repl/granule-repl.cabal index 4df96af30..77821f472 100644 --- a/repl/granule-repl.cabal +++ b/repl/granule-repl.cabal @@ -1,11 +1,11 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.35.2. +-- This file has been generated from package.yaml by hpack version 0.36.0. -- -- see: https://github.com/sol/hpack name: granule-repl -version: 0.9.4.0 +version: 0.9.5.0 synopsis: The Granule interactive interpreter (grepl) homepage: https://github.com/dorchard/granule#readme bug-reports: https://github.com/dorchard/granule/issues diff --git a/server/granule-language-server.cabal b/server/granule-language-server.cabal index 3a352c933..7c8c951b3 100644 --- a/server/granule-language-server.cabal +++ b/server/granule-language-server.cabal @@ -1,11 +1,11 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.35.2. +-- This file has been generated from package.yaml by hpack version 0.36.0. -- -- see: https://github.com/sol/hpack name: granule-language-server -version: 0.9.4.0 +version: 0.9.5.0 synopsis: The Granule language server (grls) author: Daniel Marshall maintainer: Daniel Marshall From b089318a29f5c9e23acce2d7f681c4a6148168b7 Mon Sep 17 00:00:00 2001 From: Andreas Abel Date: Wed, 3 Apr 2024 16:18:07 +0200 Subject: [PATCH 2/4] Some missing golden values --- examples/Capabilities.gr.output | 1 + examples/effects_nondet.gr.output | 1 + examples/rankN.gr.output | 1 + examples/sensitivity.gr.output | 1 + 4 files changed, 4 insertions(+) create mode 100644 examples/Capabilities.gr.output create mode 100644 examples/effects_nondet.gr.output create mode 100644 examples/rankN.gr.output create mode 100644 examples/sensitivity.gr.output diff --git a/examples/Capabilities.gr.output b/examples/Capabilities.gr.output new file mode 100644 index 000000000..dd626a0f3 --- /dev/null +++ b/examples/Capabilities.gr.output @@ -0,0 +1 @@ +() \ No newline at end of file diff --git a/examples/effects_nondet.gr.output b/examples/effects_nondet.gr.output new file mode 100644 index 000000000..f606c5822 --- /dev/null +++ b/examples/effects_nondet.gr.output @@ -0,0 +1 @@ +Next (True, True) (Next (True, False) (Next (False, True) (Next (False, False) Empty))) \ No newline at end of file diff --git a/examples/rankN.gr.output b/examples/rankN.gr.output new file mode 100644 index 000000000..91a7545be --- /dev/null +++ b/examples/rankN.gr.output @@ -0,0 +1 @@ +((42, 'a'), (42, ())) \ No newline at end of file diff --git a/examples/sensitivity.gr.output b/examples/sensitivity.gr.output new file mode 100644 index 000000000..6867f09e5 --- /dev/null +++ b/examples/sensitivity.gr.output @@ -0,0 +1 @@ +413.5 \ No newline at end of file From f9f304a7f21bdf3b462dabacdeeb9e7aececfe16 Mon Sep 17 00:00:00 2001 From: Andreas Abel Date: Wed, 3 Apr 2024 16:19:19 +0200 Subject: [PATCH 3/4] Bump stack.yaml to LTS 20.26 (GHC 9.2.8) Some extra-deps could be removed. I didn't need the `extra-include-dirs` to build and test granule on my machine (macOS Monterey). --- stack.yaml | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/stack.yaml b/stack.yaml index 7b01b37d7..7d1637d51 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,4 +1,4 @@ -resolver: lts-20.0 +resolver: lts-20.26 packages: - frontend/ - interpreter/ @@ -9,17 +9,11 @@ packages: - benchmark/ # Dependency packages to be pulled from upstream that are not in the resolver -# (e.g., acme-missiles-0.3) extra-deps: -- ConfigFile-1.1.4 -- text-replace-0.1.0.2 -- syz-0.2.0.0@sha256:7307acb8f6ae7720e7e235c974281ecee912703c1394ebcac19caf83d70bb492,2345 -- clock-0.8.3 -# Dependencies for language server -- lsp-1.6.0.0 -- co-log-core-0.3.1.0 +- text-replace-0.1.0.3 +- syz-0.2.0.0 - git: https://github.com/jackohughes/haskell-src-exts - commit: 5c2647fa0746bdac046897f5a6b7e4f5ef3afa79 + commit: 5c2647fa0746bdac046897f5a6b7e4f5ef3afa79 # Override default flag values for local packages and extra-deps flags: {} @@ -40,8 +34,9 @@ extra-package-dbs: [] # # Extra directories used by stack for building -extra-include-dirs: -- /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/ffi +## Superfluous? +# extra-include-dirs: +# - /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/ffi # extra-lib-dirs: [/path/to/dir] From 559c3bfc875a6459096c23162fa74b81c0f072dd Mon Sep 17 00:00:00 2001 From: Andreas Abel Date: Wed, 3 Apr 2024 16:32:49 +0200 Subject: [PATCH 4/4] CI: use preinstalled Stack; fix caching --- .github/workflows/haskell.yml | 52 ++++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 16 deletions(-) diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml index b7a837c4a..79d934a6e 100644 --- a/.github/workflows/haskell.yml +++ b/.github/workflows/haskell.yml @@ -1,4 +1,4 @@ -name: Haskell CI +name: Stack CI on: push: @@ -15,35 +15,55 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install required libraries run: >- sudo apt install z3 + # Use preinstalled Stack. Should Stack fail to be installed, use the setup action: + # - name: Setup Haskell + # uses: haskell-actions/setup@v2 + # with: + # enable-stack: true + # stack-no-global: true - - name: Cache Stack build artifacts (user + project) - uses: actions/cache@v3 + - name: Restore Stack build artifacts (user + project) + uses: actions/cache/restore@v4 + id: cache with: path: | ~/.stack .stack-work - # best effort for cache: tie it to Stack resolver and package config - key: ${{ runner.os }}-stack-${{ hashFiles('stack.yaml.lock', 'package.yaml') }} + # Write a fresh cache each time + key: ${{ runner.os }}-stack-${{ github.sha }} restore-keys: | ${{ runner.os }}-stack - - - name: Setup Haskell - uses: actions/setup-haskell@v1 - - - name: Install GHC using Stack - if: steps.ghc.outputs.cache-hit != 'true' - run: stack setup --install-ghc - - - name: Build - run: stack build + - name: Setup Stack + run: stack setup + + - name: Build dependencies + run: stack test --only-dependencies + + # This step only consumes an extra minute without gains. + # - name: Build w/o tests + # run: stack build + + - name: Build w/ tests + run: stack test --no-run-tests - name: Run tests run: stack test + + # Always cache dependencies. + # This makes esp. sense now that some tests are broken. + - name: Cache Stack build artifacts (user + project) + uses: actions/cache/save@v4 + if: always() && steps.cache.outputs.cache-hit != 'true' + with: + path: | + ~/.stack + .stack-work + key: ${{ steps.cache.outputs.cache-primary-key }}