Skip to content

Commit 0c24dcd

Browse files
authored
Merge branch 'master' into full-correctness
2 parents 5cf64e1 + d8ba30a commit 0c24dcd

File tree

365 files changed

+70291
-667378
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

365 files changed

+70291
-667378
lines changed

.github/workflows/release.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,12 @@ jobs:
1313
with:
1414
submodules: recursive
1515

16-
- name: Install Nix
17-
uses: cachix/install-nix-action@v14.1
16+
- name: 'Install Nix'
17+
uses: cachix/install-nix-action@v15
1818
with:
1919
extra_nix_config: |
20-
substituters = http://cache.nixos.org https://hydra.iohk.io
20+
substituters = http://cache.nixos.org https://cache.iog.io
2121
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
22-
install_url: "https://releases.nixos.org/nix/nix-2.3.16/install"
2322
2423
- name: Install Cachix
2524
uses: cachix/cachix-action@v10
@@ -28,8 +27,19 @@ jobs:
2827
extraPullNames: 'kore'
2928
skipPush: true
3029

30+
- name: Materialize
31+
run: nix run .#update-cabal
32+
33+
- name: Materialize GHC 9
34+
run: nix run .#update-cabal-ghc9
35+
3136
- name: Check materialization
32-
run: nix-build --arg checkMaterialization true -A project.stack-nix
37+
run: |
38+
if [ -n "$(git status --porcelain 'nix/')" ]; then
39+
echo 2>&1 "Error: found modified files"
40+
git diff
41+
exit 1
42+
fi
3343
3444
release:
3545
name: 'Release'

.github/workflows/test.yml

Lines changed: 15 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,14 @@ jobs:
1616
ref: ${{ github.event.pull_request.head.sha }}
1717
submodules: recursive
1818

19-
- name: Install Nix
20-
uses: cachix/install-nix-action@v14.1
19+
- name: 'Install Nix'
20+
uses: cachix/install-nix-action@v15
2121
with:
2222
extra_nix_config: |
23-
substituters = http://cache.nixos.org https://hydra.iohk.io
23+
substituters = http://cache.nixos.org https://cache.iog.io
2424
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
25-
install_url: "https://releases.nixos.org/nix/nix-2.3.16/install"
2625
27-
- name: Install Cachix
26+
- name: 'Install Cachix'
2827
uses: cachix/cachix-action@v10
2928
with:
3029
name: runtimeverification
@@ -33,66 +32,12 @@ jobs:
3332
- name: Build
3433
run: nix-build -A kore
3534

36-
nix-shell:
37-
name: 'Nix / Shell'
38-
strategy:
39-
matrix:
40-
os: [ubuntu-latest, macos-latest]
41-
runs-on: ${{ matrix.os }}
42-
steps:
43-
- name: Check out code
44-
uses: actions/[email protected]
45-
with:
46-
# Check out pull request HEAD instead of merge commit.
47-
ref: ${{ github.event.pull_request.head.sha }}
48-
submodules: recursive
49-
50-
- name: Install Nix
51-
uses: cachix/[email protected]
52-
with:
53-
extra_nix_config: |
54-
substituters = http://cache.nixos.org https://hydra.iohk.io
55-
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
56-
install_url: "https://releases.nixos.org/nix/nix-2.3.16/install"
57-
58-
- name: Install Cachix
59-
uses: cachix/cachix-action@v10
60-
with:
61-
name: runtimeverification
62-
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
35+
- name: Build GHC9
36+
run: GC_DONT_GC=1 nix build .#kore-exec-prof
6337

6438
- name: Check shell
6539
run: nix-shell --run "echo OK"
6640

67-
nix-test:
68-
name: 'Nix / Test'
69-
needs: nix-build
70-
strategy:
71-
matrix:
72-
os: [ubuntu-latest, macos-latest]
73-
runs-on: ${{ matrix.os }}
74-
steps:
75-
- name: Check out code
76-
uses: actions/[email protected]
77-
with:
78-
# Check out pull request HEAD instead of merge commit.
79-
ref: ${{ github.event.pull_request.head.sha }}
80-
submodules: recursive
81-
82-
- name: Install Nix
83-
uses: cachix/[email protected]
84-
with:
85-
extra_nix_config: |
86-
substituters = http://cache.nixos.org https://hydra.iohk.io
87-
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
88-
install_url: "https://releases.nixos.org/nix/nix-2.3.16/install"
89-
90-
- name: Install Cachix
91-
uses: cachix/cachix-action@v10
92-
with:
93-
name: runtimeverification
94-
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
95-
9641
- name: Run unit tests
9742
run: nix-build -A project.kore.checks
9843

