Skip to content

Commit e41992e

Browse files
committed
Ensure opamfiles are counted in prep hash
1 parent dd25639 commit e41992e

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/lib/prep.ml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -483,10 +483,19 @@ module Prep = struct
483483
opamfiles : (bool * string) Current.or_error OpamPackage.Map.t;
484484
}
485485

486-
let digest { prep; base = _; tools_base = _; config = _; opamfiles = _ } =
486+
let digest { prep; base = _; tools_base = _; config = _; opamfiles } =
487487
(* base is derived from 'prep' so we don't need to include it in the hash *)
488-
Fmt.str "%s\n%s\n%s\n" prep_version (Package.digest prep)
489-
(Package.digest prep)
488+
let opamfiles_hash =
489+
let buf = Buffer.create 1024 in
490+
let () = OpamPackage.Map.iter (fun _ x ->
491+
match x with
492+
| Ok (_has_depext, opamfile) ->
493+
Buffer.add_string buf opamfile
494+
| _ -> ()) opamfiles in
495+
Hashtbl.hash (Buffer.contents buf)
496+
in
497+
Fmt.str "%s\n%s\n%s\n%d\n" prep_version (Package.digest prep)
498+
(Package.digest prep) opamfiles_hash
490499
end
491500

492501
let pp f Key.{ prep; _ } = Fmt.pf f "Voodoo prep %a" Package.pp prep

0 commit comments

Comments
 (0)