Skip to content

Fix libirmin build#2380

Merged
zshipko merged 1 commit intomirage:eiofrom
cuihtlauac:remove-libirmin-warnings
Dec 9, 2025
Merged

Fix libirmin build#2380
zshipko merged 1 commit intomirage:eiofrom
cuihtlauac:remove-libirmin-warnings

Conversation

@cuihtlauac
Copy link

@cuihtlauac cuihtlauac commented Dec 9, 2025

Fix dune executable stanza to remove gcc warnings. Thanks @Julow

@cuihtlauac
Copy link
Author

@zshipko, can you expedite this one?

Copy link
Contributor

@zshipko zshipko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what the CI failures are, but I tested this locally. It builds correctly and the libirmin tests pass.

This also seems to work on macos so I think will make another PR to re-enable libirmin for macos.

@cuihtlauac
Copy link
Author

I have other problems with libirmin. Its tests are failing when executed in docker. Very strange

@zshipko
Copy link
Contributor

zshipko commented Dec 9, 2025

@cuihtlauac is there an easy way for me to reproduce this issue?

I was able to reproduce this, looking into it.

@zshipko
Copy link
Contributor

zshipko commented Dec 9, 2025

Maybe it makes sense to merge this #2318 before starting to debug the libirmin test failures?

@zshipko zshipko merged commit 3597f60 into mirage:eio Dec 9, 2025
2 of 3 checks passed
@zshipko
Copy link
Contributor

zshipko commented Dec 9, 2025

i think this commit 9ed1e76 fixes the test failures you're running into in docker. it looks like -Wl,-znow does need to be passed as a -ccopt, so i added a script to compute the flags.

maybe try out #2318 and if it works for you I will merge it, since it is passing CI.

@cuihtlauac
Copy link
Author

cuihtlauac commented Dec 10, 2025

Did 9ed1e76 fixed it on your side? It did not for me. I cherry picked it on top of #2381 and #2318

Correction, it seems to be ok. I suggest we merge #2318

@cuihtlauac
Copy link
Author

However, now, when doing docker run --rm -it spice docker build @runtest I have this and don't understand we it comes from

File "examples/merkle_proofs.md", line 1, characters 0-0:
diff --git a/_build/default/examples/merkle_proofs.md b/_build/default/examples/.mdx/merkle_proofs.md.corrected
index 6149722..082f886 100644
--- a/_build/default/examples/merkle_proofs.md
+++ b/_build/default/examples/.mdx/merkle_proofs.md.corrected
@@ -14,8 +14,11 @@ More specifically, for Irmin, a Merkle proof is the subset of a tree stored in a
 # #require "mirage-ptime.unix";;
 # #require "mirage-sleep.unix";;
 # #require "irmin";;
+No such package: irmin
 # #require "irmin-git.unix";;
+No such package: irmin-git.unix
 # #require "ppx_irmin";;
+No such package: ppx_irmin

First, create an irmin-unix store module which uses int as contents.
@@ -33,14 +36,18 @@ let eio_run fn =
Eio_main.run @@ fun env ->
Lwt_eio.with_event_loop ~clock:env#clock fn

+```mdx-error
+Line 4, characters 41-45:
+Error: This is an alias for module Repr, which is missing
+```

Open a repo.

```ocaml
# let config = Irmin_git.config ~bare:true "./tmp-irmin/test"
  let repo = eio_run @@ fun _ -> Store.Repo.v config;;
-val config : Irmin.config = <abstr>
-val repo : Store.repo = <abstr>
+Line 2, characters 14-21:
+Error: Unbound value eio_run

Create a tree which contains the accounts and their balance for 3 customers: Ben, Bob and Eve.
@@ -55,7 +62,8 @@ Instead of using [ "eve" ] as a path (which whould have been valid too), this
let tree = Store.Tree.add tree [ "e"; "v"; "e" ] 30 in
tree
;;
-val tree : Store.tree =
+Line 1, characters 12-19:
+Error: Unbound value eio_run


In order to produce a Merkle proof, Irmin requires that the tree on which the proof will be based is persisted inside a `repo`. The following code block does so.
@@ -74,7 +82,8 @@ In order to produce a Merkle proof, Irmin requires that the tree on which the pr
    | `Node key -> key
    | `Contents _ -> assert false
  ;;
-val tree_key : Store.node_key = <abstr>
+Line 1, characters 16-23:
+Error: Unbound value eio_run

The bank is ready. repo contains the data, which was persisted on disk. tree_key acts as a pointer to the root of the accounts tree.
@@ -98,10 +107,15 @@ let proof, `Success = eio_run @@ fun _ ->

let pp_merkle_proof = Irmin.Type.pp Store.Tree.Proof.tree_t

+```mdx-error
+Line 3, characters 28-43:
+Error: Unbound module Store
+```

```ocaml
# let () = Fmt.pr "proof: %a\n" pp_merkle_proof (Store.Tree.Proof.state proof);;
-proof: {"Node":[["b",{"Blinded_node":"584ba234368730ce6cea56d93433a7a777cad2a0"}],["e",{"Node":[["v",{"Node":[["e",{"Contents":[30,"normal"]}]]}]]}]]}
+Line 1, characters 31-46:
+Error: Unbound value pp_merkle_proof

The proof of Eve's balance is a Merkle proof. It is a path in the tree of all the accounts in the bank, it doesn't leaks Bob and Ben's balance, it only reveals the hash and the name of their subtree (i.e. ["b",{"Blinded_node":"584ba234368730ce6cea56d93433a7a777cad2a0"}]).
@@ -113,6 +127,10 @@ The reason why this statement is tamper proof is because it hashes the same way

let pp_hash = Irmin.Type.pp Store.hash_t

+mdx-error +Line 1, characters 15-28: +Error: The module Irmin.Type is an alias for module Repr, which is missing +

# let () =
@@ -127,8 +145,8 @@ let pp_hash = Irmin.Type.pp Store.hash_t
    in
    Fmt.pr "proof hash: %a\n" pp_hash proof_hash
  ;;
- bank hash: 8e2d5291a09b98725e8525807d189eb7d9eb66d5
-proof hash: 8e2d5291a09b98725e8525807d189eb7d9eb66d5
+Line 2, characters 21-36:
+Error: Unbound module Store

produce_proof in details

@@ -137,10 +155,8 @@ Here is the signature of produce_proof:

# let produce_proof = Store.Tree.produce_proof;;
-val produce_proof :
-  Store.repo ->
-  Store.Tree.kinded_key ->
-  (Store.tree -> Store.tree * 'a) -> Store.Tree.Proof.t * 'a = <fun>
+Line 1, characters 21-45:
+Error: Unbound module Store

produce_proof repo key_before f is (proof = { state; hash_before; hash_after }, f_res). f is invoked once per call to produce_proof and f tree_before is (tree_after, f_res).

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.

2 participants