Upgrade to solo5-elftool 0.4.0 #17
2 changed files with 18 additions and 13 deletions
|
@ -46,8 +46,8 @@ depends: [
|
|||
"cmarkit" {>= "0.3.0"}
|
||||
"tar" {>= "3.0.0"}
|
||||
"tar-unix" {>= "3.0.0"}
|
||||
"owee"
|
||||
"solo5-elftool" {>= "0.3.0" & < "0.4.0"}
|
||||
"cachet"
|
||||
"solo5-elftool" {>= "0.4.0"}
|
||||
"decompress" {>= "1.5.0"}
|
||||
"digestif" {>= "1.2.0"}
|
||||
"uuidm" {>= "0.9.9"}
|
||||
|
|
27
lib/model.ml
27
lib/model.ml
|
@ -59,17 +59,22 @@ let build_artifacts build (module Db : CONN) =
|
|||
List.map snd
|
||||
|
||||
let solo5_manifest datadir file =
|
||||
(* 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 cachet =
|
||||
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.char
|
||||
Bigarray.c_layout false [|len|]) in
|
||||
Unix.close fd;
|
||||
let map () ~pos len =
|
||||
let len = min len (max 0 (Bigarray.Array1.dim buf - pos)) in
|
||||
Bigarray.Array1.sub buf pos len
|
||||
in
|
||||
Cachet.make ~pagesize:8 ~map ()
|
||||
in
|
||||
Solo5_elftool.query_manifest cachet |> Result.to_option
|
||||
|
||||
let platforms_of_job id (module Db : CONN) =
|
||||
Db.collect_list Builder_db.Build.get_platforms_for_job id
|
||||
|
|
Loading…
Reference in a new issue