@@ -209,6 +154,8 @@ jobs:
209154
hlint:
210155
name: 'HLint'
211156
runs-on: ubuntu-latest
157+
env:
158+
hlint_version: "3.4.1"
212159
steps:
213160
- uses: actions/[email protected]
214161
with:
@@ -217,7 +164,7 @@ jobs:
217164
submodules: recursive
218165

219166
- name: Run hlint
220-
run: curl -sSL https://raw.github.com/ndmitchell/hlint/master/misc/run.sh | sh -s kore -j
167+
run: curl -sSL https://raw.github.com/ndmitchell/hlint/v${{ env.hlint_version }}/misc/run.sh | sh -s kore -j
221168

222169
performance:
223170
needs: [nix-build]
@@ -264,4 +211,9 @@ jobs:
264211
./scripts/join-statistics.sh master.json pull-request.json \
265212
| ./scripts/format-statistics.sh \
266213
> comment.md
267-
gh pr comment ${{ github.event.pull_request.number }} -F comment.md
214+
if [[ $(sed -E -e '1,2d ; /.*\| (0|-?0.00[0-9]*) \| (0|-?0.00[0-9]*) \|$/d' comment.md | wc -l) -ne 0 ]]; then\
215+
gh pr comment ${{ github.event.pull_request.number }} -F comment.md; \
216+
else \
217+
echo "Produced statistics are boring, just printing them right here:"; \
218+
cat comment.md; \
219+
fi

.github/workflows/update.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,26 @@ jobs:
2727
ref: ${{ steps.config.outputs.ref }}
2828
submodules: recursive
2929

30-
- name: Install Nix
31-
uses: cachix/install-nix-action@v14.1
30+
- name: 'Install Nix'
31+
uses: cachix/install-nix-action@v15
3232
with:
3333
extra_nix_config: |
34-
substituters = http://cache.nixos.org https://hydra.iohk.io
34+
substituters = http://cache.nixos.org https://cache.iog.io
3535
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
36-
install_url: "https://releases.nixos.org/nix/nix-2.3.16/install"
3736
38-
- name: Install Cachix
37+
- name: 'Install Cachix'
3938
uses: cachix/cachix-action@v10
4039
with:
4140
name: runtimeverification
41+
extraPullNames: kore
4242
signingKey: '${{ secrets.CACHIX_SIGNING_KEY }}'
4343

44+
4445
- name: Materialize
45-
run: ./nix/rematerialize.sh
46+
run: nix run .#update-cabal
47+
48+
- name: Materialize GHC 9
49+
run: nix run .#update-cabal-ghc9
4650

4751
- name: Update branch
4852
env:

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,4 @@ cabal.project.local
4949
kore-exec.tar.gz
5050
hie.yaml
5151
.hie/
52+
.direnv

.hlint.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@
157157
within:
158158
- GlobalMain
159159
- Kore.Log.InfoExecDepth
160+
- Kore.Log.WarnUnexploredBranches
160161

161162
- ignore: {name: "Redundant compare", within: [Kore.Syntax.Id]}
162163

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
ARG K_COMMIT
2-
FROM runtimeverificationinc/kframework-k:ubuntu-bionic-${K_COMMIT}
2+
FROM runtimeverificationinc/kframework-k:ubuntu-focal-${K_COMMIT}
33

44
ENV TZ=America/Chicago
55
RUN ln --symbolic --no-dereference --force /usr/share/zoneinfo/$TZ /etc/localtime \
@@ -50,4 +50,4 @@ RUN mkdir -p ~/.ssh \
5050
&& echo ' user git' >> ~/.ssh/config \
5151
&& echo ' identityagent SSH_AUTH_SOCK' >> ~/.ssh/config \
5252
&& echo ' stricthostkeychecking accept-new' >> ~/.ssh/config \
53-
&& chmod go-rwx -R ~/.ssh
53+
&& chmod go-rwx -R ~/.ssh

Makefile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,13 @@ haddock:
3131
--fast \
3232
>haddock.log 2>&1 \
3333
|| ( cat haddock.log; exit 1; )
34-
cat haddock.log
35-
if grep -B 2 'Module header' haddock.log; then \
34+
#remove header warning for Paths_kore
35+
sed -e "/.*in 'Paths_kore'$/{n;n;/^ *Module header$/d}" haddock.log | tee haddock.log.noPaths
36+
if grep -B 2 'Module header' haddock.log.noPaths; then \
3637
echo >&2 "Please fix the missing documentation!"; \
3738
exit 1; \
3839
else \
39-
rm haddock.log; \
40+
rm haddock.log*; \
4041
fi
4142

4243
haskell_documentation: haddock
@@ -74,4 +75,4 @@ clean:
7475
$(MAKE) -C test clean
7576

7677
clean-execution:
77-
$(MAKE) -C test clean-execution
78+
$(MAKE) -C test clean-execution

README.md

