Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build for OCaml 5 #10

Closed
wants to merge 2 commits into from
Closed

Fix build for OCaml 5 #10

wants to merge 2 commits into from

Conversation

samoht
Copy link
Contributor

@samoht samoht commented Apr 28, 2022

No description provided.

lru.opam Outdated Show resolved Hide resolved
@bikallem
Copy link

bikallem commented Oct 7, 2022

Any chance of this PR getting merged? I am getting ocaml-ci issues since lru is not compatible with OCaml 5.0 yet. mirage/ocaml-dns#312

Co-authored-by: David Allsopp <[email protected]>
@patricoferris
Copy link

Bumped into this issue recently with Irmin. Trying to install irmin-graphql.3.4.2 on a 5.0.0 switch can't be done:

[ERROR] Package conflict!
  * No agreement on the version of ocaml:
    - (invariant) → ocaml-base-compiler >= 5.0.0~beta1 → ocaml = 5.0.0
    - git-unix >= 3.9.1 → tcpip >= 7.0.0 → lru >= 0.3.0 → ocaml < 5.0
    You can temporarily relax the switch invariant with `--update-invariant'

No solution found, exiting

@pqwy
Copy link
Owner

pqwy commented Oct 25, 2022

There's no way to make this compatible with pre-5.0, right?

@edwintorok
Copy link

Why is this using MakeSeeded and then providing a seeded hash function that is not seeded?
Wouldn't it be better for Make to use Hashtbl.Make and MakeSeeded to use Hashtbl.MakeSeeded and that might even work with both versions?

@edwintorok
Copy link

edwintorok commented Oct 25, 2022

I haven't tried, but in principle would this work?

 module FakeSeededHash (H: Hashtbl.HashedType) = struct
    include H 
    let seeded_hash _ x = hash x
    let hash _ x = hash x
  end
  module Make (K: Hashtbl.HashedType) (V: Weighted) =
    Bake (Hashtbl.MakeSeeded (FakeSeededHash (K))) (V)
  module MakeSeeded (K : Hashtbl.SeededHashedType) (V: Weighted) =
    Bake (Hashtbl.MakeSeeded (K)) (V)

Then 4.x can pick hash _ x from SeededHash module, and 5.x can pick seeded_hash _ x and neither would mind having an extra value defined (worst case you get some dead code warning?) that the other version needs.

@pqwy
Copy link
Owner

pqwy commented Oct 25, 2022

@edwintorok Right, of course! :)

@pqwy pqwy closed this in 524528c Oct 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants