Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use dune.3.7.0 #457

Merged
merged 1 commit into from
Mar 8, 2023
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 3.0)
(lang dune 3.7)
(name eio)
(formatting disabled)
(generate_opam_files true)
Expand Down
2 changes: 1 addition & 1 deletion eio.opam
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ homepage: "https://github.com/ocaml-multicore/eio"
doc: "https://ocaml-multicore.github.io/eio/"
bug-reports: "https://github.com/ocaml-multicore/eio/issues"
depends: [
"dune" {>= "3.0"}
"dune" {>= "3.7"}
"ocaml" {>= "5.0.0"}
"bigstringaf" {>= "0.9.0"}
"cstruct" {>= "6.0.1"}
Expand Down
2 changes: 1 addition & 1 deletion eio_linux.opam
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ homepage: "https://github.com/ocaml-multicore/eio"
doc: "https://ocaml-multicore.github.io/eio/"
bug-reports: "https://github.com/ocaml-multicore/eio/issues"
depends: [
"dune" {>= "3.0"}
"dune" {>= "3.7"}
"alcotest" {>= "1.4.0" & with-test}
"eio" {= version}
"mdx" {>= "1.10.0" & with-test}
Expand Down
2 changes: 1 addition & 1 deletion eio_luv.opam
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ homepage: "https://github.com/ocaml-multicore/eio"
doc: "https://ocaml-multicore.github.io/eio/"
bug-reports: "https://github.com/ocaml-multicore/eio/issues"
depends: [
"dune" {>= "3.0"}
"dune" {>= "3.7"}
"eio" {= version}
"luv" {>= "0.5.11"}
"luv_unix" {>= "0.5.0"}
Expand Down
2 changes: 1 addition & 1 deletion eio_main.opam
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ homepage: "https://github.com/ocaml-multicore/eio"
doc: "https://ocaml-multicore.github.io/eio/"
bug-reports: "https://github.com/ocaml-multicore/eio/issues"
depends: [
"dune" {>= "3.0"}
"dune" {>= "3.7"}
"mdx" {>= "1.10.0" & with-test}
"eio_linux" {= version & os = "linux"}
"eio_posix" {= version & os != "windows"}
Expand Down
2 changes: 1 addition & 1 deletion eio_posix.opam
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ homepage: "https://github.com/ocaml-multicore/eio"
doc: "https://ocaml-multicore.github.io/eio/"
bug-reports: "https://github.com/ocaml-multicore/eio/issues"
depends: [
"dune" {>= "3.0"}
"dune" {>= "3.7"}
"eio" {= version}
"iomux" {>= "0.2"}
"mdx" {>= "1.10.0" & with-test}
Expand Down
2 changes: 0 additions & 2 deletions lib_eio/buf_write.ml
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ type t =
; mutable bytes_written : int (* Total written bytes. Wraps. *)
; mutable state : state
; mutable wake_writer : unit -> unit
; id : Ctf.id
}
(* Invariant: [write_pos >= scheduled_pos] *)

Expand Down Expand Up @@ -378,7 +377,6 @@ let of_buffer ?sw buffer =
; bytes_written = 0
; state = Active
; wake_writer = ignore
; id = Ctf.mint_id ()
}
in
begin match sw with
Expand Down
2 changes: 1 addition & 1 deletion lib_eio/mock/backend.ml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type t = {
(* Suspended fibers waiting to run again.
[Lf_queue] is like [Stdlib.Queue], but is thread-safe (lock-free) and
allows pushing items to the head too, which we need. *)
mutable run_q : (unit -> exit) Lf_queue.t;
run_q : (unit -> exit) Lf_queue.t;
}

(* Resume the next runnable fiber, if any. *)
Expand Down
19 changes: 9 additions & 10 deletions lib_eio_luv/eio_luv.ml
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,6 @@ module Low_level = struct
module File = struct
type t = {
mutable release_hook : Eio.Switch.hook; (* Use this on close to remove switch's [on_release] hook. *)
close_unix : bool;
mutable fd : [`Open of Luv.File.t | `Closed]
}

Expand Down Expand Up @@ -398,11 +397,11 @@ module Low_level = struct

let to_luv = get "to_luv"

let of_luv_no_hook ~close_unix fd =
{ fd = `Open fd; release_hook = Eio.Switch.null_hook; close_unix }
let of_luv_no_hook fd =
{ fd = `Open fd; release_hook = Eio.Switch.null_hook }

let of_luv ?(close_unix=true) ~sw fd =
let t = of_luv_no_hook ~close_unix fd in
let of_luv ~sw fd =
let t = of_luv_no_hook fd in
t.release_hook <- Switch.on_release_cancellable sw (fun () -> ensure_closed t);
t

Expand Down Expand Up @@ -1153,9 +1152,9 @@ let cwd = object
end

let stdenv ~run_event_loop =
let stdin = lazy (source (File.of_luv_no_hook Luv.File.stdin ~close_unix:true)) in
let stdout = lazy (sink (File.of_luv_no_hook Luv.File.stdout ~close_unix:true)) in
let stderr = lazy (sink (File.of_luv_no_hook Luv.File.stderr ~close_unix:true)) in
let stdin = lazy (source (File.of_luv_no_hook Luv.File.stdin)) in
let stdout = lazy (sink (File.of_luv_no_hook Luv.File.stdout)) in
let stderr = lazy (sink (File.of_luv_no_hook Luv.File.stderr)) in
object (_ : stdenv)
method stdin = Lazy.force stdin
method stdout = Lazy.force stdout
Expand Down Expand Up @@ -1282,8 +1281,8 @@ let rec run2 : type a. (_ -> a) -> a = fun main ->
)
| Eio_unix.Private.Pipe sw -> Some (fun k ->
let r, w = Luv.Pipe.pipe ~read_flags:[] ~write_flags:[] () |> or_raise in
let r = (flow (File.of_luv ~close_unix:true ~sw r) :> <Eio.Flow.source; Eio.Flow.close; Eio_unix.unix_fd>) in
let w = (flow (File.of_luv ~close_unix:true ~sw w) :> <Eio.Flow.sink; Eio.Flow.close; Eio_unix.unix_fd>) in
let r = (flow (File.of_luv ~sw r) :> <Eio.Flow.source; Eio.Flow.close; Eio_unix.unix_fd>) in
let w = (flow (File.of_luv ~sw w) :> <Eio.Flow.sink; Eio.Flow.close; Eio_unix.unix_fd>) in
continue k (r, w)
)
| _ -> None
Expand Down
5 changes: 2 additions & 3 deletions lib_eio_luv/eio_luv.mli
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,10 @@ module Low_level : sig
(** [close t] closes [t].
@raise Invalid_arg if [t] is already closed. *)

val of_luv : ?close_unix:bool -> sw:Switch.t -> Luv.File.t -> t
val of_luv : sw:Switch.t -> Luv.File.t -> t
(** [of_luv ~sw fd] wraps [fd] as an open file descriptor.
This is unsafe if [fd] is closed directly (before or after wrapping it).
@param sw The FD is closed when [sw] is released, if not closed manually first.
@param close_unix if [true] (the default), calling [close] also closes [fd]. *)
@param sw The FD is closed when [sw] is released, if not closed manually first. *)

val to_luv : t -> Luv.File.t
(** [to_luv t] returns the wrapped descriptor.
Expand Down