diff --git a/db/builder_db.ml b/db/builder_db.ml index ae5702e..9ef714f 100644 --- a/db/builder_db.ml +++ b/db/builder_db.ml @@ -12,7 +12,7 @@ type file = Rep.file = { filepath : Fpath.t; localpath : Fpath.t; sha256 : Cstruct.t; - size : int64; + size : int; } let last_insert_rowid = diff --git a/db/builder_db.mli b/db/builder_db.mli index 73506d0..f70485a 100644 --- a/db/builder_db.mli +++ b/db/builder_db.mli @@ -4,7 +4,7 @@ type file = { filepath : Fpath.t; localpath : Fpath.t; sha256 : Cstruct.t; - size : int64; + size : int; } val application_id : int32 diff --git a/db/representation.ml b/db/representation.ml index 0f22beb..dc7378d 100644 --- a/db/representation.ml +++ b/db/representation.ml @@ -27,7 +27,7 @@ type file = { filepath : Fpath.t; localpath : Fpath.t; sha256 : Cstruct.t; - size : int64; + size : int; } let uuid = @@ -62,10 +62,10 @@ let file = Ok (filepath, localpath, sha256, size) in let decode (filepath, localpath, sha256, size) = Ok { filepath; localpath; sha256; size } in - Caqti_type.custom ~encode ~decode Caqti_type.(tup4 fpath fpath cstruct int64) + Caqti_type.custom ~encode ~decode Caqti_type.(tup4 fpath fpath cstruct int) let file_opt = - let rep = Caqti_type.(tup4 (option fpath) (option fpath) (option cstruct) (option int64)) in + let rep = Caqti_type.(tup4 (option fpath) (option fpath) (option cstruct) (option int)) in let encode = function | Some { filepath; localpath; sha256; size } -> Ok (Some filepath, Some localpath, Some sha256, Some size) diff --git a/lib/model.ml b/lib/model.ml index 0f080f0..77e2966 100644 --- a/lib/model.ml +++ b/lib/model.ml @@ -92,7 +92,7 @@ let save_exec build_dir exec = save Fpath.(build_dir / "full") (Cstruct.to_string cs) let save_file dir (filepath, data) = - let size = String.length data |> Int64.of_int in + let size = String.length data in let sha256 = Mirage_crypto.Hash.SHA256.digest (Cstruct.of_string data) in let localpath = Fpath.append dir filepath in Lwt_result.lift (Bos.OS.Dir.create (Fpath.parent localpath)) >>= fun _ -> diff --git a/lib/views.ml b/lib/views.ml index e18ec4b..3db5866 100644 --- a/lib/views.ml +++ b/lib/views.ml @@ -86,7 +86,7 @@ let artifact ?(basename=false) job_name build { Builder_db.filepath; localpath = [if basename then txt (Fpath.basename filepath) else txtf "%a" Fpath.pp filepath]; - txtf " (%a) " Fmt.byte_size (Int64.to_int size); + txtf " (%a) " Fmt.byte_size size; code [txtf "SHA256:%a" Hex.pp (Hex.of_cstruct sha256)]; ] @@ -184,7 +184,7 @@ let job_build [code [txtf "%a" Fpath.pp filepath]]]; dd [ code [txt "SHA256:"; txt sha256_hex]; - txtf " (%a)" Fmt.byte_size (Int64.to_int size); + txtf " (%a)" Fmt.byte_size size; ]; ]) artifacts);