Inline owee unix dependent code

Then we can publish in unikernel-repo the unix-free owee fork
This commit is contained in:
Reynir Björnsson 2025-01-24 15:23:37 +01:00
parent 49ca776d33
commit be2dfa9aad

View file

@ -59,7 +59,16 @@ let build_artifacts build (module Db : CONN) =
List.map snd List.map snd
let solo5_manifest datadir file = 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 Solo5_elftool.query_manifest buf |> Result.to_option
let platforms_of_job id (module Db : CONN) = let platforms_of_job id (module Db : CONN) =