From 4d9f440aaeb1aa21a11b16a6852b43644840aa66 Mon Sep 17 00:00:00 2001 From: Pietro Date: Tue, 13 Feb 2018 12:12:01 +0100 Subject: [PATCH] Fix protocol injection - Rename Tezos_protocol_compiler_native__Registerer - Pass module without extension to the compiler --- src/lib_protocol_compiler/compiler.ml | 2 +- src/lib_protocol_updater/updater.ml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib_protocol_compiler/compiler.ml b/src/lib_protocol_compiler/compiler.ml index 352860f88..15736b0f8 100644 --- a/src/lib_protocol_compiler/compiler.ml +++ b/src/lib_protocol_compiler/compiler.ml @@ -226,7 +226,7 @@ let main { compile_ml ; pack_objects ; link_shared } = create_file register_file (Printf.sprintf "module Name = struct let name = %S end\n\ - \ let () = Tezos_protocol_compiler_native__Registerer.register Name.name (module %s.Make)" + \ let () = Tezos_protocol_registerer__Registerer.register Name.name (module %s.Make)" (Protocol_hash.to_b58check hash) functor_unit) ; let register_object = compile_ml ~for_pack register_file in diff --git a/src/lib_protocol_updater/updater.ml b/src/lib_protocol_updater/updater.ml index e63469262..894c949f3 100644 --- a/src/lib_protocol_updater/updater.ml +++ b/src/lib_protocol_updater/updater.ml @@ -58,7 +58,7 @@ module Raw = struct let source_dir = datadir // Protocol_hash.to_short_b58check hash // "src" in let log_file = datadir // Protocol_hash.to_short_b58check hash // "LOG" in let plugin_file = datadir // Protocol_hash.to_short_b58check hash // - Format.asprintf "protocol_%a.cmxs" Protocol_hash.pp hash + Format.asprintf "protocol_%a" Protocol_hash.pp hash in begin Lwt_utils_unix.Protocol.write_dir source_dir ~hash p >>=? fun () -> @@ -80,7 +80,7 @@ module Raw = struct log_error "COMPILATION ERROR (%s)" log_file; Lwt.return false | Ok (Unix.WEXITED _) -> - try Dynlink.loadfile_private plugin_file; Lwt.return true + try Dynlink.loadfile_private (plugin_file ^ ".cmxs"); Lwt.return true with Dynlink.Error err -> log_error "Can't load plugin: %s (%s)" (Dynlink.error_message err) plugin_file;