Skip to content

Commit a2c0344

Browse files
authored
Merge pull request #42 from Neptune650/master
Fix build and add CI
2 parents c18269f + 0aba1e8 commit a2c0344

File tree

5 files changed

+116
-11
lines changed

5 files changed

+116
-11
lines changed

.github/workflows/haskell.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Haskell CI
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
9+
permissions:
10+
contents: write
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: haskell-actions/setup@v2
19+
with:
20+
ghc-version: 'latest'
21+
cabal-version: 'latest'
22+
stack-version: 'latest'
23+
24+
- name: Cache
25+
uses: actions/cache@v3
26+
env:
27+
cache-name: cache-cabal
28+
with:
29+
path: ~/.cabal
30+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/*.cabal') }}-${{ hashFiles('**/cabal.project') }}
31+
restore-keys: |
32+
${{ runner.os }}-build-${{ env.cache-name }}-
33+
${{ runner.os }}-build-
34+
${{ runner.os }}-
35+
36+
- name: Install dependencies
37+
run: sudo apt update && sudo apt install iverilog verilator
38+
39+
- name: Build and test
40+
run: make

flite/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
dist/build/Flite/flite.always:
2-
cabal configure
3-
cabal $(J) build
1+
dist/flite:
2+
stack --install-ghc build
3+
stack --local-bin-path dist install

flite/flite.cabal

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Maintainer: Jason Reich <[email protected]>, Matthew Naylor <[email protected]
88
Stability: provisional
99
Homepage: http://www.cs.york.ac.uk/fp/reduceron/
1010
Build-Type: Simple
11-
Cabal-Version: >=1.6
11+
Cabal-Version: >=1.8
1212
Description: The f-lite language is a subset of Haskell 98 and Clean consisting of function
1313
definitions, pattern matching, limited let expressions, function applications and
1414
constructor applications expressed in the explicit 'braces' layout-insensitive format.
@@ -32,7 +32,6 @@ Executable flite
3232
Flite.InterpFrontend, Flite.LambdaLift, Flite.Let, Flite.Matching,
3333
Flite.Predex, Flite.Pretty, Flite.RedCompile, Flite.RedFrontend,
3434
Flite.RedSyntax, Flite.State, Flite.Strictify, Flite.Syntax,
35-
Flite.Traversals, Flite.Writer, Flite.Writer, Flite.WriterState,
36-
Flite.Parsec.Parse, Flite.Parsec.Flite, Flite.Parsec.Prelude,
37-
Flite.Dependency, Flite.IntInfer, Flite.Strictness, Flite.WorkerWrapper,
38-
Paths_flite
35+
Flite.Traversals, Flite.Writer, Flite.WriterState, Flite.Parsec.Parse,
36+
Flite.Parsec.Flite, Flite.Parsec.Prelude, Flite.Dependency, Flite.IntInfer,
37+
Flite.Strictness, Flite.WorkerWrapper, Paths_flite

flite/stack.yaml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# This file was automatically generated by 'stack init'
2+
#
3+
# Some commonly used options have been documented as comments in this file.
4+
# For advanced use and comprehensive documentation of the format, please see:
5+
# https://docs.haskellstack.org/en/stable/yaml_configuration/
6+
7+
# A 'specific' Stackage snapshot or a compiler version.
8+
# A snapshot resolver dictates the compiler version and the set of packages
9+
# to be used for project dependencies. For example:
10+
#
11+
# snapshot: lts-22.28
12+
# snapshot: nightly-2024-07-05
13+
# snapshot: ghc-9.6.6
14+
#
15+
# The location of a snapshot can be provided as a file or url. Stack assumes
16+
# a snapshot provided as a file might change, whereas a url resource does not.
17+
#
18+
# snapshot: ./custom-snapshot.yaml
19+
# snapshot: https://example.com/snapshots/2024-01-01.yaml
20+
snapshot:
21+
url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/lts/22/43.yaml
22+
23+
# User packages to be built.
24+
# Various formats can be used as shown in the example below.
25+
#
26+
# packages:
27+
# - some-directory
28+
# - https://example.com/foo/bar/baz-0.0.2.tar.gz
29+
# subdirs:
30+
# - auto-update
31+
# - wai
32+
packages:
33+
- .
34+
# Dependency packages to be pulled from upstream that are not in the snapshot.
35+
# These entries can reference officially published versions as well as
36+
# forks / in-progress versions pinned to a git hash. For example:
37+
#
38+
# extra-deps:
39+
# - acme-missiles-0.3
40+
# - git: https://github.com/commercialhaskell/stack.git
41+
# commit: e7b331f14bcffb8367cd58fbfc8b40ec7642100a
42+
#
43+
# extra-deps: []
44+
45+
# Override default flag values for project packages and extra-deps
46+
# flags: {}
47+
48+
# Extra package databases containing global packages
49+
# extra-package-dbs: []
50+
51+
# Control whether we use the GHC we find on the path
52+
# system-ghc: true
53+
#
54+
# Require a specific version of Stack, using version ranges
55+
# require-stack-version: -any # Default
56+
# require-stack-version: ">=3.1"
57+
#
58+
# Override the architecture used by Stack, especially useful on Windows
59+
# arch: i386
60+
# arch: x86_64
61+
#
62+
# Extra directories used by Stack for building
63+
# extra-include-dirs: [/path/to/dir]
64+
# extra-lib-dirs: [/path/to/dir]
65+
#
66+
# Allow a newer minor version of GHC than the snapshot specifies
67+
# compiler-check: newer-minor

programs/Makefile

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ WORKLOADS=And SmallFib Example Fib Parts CountDown KnuthBendix Adjoxo \
1010
BENCHLOADS=Cichelli Braun OrdList Queens2 MSS Queens PermSort SumPuz Mate2 Mate
1111

1212
EMU=../emulator/emu
13-
# XXX this is broken now as cabal has change; FIXME
14-
FLITE=../flite/dist/build/flite/flite
13+
FLITE=../flite/dist/flite
1514
FLITE_RED=-r6:4:2:1:8 -i1 -s
1615
# Surprisingly there isn't a clear winner among h[0-3] i[0-3] s[0-1],
1716
# but this came out ahead
@@ -37,7 +36,7 @@ bench: bench-flite-c-comp
3736
$(EMU): ../emulator/emu.c
3837
$(MAKE) -C ../emulator emu
3938

40-
$(FLITE): flite.built
39+
$(FLITE):
4140
$(MAKE) -C ../flite
4241
touch flite.built
4342

0 commit comments

Comments
 (0)