Lines changed: 94 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ cabal build kore
4343
```
4444

4545
If using `cabal`, version 3.0 or later is recommended.
46+
You may pass `--fast` to `stack build` or `-O0` to `cabal build` in order to
47+
disable compiler optimizations and make build faster at the cost of slower runtime.
4648

4749
Using [make]:
4850

@@ -132,19 +134,101 @@ cabal build --enable-tests --enable-benchmarks --only-dependencies kore
132134

133135
### Developing with Nix
134136

137+
To build and run nix based packages at RV, please follow these instructions to set up nix:
138+
139+
_We are switching to using [nix flakes](https://nixos.wiki/wiki/Flakes) in all our repos. What this means at a high level is that some of the commands for building packages look a bit different._
140+
141+
To set up nix flakes you will need to install `nix` 2.4 or higher.If you are on a standard Linux distribution, such as Ubuntu, first [install nix](https://nixos.org/download.html#download-nix)
142+
and then enable flakes by editing either `~/.config/nix/nix.conf` or `/etc/nix/nix.conf` and adding:
143+
144+
```
145+
experimental-features = nix-command flakes
146+
```
147+
148+
This is needed to expose the Nix 2.0 CLI and flakes support that are hidden behind feature-flags. (If you are on a different system like nixOS, see instructions for enabling flakes here: https://nixos.wiki/wiki/Flakes)
149+
150+
By default, Nix will build any project and its transitive dependencies from source, which can take a very long time. We therefore need to set up some binary caches to speed up the build
151+
process. First, install cachix
152+
153+
```
154+
nix-env -iA cachix -f https://cachix.org/api/v1/install
155+
```
156+
157+
and then add the `kore` cachix cache
158+
159+
```
160+
cachix use kore
161+
```
162+
163+
Next, we need to set up the cache for our haskell infrastructure, by adding the following sections to `/etc/nix/nix.conf` or, if you are a trusted user, `~/.config/nix/nix.conf` (if you don't know what a "trusted user" is, you probably want to do the former):
164+
165+
```
166+
trusted-public-keys = ... hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
167+
substituters = ... https://cache.iog.io
168+
```
169+
170+
i.e. if the file was originally
171+
172+
```
173+
substituters = https://cache.nixos.org
174+
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
175+
```
176+
177+
it will now read
178+
179+
```
180+
substituters = https://cache.nixos.org https://cache.iog.io
181+
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=
182+
```
183+
184+
185+
### Nix dev shell
186+
135187
We provide a `shell.nix` expression with a suitable development environment and
136188
a binary cache at [runtimeverification.cachix.org]. The development environment is intended to
137189
be used with `nix-shell` and `cabal`.
138190

139191
When the `.cabal` package description file changes, run:
140192

141-
```.sh
193+
194+
```
195+
# Requires Nix with flakes enabled.
196+
nix run .#update-cabal
197+
```
198+
199+
or
200+
201+
```
142202
# Requires Nix to be installed.
143203
./nix/rematerialize.sh
144204
```
145205

146206
This script is also run by an automatic workflow.
147207

208+
### New GHC 9.2.3 dev shell
209+
210+
In order to make use of the new profiling options in GHC 9.2, we've added a nix shell which builds kore with GHC 9.2.3, to open the shell, run
211+
212+
```
213+
nix develop .#ghc9
214+
```
215+
216+
Then, use stack to build against `stack-nix-ghc9.yaml`:
217+
218+
```
219+
stack --stack-yaml stack-nix-ghc9.yaml build
220+
```
221+
222+
If you modified the `kore.cabal` file and want to build with GHC 9, you will have to run
223+
224+
```
225+
# Requires Nix with flakes enabled.
226+
nix run .#update-cabal-ghc9
227+
```
228+
229+
230+
### Integration tests
231+
148232
We provide a `test.nix` for running integration tests:
149233

150234
``` sh
@@ -153,6 +237,15 @@ nix-build test.nix --argstr test imp # run the integration tests in test/imp
153237
nix-shell test.nix # enter a shell where we can run tests manually
154238
```
155239

240+
You can also us a new nix flake shell feature to compile the K framework against your current version of haskell backend and bring K into scope of your current shell via
241+
242+
```
243+
nix shell github:runtimeverification/k/<commit> --override-input haskell-backend $(pwd)
244+
```
245+
246+
where `<commit>` can be empty or point to a specific version of the K framework github repository. Running this command will add all of the K binaries like `kompile` or `kast` into the `PATH` of your current shell (this is not permanent and will only persist in your current shell window until you close it).
247+
248+
156249
[docs]: https://github.com/runtimeverification/haskell-backend/tree/master/docs
157250
[git]: https://git-scm.com/
158251
[stack]: https://www.haskellstack.org/

0 commit comments

Comments
 (0)