From be2dfa9aad9efb4d295c366def12732a50f574f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Reynir=20Bj=C3=B6rnsson?= Date: Fri, 24 Jan 2025 15:23:37 +0100 Subject: [PATCH] Inline owee unix dependent code Then we can publish in unikernel-repo the unix-free owee fork --- lib/model.ml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/model.ml b/lib/model.ml index 12a121e..3b3aa66 100644 --- a/lib/model.ml +++ b/lib/model.ml @@ -59,7 +59,16 @@ let build_artifacts build (module Db : CONN) = List.map snd let solo5_manifest datadir file = - let buf = Owee_buf.map_binary Fpath.(to_string (datadir // artifact_path file)) in + (* inlined from Owee_buf.map_binary *) + let path = Fpath.(to_string (datadir // artifact_path file)) in + let fd = Unix.openfile path [Unix.O_RDONLY] 0 in + let len = Unix.lseek fd 0 Unix.SEEK_END in + let buf = + Bigarray.array1_of_genarray + (Unix.map_file fd Bigarray.int8_unsigned + Bigarray.c_layout false [|len|]) in + Unix.close fd; + (* end of inlined code *) Solo5_elftool.query_manifest buf |> Result.to_option let platforms_of_job id (module Db : CONN) = -- 2.47.1