@@ -149,32 +149,94 @@ project. The most important thing to note is that we pin the ``index-state`` of
149
149
the Hackage package index in ``cabal.project ``. This means that cabal will
150
150
always see Hackage “as if” it was that time, ensuring reproducibility. But it
151
151
also means that if you need a package version that was released *after * that
152
- time, you need to bump the ``index-state `` (and to run ``cabal update ``
153
- locally).
152
+ time, you need to bump the ``index-state ``.
153
+
154
+ Run ``cabal update `` locally::
155
+
156
+ cabal update
157
+
158
+ Downloading the latest package lists from:
159
+ - hackage.haskell.org
160
+ - cardano-haskell-packages
161
+ ...
162
+ Package list of hackage.haskell.org has been updated.
163
+ The index-state is set to 2024-06-26T15:03:35Z.
164
+
165
+ Copy the value of the index-state int ``cabal.project ``::
166
+
167
+ index-state:
168
+ , hackage.haskell.org 2024-06-26T15:03:35Z
154
169
155
170
Because of how we use Nix to manage our Haskell build, whenever you do this you
156
171
will also need to pull in the Nix equivalent of the newer ``index-state ``. You
157
- can do this by running ``nix flake lock --update-input hackageNix ``.
172
+ can do this by running::
173
+
174
+ nix flake lock --update-input hackageNix
175
+
176
+ If this fails to build, it may also be necessary to update haskell.nix::
177
+
178
+ nix flake lock --update-input haskellNix
158
179
159
180
From the Cardano Haskell Package repository
160
181
-------------------------------------------
161
182
162
- Many Cardano packages are not on Hackage and are instead in the `Cardano Haskell
163
- Package repository <cardano-haskell-packages_> `_ (CHaP), see the README for
164
- (lots) more information. Getting new packages from there works much like
165
- getting them from Hackage. The differences are that it has an independent
166
- ``index-state ``, and that there is a different Nix command you need to run
167
- afterwards: ``nix flake lock --update-input CHaP ``.
183
+ Many Cardano packages are not on Hackage and are instead in the `Cardano Haskell Package
184
+ repository <cardano-haskell-packages_> `_ (CHaP), see the README for (lots) more
185
+ information. Getting new packages from there works much like getting them from
186
+ Hackage. The differences are that it has an independent ``index-state ``, and that there is
187
+ a different Nix command you need to run afterwards.
188
+
189
+ Run ``cabal update `` locally::
190
+
191
+ cabal update
192
+
193
+ Downloading the latest package lists from:
194
+ - hackage.haskell.org
195
+ - cardano-haskell-packages
196
+ Package list of cardano-haskell-packages has been updated.
197
+ The index-state is set to 2024-06-24T07:23:35Z.
198
+ ...
199
+
200
+ Copy the value of the index-state int ``cabal.project ``::
201
+
202
+ index-state:
203
+ , hackage.haskell.org 2024-06-26T15:03:35Z
204
+ , cardano-haskell-packages 2024-06-24T07:23:35Z
205
+
206
+ Update the Nix equivalent of the newer ``index-state ``::
207
+
208
+ nix flake lock --update-input CHaP
209
+
210
+ If there are updated configuration files, be sure to also update ``iohk-nix ``::
211
+
212
+ nix flake lock --update-input nix flake lock --update-input hackageNix
213
+
214
+ In rare cases, it may also be necessary to update haskell.nix::
215
+
216
+ nix flake lock --update-input haskellNix
168
217
169
218
Using unreleased versions of dependencies
170
219
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
171
220
172
221
Sometimes we need to use an unreleased version of one of our dependencies,
173
222
either to fix an issue in a package that is not under our control, or to
174
223
experiment with a pre-release version of one of our own packages. You can use a
175
- ``source-repository-package `` stanza to pull in the unreleased version. Try
176
- only to do this for a short time, as it does not play very well with tooling,
177
- and will interfere with the ability to release cardano-db-sync itself.
224
+ ``source-repository-package `` stanza to pull in the unreleased version::
225
+
226
+ source-repository-package
227
+ type: git
228
+ location: https://github.com/IntersectMBO/cardano-node
229
+ tag: 4a18841e7df0d10edab98a612c80217ea49a5c11
230
+ --sha256: sha256-T5kZqlzTnaain3rypUwhpmY3YcZoDtbSqEQADeucJH4=
231
+ subdir:
232
+ cardano-node
233
+ cardano-submit-api
234
+ trace-dispatcher
235
+ trace-forward
236
+ trace-resources
237
+
238
+ Try only to do this for a short time, as it does not play very well with tooling, and will
239
+ interfere with the ability to release cardano-db-sync itself.
178
240
179
241
For packages that we do not control, we can end up in a situation where we have
180
242
a fork that looks like it will be long-lived or permanent (e.g. the maintainer
0 commit comments