diff --git a/src/dune b/src/dune index 22a59fed114d435147b1cee6130770c64207345e..30b7a156d889e7732ca1fbd3ae1788f6318b9315 100644 --- a/src/dune +++ b/src/dune @@ -37,7 +37,7 @@ (echo " - dune-site.plugins:" %{lib-available:dune-site.plugins} "\n") (echo " - ppx_import:" %{lib-available:ppx_import} "\n") (echo " - ppx_deriving.eq:" %{lib-available:ppx_deriving.eq} "\n") - (echo " - ppx_yojson_conv:" %{lib-available:ppx_yojson_conv} "\n") + (echo " - ppx_deriving_yojson:" %{lib-available:ppx_deriving_yojson} "\n") ) ) ) @@ -49,7 +49,7 @@ (flags :standard -w -9) (libraries frama-c.init str unix zarith ocamlgraph dynlink bytes yojson menhirLib dune-site dune-site.plugins) (instrumentation (backend landmarks)) - (preprocess (staged_pps ppx_import ppx_deriving.eq ppx_yojson_conv)) + (preprocess (staged_pps ppx_import ppx_deriving.eq ppx_deriving_yojson)) ) (generate_sites_module (module config_data) (sites frama-c) (plugins (frama-c plugins) (frama-c plugins_gui))) diff --git a/src/kernel_services/ast_queries/file.ml b/src/kernel_services/ast_queries/file.ml index 3d5b1476a12a595e7da14f441d4b4f6edc87fe9d..54a324407c6554d55cc8539849edb1d2cfd1b42a 100644 --- a/src/kernel_services/ast_queries/file.ml +++ b/src/kernel_services/ast_queries/file.ml @@ -368,8 +368,6 @@ let set_machdep () = let () = Cmdline.run_after_configuring_stage set_machdep -open Ppx_yojson_conv_lib.Yojson_conv.Primitives - type mach = [%import: Cil_types.mach] [@@deriving of_yojson] (* Local to this module. Use Cil.theMachine.theMachine outside *) @@ -382,11 +380,12 @@ let get_machdep () = if is_default_machdep m then default_machdep_file m else Filepath.Normalized.of_string ~existence:Must_exist m in - try + match mach_of_yojson (Yojson.Safe.from_file (file:>string)) with - Ppx_yojson_conv_lib.Yojson_conv.Of_yojson_error(exn,_) -> - Kernel.fatal "Error during machdep parsing: %s" (Printexc.to_string exn) + | Ok machdep -> machdep + | Error s -> + Kernel.fatal "Error during machdep parsing: %s" s let list_available_machdeps () = CustomMachdeps.fold (fun m _ acc -> m :: acc) (default_machdeps ())