Fix error when reading solo5 manifest
Also simplify solo5 manifest code.
This commit is contained in:
parent
5f7e37fb4c
commit
9cf112a9ac
3 changed files with 4 additions and 10 deletions
|
@ -256,10 +256,7 @@ let add_routes datadir configdir =
|
||||||
|> if_error "Error getting job build"
|
|> if_error "Error getting job build"
|
||||||
~log:(fun e -> Log.warn (fun m -> m "Error getting job build: %a" pp_error e))
|
~log:(fun e -> Log.warn (fun m -> m "Error getting job build: %a" pp_error e))
|
||||||
>>= fun (build, main_binary, artifacts, same_input_same_output, different_input_same_output, same_input_different_output, latest, next, previous) ->
|
>>= fun (build, main_binary, artifacts, same_input_same_output, different_input_same_output, same_input_different_output, latest, next, previous) ->
|
||||||
(match main_binary with
|
let solo5_manifest = Option.bind main_binary (Model.solo5_manifest datadir) in
|
||||||
| Some main_binary -> Model.solo5_manifest datadir main_binary
|
|
||||||
| None -> Lwt_result.return None)
|
|
||||||
|> if_error "Error getting solo5 manifest" >>= fun solo5_manifest ->
|
|
||||||
Views.Job_build.make
|
Views.Job_build.make
|
||||||
~name:job_name
|
~name:job_name
|
||||||
~build
|
~build
|
||||||
|
|
|
@ -51,10 +51,8 @@ let build_artifacts build (module Db : CONN) =
|
||||||
List.map snd
|
List.map snd
|
||||||
|
|
||||||
let solo5_manifest datadir file =
|
let solo5_manifest datadir file =
|
||||||
try
|
|
||||||
let buf = Owee_buf.map_binary Fpath.(to_string (datadir // file.Builder_db.localpath)) in
|
let buf = Owee_buf.map_binary Fpath.(to_string (datadir // file.Builder_db.localpath)) in
|
||||||
Lwt.return (Solo5_elftool.query_manifest buf |> Result.map Option.some)
|
Solo5_elftool.query_manifest buf |> Result.to_option
|
||||||
with Owee_buf.Invalid_format _ -> Lwt_result.return None
|
|
||||||
|
|
||||||
let platforms_of_job id (module Db : CONN) =
|
let platforms_of_job id (module Db : CONN) =
|
||||||
Db.collect_list Builder_db.Build.get_platforms_for_job id
|
Db.collect_list Builder_db.Build.get_platforms_for_job id
|
||||||
|
|
|
@ -21,8 +21,7 @@ val build_artifact_data : Fpath.t -> Builder_db.file ->
|
||||||
val build_artifacts : [`build] Builder_db.id -> Caqti_lwt.connection ->
|
val build_artifacts : [`build] Builder_db.id -> Caqti_lwt.connection ->
|
||||||
(Builder_db.file list, [> Caqti_error.call_or_retrieve ]) result Lwt.t
|
(Builder_db.file list, [> Caqti_error.call_or_retrieve ]) result Lwt.t
|
||||||
|
|
||||||
val solo5_manifest : Fpath.t -> Builder_db.file ->
|
val solo5_manifest : Fpath.t -> Builder_db.file -> Solo5_elftool.mft option
|
||||||
(Solo5_elftool.mft option, [> `Msg of string ]) result Lwt.t
|
|
||||||
|
|
||||||
val platforms_of_job : [`job] Builder_db.id -> Caqti_lwt.connection ->
|
val platforms_of_job : [`job] Builder_db.id -> Caqti_lwt.connection ->
|
||||||
(string list, [> Caqti_error.call_or_retrieve ]) result Lwt.t
|
(string list, [> Caqti_error.call_or_retrieve ]) result Lwt.t
|
||||||
|
|
Loading…
Reference in a new issue