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
* Avoid use of `parseIndexState`
The `parseIndexState` uses a very simple parser that breaks for `cabal.project` files with more complicated `index-state:` fields.
This will have some drawbacks:
* There will no longer be a warning in the trace output if an index state was not found.
* When `hackage.nix` is bumped the plan will be recomputed even if the `index-state:` in the `cabal.project` has not changed. We do not expect this to be a problem since recomputing the plan is normally relatively fast.
* Update change log
inbuiltins.trace("No index state specified"+(ifname==nullthen""else" for "+name)+", using the latest index state that we know about (${latest-index-state})!")latest-index-state;
thenthrow"Index state found was ${index-state-found} and no `index-sha256` was provided. "
175
-
"The index hash lookup code requires zulu time zone (ends in a Z)"elsetrue);
176
-
177
-
let
178
161
# If a hash was not specified find a suitable cached index state to
179
162
# use that will contain all the packages we need. By using the
180
163
# first one after the desired index-state we can avoid recalculating
181
164
# when new index-state-hashes are added.
182
165
# See https://github.com/input-output-hk/haskell.nix/issues/672
183
166
cached-index-state=ifindex-sha256!=null
184
-
thenindex-state-found
167
+
thenindex-state-max
185
168
else
186
169
let
187
170
suitable-index-states=
188
171
builtins.filter
189
-
(s: s>=index-state-found)# This compare is why we need zulu time
172
+
(s: s>=index-state-max)# This compare is why we need zulu time
190
173
(builtins.attrNamesindex-state-hashes);
191
174
in
192
175
ifbuiltins.lengthsuitable-index-states==0
193
-
thenindex-state-found
176
+
thenindex-state-max
194
177
elsepkgs.lib.headsuitable-index-states;
195
178
196
179
# Lookup hash for the index state we found
@@ -200,7 +183,7 @@ let
200
183
201
184
in
202
185
assert(ifindex-sha256-found==null
203
-
thenthrow"Unknown index-state ${index-state-found}, the latest index-state I know about is ${pkgs.lib.last(builtins.attrNamesindex-state-hashes)}. You may need to update to a newer hackage.nix."elsetrue);
186
+
thenthrow"Unknown index-state ${index-state-max}, the latest index-state I know about is ${pkgs.lib.last(builtins.attrNamesindex-state-hashes)}. You may need to update to a newer hackage.nix."elsetrue);
204
187
205
188
let
206
189
# Deal with source-repository-packages in a way that will work in
@@ -392,11 +375,6 @@ let
392
375
sha256=plan-sha256;
393
376
sha256Arg="plan-sha256";
394
377
this="project.plan-nix"+(ifname!=nullthen" for ${name}"else"");
395
-
# Before pinning stuff down we need an index state to use
396
-
reasonNotSafe=
397
-
if!index-state-pinned
398
-
then"index-state is not pinned by an argument or the cabal project file"
0 commit comments