Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dune-project
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(lang dune 2.7)
(lang dune 3.3)
(name obuilder)
(formatting disabled)
(generate_opam_files true)
Expand Down
2 changes: 1 addition & 1 deletion lib/build.mli
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ module Context : sig
*)
end

module Make (Store : S.STORE) (Sandbox : S.SANDBOX) (Fetch : S.FETCHER) : sig
module Make (Store : S.STORE) (Sandbox : S.SANDBOX) (_ : S.FETCHER) : sig
include S.BUILDER with type context := Context.t

val v : store:Store.t -> sandbox:Sandbox.t -> t
Expand Down
5 changes: 2 additions & 3 deletions lib/db_store.ml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ let ( >>!= ) = Lwt_result.bind
module Make (Raw : S.STORE) = struct
type build = {
mutable users : int;
cancelled : unit Lwt.t;
set_cancelled : unit Lwt.u; (* Resolve this to cancel (when [users = 0]). *)
log : Build_log.t Lwt.t;
result : (([`Loaded | `Saved] * S.id), [`Cancelled | `Msg of string]) Lwt_result.t;
Expand All @@ -19,7 +18,7 @@ module Make (Raw : S.STORE) = struct
dao : Dao.t;
(* Invariants for builds in [in_progress]:
- [result] is still pending and [log] isn't finished.
- [cancelled] is resolved iff [users = 0]. *)
- [set_cancelled] is resolved iff [users = 0]. *)
mutable in_progress : build Builds.t;
}

Expand Down Expand Up @@ -101,7 +100,7 @@ module Make (Raw : S.STORE) = struct
let log, set_log = Lwt.wait () in
let tail_log = log >>= fun log -> Build_log.tail ?switch log (client_log `Output) in
let cancelled, set_cancelled = Lwt.wait () in
let build = { users = 1; cancelled; set_cancelled; log; result } in
let build = { users = 1; set_cancelled; log; result } in
Lwt_switch.add_hook_or_exec switch (fun () -> dec_ref build; Lwt.return_unit) >>= fun () ->
t.in_progress <- Builds.add id build t.in_progress;
Lwt.async
Expand Down
2 changes: 1 addition & 1 deletion obuilder-spec.opam
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ homepage: "https://github.com/ocurrent/obuilder"
doc: "https://ocurrent.github.io/obuilder/"
bug-reports: "https://github.com/ocurrent/obuilder/issues"
depends: [
"dune" {>= "2.7"}
"dune" {>= "3.3"}
"fmt" {>= "0.8.9"}
"sexplib"
"astring"
Expand Down
2 changes: 1 addition & 1 deletion obuilder.opam
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ homepage: "https://github.com/ocurrent/obuilder"
doc: "https://ocurrent.github.io/obuilder/"
bug-reports: "https://github.com/ocurrent/obuilder/issues"
depends: [
"dune" {>= "2.7"}
"dune" {>= "3.3"}
"lwt" {>= "5.6.1"}
"astring"
"fmt" {>= "0.8.9"}
Expand Down
9 changes: 6 additions & 3 deletions stress/dune
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
(executable
(name stress)
(libraries obuilder cmdliner fmt.tty))
; No-op test to attach stress.exe to the obuilder package
(test
(name stress)
(libraries obuilder cmdliner fmt.tty)
(package obuilder)
(action (progn)))
3 changes: 1 addition & 2 deletions test/mock_sandbox.ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
type t = {
dir : string;
expect :
(cancelled:unit Lwt.t ->
?stdin:Obuilder.Os.unix_fd ->
Expand All @@ -22,4 +21,4 @@ let run ~cancelled ?stdin ~log t (config:Obuilder.Config.t) dir =
| ex -> Lwt_result.fail (`Msg (Printexc.to_string ex))
)

let create dir = { dir; expect = Queue.create () }
let create () = { expect = Queue.create () }
2 changes: 1 addition & 1 deletion test/mock_sandbox.mli
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include Obuilder.S.SANDBOX

val create : string -> t
val create : unit -> t
val expect :
t -> (cancelled:unit Lwt.t ->
?stdin:Obuilder.Os.unix_fd ->
Expand Down
2 changes: 1 addition & 1 deletion test/test.ml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ let get store path id =

let with_config fn =
Mock_store.with_store @@ fun store ->
let sandbox = Mock_sandbox.create (Mock_store.state_dir store / "sandbox") in
let sandbox = Mock_sandbox.create () in
let builder = B.v ~store ~sandbox in
let src_dir = Mock_store.state_dir store / "src" in
Os.ensure_dir src_dir;
Expand Down