You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The command-line flags for `stack` should then be specified _everywhere_ an
69
-
execution of `stack` is required. For `make` invocations in this project, set
70
-
the environment variable `STACK_BUILD_OPTS=--compiler ghc-8.10.7 --system-ghc`.
71
-
72
-
When `stack` and `ghc` merge their full support for ARM64 Darwin in future
73
-
releases, it should be possible to remove this workaround.
74
-
75
54
## Developing
76
55
77
56
Developers will require all the dependencies listed above,
@@ -82,7 +61,8 @@ in addition to the requirements and recommendations below.
82
61
For integration testing, we require:
83
62
84
63
- GNU [make]
85
-
- The [K Framework] frontend.
64
+
- The [K Framework] frontend (its version should be the one stated in [/deps/k_release](https://github.com/runtimeverification/haskell-backend/blob/master/deps/k_release))
65
+
- Python 3.x with the [`jsonrpcclient`](https://github.com/explodinglabs/jsonrpcclient) library installed
86
66
87
67
You can install/have access to K by either:
88
68
* using [kup]
@@ -109,15 +89,10 @@ For setting up a development environment, we recommend:
109
89
-[direnv] to make the project's tools available in shells and editors.
110
90
-[ghcup] or [Nix] for managing required Haskell tooling
111
91
-[hlint] for compliance with project guidelines.
112
-
-[entr] and [fd] for running `./entr.sh` to keep important files up-to-date.
113
-
114
-
We recommend to keep `./entr.sh` running in the background
115
-
to keep important files (such as package descriptions) up-to-date,
116
-
especially if the developer is using Cabal.
117
92
118
93
### Running Haskell Language Server
119
94
120
-
[ghcup] provides a straight-forward way of installing the language server,
95
+
[ghcup] provides a straightforward way of installing the language server,
121
96
if you prefer to use [Nix] please refer to the relevant resources on how to
122
97
set up your [Nix] environment to build the server.
123
98
**Note**: HLS has to be built with the project's GHC version.
@@ -134,7 +109,7 @@ Instructions on integrating with VSCode:
134
109
135
110
To build and run nix based packages at RV, please follow these instructions to set up nix:
136
111
137
-
_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._
112
+
_We are 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._
138
113
139
114
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)
140
115
and then enable flakes by editing either `~/.config/nix/nix.conf` or `/etc/nix/nix.conf` and adding:
@@ -203,62 +178,45 @@ nix run .#format Foo.hs
203
178
We provide a development nix shell with a suitable development environment and
204
179
a binary cache at [runtimeverification.cachix.org]. The development can be launched via `nix develop` and then calling `stack build/test/etc`.
205
180
206
-
When the `kore.cabal` package description file changes, run:
207
-
208
-
209
-
```
210
-
# Requires Nix with flakes enabled.
211
-
nix run .#update-cabal
212
-
```
213
-
214
-
or
215
-
216
-
```
217
-
# Requires Nix to be installed.
218
-
./nix/rematerialize.sh
219
-
```
181
+
### Upgrading dependencies
220
182
221
-
This script is also run by an automatic workflow.
183
+
When one of the package description files (`kore.cabal`, `kore-rpc-types.cabal`) changes, or when upgrading to a newer `stack` resolver, the dependencies need to be consolidated to avoid accidental breakage from incompatible up-stream updates. We use a `cabal.project.freeze` file to pin the dependencies to what the current `stack` resolver is using.
222
184
223
-
### New GHC 9.2.5 dev shell
185
+
The script [`scripts/freeze-cabal-to-stack-resolver.sh`](https://github.com/runtimeverification/haskell-backend/tree/master/scripts/freeze-cabal-to-stack-resolver.sh) should do most of that work (the existing `freeze` file must be removed before running it), and [`scripts/check-cabal-stack-sync.sh`](https://github.com/runtimeverification/haskell-backend/tree/master/scripts/check-cabal-stack-sync.sh) checks the result. Some manual adjustments will still be necessary for the `nix` builds in CI and locally to work.
224
186
225
-
In order to make use of the new profiling options in GHC 9.2, we've added a nix dev shell which builds kore with GHC 9.2.5. To open the shell, run
187
+
In addition, any GHC or resolver upgrades must double-check the `compiler-nix-name` and `index-state` values in the [`flake.nix`](https://github.com/runtimeverification/haskell-backend/blob/master/flake.nix#L41-L42) file.
226
188
227
-
```
228
-
nix develop .#ghc9
229
-
```
230
-
231
-
Then, use stack to build:
232
-
233
-
```
234
-
stack build
235
-
```
236
-
237
-
If you modified the `kore.cabal` file and want to build with GHC 9, you will have to run
189
+
### Integration tests
238
190
239
-
```
240
-
# Requires Nix with flakes enabled.
241
-
nix run .#update-cabal-ghc9
242
-
```
191
+
Haskell-backend provides an integration shell for running integration tests, which compile the K framework (of a specified version) against your current version of haskell backend and brings K into scope of your current shell.
243
192
244
-
### Integration tests
193
+
The integration shell is part of the `k` repository, but invoked from the local tree, adding additional tools (see [`nix/integration-shell.nix`](https://github.com/runtimeverification/haskell-backend/blob/master/nix/integration-shell.nix) and [`../k/flake.nix`](https://github.com/runtimeverification/k/blob/master/flake.nix#L180)). Its `haskell-backend` dependency must be overridden to use the `haskell-backend` dependency from the current checked-out tree, and the `k` version will usually be the one from `deps/k_release`.
245
194
246
-
We provide a `test.nix` for running integration tests:
195
+
To use this nix shell, execute
247
196
248
197
```sh
249
-
nix-build test.nix # run all integration tests
250
-
nix-build test.nix --argstr test imp # run the integration tests in test/imp
251
-
nix-shell test.nix # enter a shell where we can run tests manually
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
206
+
(This will take some time the first time you run it for a specific K framework version...)
207
+
A specific commit or version tag of the K framework github repository can be used instead of `$(cat deps/k_release)`.
208
+
209
+
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 exit the active nix shell).
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).
0 commit comments