profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/jeremiedimino/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Jérémie Dimino jeremiedimino Jane Street Capital London

jeremiedimino/dune-file 10

Toolbox for reading and editing dune files

jeremiedimino/ocaml-3.12.1-print 9

OCaml with generic printer

jeremiedimino/auto-printer 6

Automatically install toplevel printers

jeremiedimino/mlspot 6

OCaml implementation of the Spotify protocol

bsansouci/jengaroot 3

Set of build rules for jenga

jeremiedimino/estring 3

Extension for string literals in OCaml

jeremiedimino/mister-patate 2

2D platform game

jeremiedimino/Camomile 1

A Unicode library for OCaml

push eventdune-universe/dune-universe

Jeremie Dimino

commit sha c60d00909394b5793c9b4a5a55aa6262f29e1820

Updated packages

view details

push time in 3 days

PullRequestReviewEvent
PullRequestReviewEvent
PullRequestReviewEvent

Pull request review commentocaml/ocaml

Add {In,Out}_channel.with_open_{bin,text,gen} and In_channel.input_all

 let really_input_string ic len =   | s -> Some s   | exception End_of_file -> None +(* Read up to [len] bytes into [buf], starting at [ofs]. Return total bytes+   read. *)+let read_upto ic buf ofs len =+  let rec loop ofs len =+    if len = 0 then ofs+    else begin+      let r = Stdlib.input ic buf ofs len in+      if r = 0 then+        ofs+      else+        loop (ofs + r) (len - r)+    end+  in+  loop ofs len - ofs++(* Return a buffer that has >= [ofs + n] bytes of storage, and+   coincides with [buf] at indices < [ofs]. *)+let ensure buf ofs n =+  let len = Bytes.length buf in+  if len >= ofs + n then buf+  else begin+    let new_len = ref len in+    while !new_len < ofs + n do+      new_len := 2 * !new_len + 1+    done;+    let new_len = !new_len in+    let new_len =+      if new_len <= Sys.max_string_length then+        new_len+      else if ofs < Sys.max_string_length then+        Sys.max_string_length

Thanks, looks correct to me now!

nojb

comment created time in 4 days

PullRequestReviewEvent

Pull request review commentocaml/ocaml

Add {In,Out}_channel.with_open_{bin,text,gen} and In_channel.input_all

 let really_input_string ic len =   | s -> Some s   | exception End_of_file -> None +(* Read up to [len] bytes into [buf], starting at [ofs]. Return total bytes+   read. *)+let read_upto ic buf ofs len =+  let rec loop ofs len =+    if len = 0 then ofs+    else begin+      let r = Stdlib.input ic buf ofs len in+      if r = 0 then+        ofs+      else+        loop (ofs + r) (len - r)+    end+  in+  loop ofs len - ofs++(* Return a buffer that has >= [ofs + n] bytes of storage, and+   coincides with [buf] at indices < [ofs]. *)+let ensure buf ofs n =+  let len = Bytes.length buf in+  if len >= ofs + n then buf+  else begin+    let new_len = ref len in+    while !new_len < ofs + n do+      new_len := 2 * !new_len + 1+    done;

indeed

nojb

comment created time in 4 days

PullRequestReviewEvent

push eventocaml/dune

Jeremie Dimino

commit sha cb0e3c01daecf1f61e4912855524c7bf3feb9398

Move finding the ancestor vcs to source_tree.ml Signed-off-by: Jeremie Dimino <jeremie@dimino.org>

view details

Jeremie Dimino

commit sha 046614eb1d1a567ddf52c00666b02094e0de5df7

Change the root detection Closes #4459 Signed-off-by: Jeremie Dimino <jeremie@dimino.org>

view details

push time in 4 days

issue closedocaml/dune

Require a `dune-project` or `dune-workspace` file to exist

Right now, if there is no dune-project or dune-workspace file in the current or a parent directory, Dune will still work and will use the current directory as workspace root.

In the past, this has bitten users who accidentally ran dune from the wrong directory, such as their home directory. The current behaviour dates back from jbuilder and was inspired by ocamlbuild. It was pointed out that some users of ocamlbuild already complained about this.

We discussed this in today's meeting and unanimously agreed to change Dune to require at least one dune-project or dune-workspace file to be present. One drawback is that it will make it a bit more difficult to get started, so we should also change dune init so that when invoked without argument it creates a simple dune-project file. A bit like git init.

We also discussed the fact that dune doesn't stop at the first dune-project or dune-workspace file is finds, but continue is search upward so that it uses the outtermost file as workspace root marker. The rationale for this choice is that Dune allows to compose several projects into a single big workspace. It makes sense to not stop at the first dune-project file but it makes a little less sense to continue past a dune-workspace file, given that there can be multiple dune-project file in a workspace but there can only be a single dune-workspace file. So we also decided to change Dune to stop at the first dune-workspace file it encounters.

We will do this changes in main and test them until Dune 3.0 to see how they work in practice. There will also be a release candidate for Dune 3.0, to give users a chance to test all these changes.

closed time in 4 days

jeremiedimino

PR merged ocaml/dune

Simplify root detection + require a dune-project or dune-workspace file to exist

As previously discussed. See #4459 for details.

+120 -119

2 comments

10 changed files

jeremiedimino

pr closed time in 4 days

push eventjeremiedimino/dune

Jeremie Dimino

commit sha 790d7542b04fd7993073a5cf7f6164344d443174

Move finding the ancestor vcs to source_tree.ml Signed-off-by: Jeremie Dimino <jeremie@dimino.org>

view details

Jeremie Dimino

commit sha 6a3406bb9f6eb7bc574fb98bdac3e6dc2a66a92a

Change the root detection Closes #4459 Signed-off-by: Jeremie Dimino <jeremie@dimino.org>

view details

push time in 4 days

push eventjeremiedimino/dune

Rudi Grinberg

commit sha dcd3067e6620011d0397d3764ad44fd0d6319074

[scheduler] Use Thread.spawn consistently Previously, Thread.create was also used Signed-off-by: Rudi Grinberg <me@rgrinberg.com>

view details

Rudi Grinberg

commit sha 3194bcdff45606c8a676762c8de42647b44159a7

[dyn] consistent opaque rep Signed-off-by: Rudi Grinberg <me@rgrinberg.com>

view details

Rudi Grinberg

commit sha db90052c5f5c3debfd61ffafb08e960829d629c2

[dyn] remove unknown opaque is better Signed-off-by: Rudi Grinberg <me@rgrinberg.com>

view details

Rudi Grinberg

commit sha d7a3c461dc35424d165cd5ca0f900d516b9568ae

Move Dyn to own library and package Signed-off-by: Rudi Grinberg <me@rgrinberg.com>

view details

Rudi Grinberg

commit sha 12004545c1831970eb49488b4da0ddd376503438

Remove stdune from dune-rpc-lwt Signed-off-by: Rudi Grinberg <me@rgrinberg.com>

view details

Rudi Grinberg

commit sha 80b5220530c06931da16324476e76965448be049

Use Dyn directly everywhere without going through Stdune Signed-off-by: Rudi Grinberg <me@rgrinberg.com>

view details

Rudi Grinberg

commit sha dc9287c3abd888c7f8b302c8a3a04c6ba023afe5

Vendor pp in the dyn package temporary workaround Signed-off-by: Rudi Grinberg <me@rgrinberg.com>

view details

Rudi Grinberg

commit sha fa6c4850722b5b80633fc0332a64f123c1310960

Add missing library to xdg Signed-off-by: Rudi Grinberg <me@rgrinberg.com>

view details

Rudi Grinberg

commit sha c6737522578f9b1367ef8a6c4ab9f74759207268

Make xdg library public It will be needed by the rpc client Signed-off-by: Rudi Grinberg <me@rgrinberg.com>

view details

Rudi Grinberg

commit sha 1a8e2951e16706264014dd64927c8b474cecc749

Remove unix from xdg It was only used to find the home dir in case $HOME wasn't set. But that isn't part of the spec anyway. Signed-off-by: Rudi Grinberg <me@rgrinberg.com>

view details

Rudi Grinberg

commit sha bf50443b83397bc79a9c9997fa20450580ca8029

[rpc] add process registry the process registry allows dune instances to register that they are running and the clients to poll the list of actively running instances. Signed-off-by: Rudi Grinberg <me@rgrinberg.com>

view details

Rudi Grinberg

commit sha 1a4da30157de5d79b98c5ff257b03a815b58b272

[rpc] Skip . and .. in directory listing Signed-off-by: Rudi Grinberg <me@rgrinberg.com>

view details

Rudi Grinberg

commit sha df1c3f620a3b7054d23ab9a3bcd38954f49e026e

[dunerpc] Registry.refresh should be abstract Signed-off-by: Rudi Grinberg <me@rgrinberg.com>

view details

Rudi Grinberg

commit sha 59fb7a583da5512f091ca57a762a3f059642ee30

[dunerpc] remove win32 functor arg Signed-off-by: Rudi Grinberg <me@rgrinberg.com>

view details

Rudi Grinberg

commit sha 907d1cda6ba5fdd2d5825bfccec32cb33b9c4a2a

[dunerpc] Simplify env handling for Where Signed-off-by: Rudi Grinberg <me@rgrinberg.com>

view details

Rudi Grinberg

commit sha 7fbb0bd8e82a9c5aaec8dc48b60af6d22f171c5e

[rpc] rename Sys to IO for consistency Signed-off-by: Rudi Grinberg <me@rgrinberg.com>

view details

Rudi Grinberg

commit sha 7d577cba42973bc9bb67b1cb2da9c30efc71e537

[dune rpc] simplify socket creation Signed-off-by: Rudi Grinberg <me@rgrinberg.com>

view details

Rudi Grinberg

commit sha 911288a1034528206f67a65f7184362b4fe09a26

[rpc] use shorter socket name Signed-off-by: Rudi Grinberg <me@rgrinberg.com>

view details

Rudi Grinberg

commit sha a11d39bfdeff34a2baabe94d29c95c28af372ff0

Use (string -> string option) as env type Signed-off-by: Rudi Grinberg <me@rgrinberg.com>

view details

Rudi Grinberg

commit sha df8708bf1b427f47c0d220f741bd5b66e133811e

[rpc] Rename is_win32 to win32 for consistency Signed-off-by: Rudi Grinberg <me@rgrinberg.com>

view details

push time in 4 days

pull request commentocaml/dune

Simplify root detection + require a dune-project or dune-workspace file to exist

Those changes look great, Jeremie! Nice work.

Thanks for you help with the doc Christine!

jeremiedimino

comment created time in 4 days

push eventocaml/dune

Jérémie Dimino

commit sha 6a3d3637ad958f6f3f1614c095cde61702dd88ec

Fix progress display (#4933) The progress wasn't displayed during the first build. It was only displayed from the second build in polling mode. This was because of a `Status_line.set_constant None` in the function that scanned the source tree. The fix is to not clear the status line in this function, and instead use a "status line overlay". Signed-off-by: Jeremie Dimino <jeremie@dimino.org>

view details

push time in 4 days

PR merged ocaml/dune

Fix progress display

The progress wasn't displayed during the first build. It was only displayed from the second build in polling mode. This was because of a Status_line.set_constant None in the function that scanned the source tree.

The fix is to not clear the status line in this function, and instead use a "status line overlay".

+91 -50

0 comment

8 changed files

jeremiedimino

pr closed time in 4 days

push eventjeremiedimino/dune

Jeremie Dimino

commit sha 8bc112842b1a5b6cd83191ec48098139c0c8f941

Fix progress display The progress display wasn't displayed during the first build. It was only displayed from the second build in polling mode. This was because of a `Status_line.set_constant None` in the function that scanned the source tree. The fix is to not clear the status line in this function, and instead use a "status line overlay". Signed-off-by: Jeremie Dimino <jeremie@dimino.org>

view details

push time in 4 days

push eventjeremiedimino/dune

Cameron Wong

commit sha 75fb9a2623611c60f55ec5aa461f9fac60386739

[RPC] fix handling of post-versioning aborts (#4929) * fix handling of post-versioning aborts I should have caught this earlier. It doesn't actually change any observable behavior, but is probably a good change to make for hygiene's sake anyway. Signed-off-by: Cameron Wong <cwong@janestreet.com> * mark handler initialized before yielding Signed-off-by: Cameron Wong <cwong@janestreet.com>

view details

Rudi Grinberg

commit sha 09f9d396b952a4868325843802903f345b75708a

[RPC] rename socket dir Rename From rpc to _rpc. So it makes it possible to have a context named "rpc" Signed-off-by: Rudi Grinberg <me@rgrinberg.com>

view details

Jeremie Dimino

commit sha 3da1d84578dbc9888297dd422677440b8b1325b1

Fix progress display The progress display wasn't displayed during the first build. It was only displayed from the second build in polling mode. This was because of a `Status_line.set_constant None` in the function that scanned the source tree. The fix is to not clear the status line in this function, and instead use a "status line overlay". Signed-off-by: Jeremie Dimino <jeremie@dimino.org>

view details

push time in 4 days

PR opened ocaml/dune

Fix progress display

The progress wasn't displayed during the first build. It was only displayed from the second build in polling mode. This was because of a Status_line.set_constant None in the function that scanned the source tree.

The fix is to not clear the status line in this function, and instead use a "status line overlay".

+90 -49

0 comment

7 changed files

pr created time in 4 days

create barnchjeremiedimino/dune

branch : fix-console

created branch time in 4 days

PullRequestReviewEvent

Pull request review commentocaml/dune

Simplify root detection + require a dune-project or dune-workspace file to exist

 directory:     Entering directory '/home/jdimino/code/dune'     ... -More precisely, it will choose the outermost ancestor directory containing a-``dune-workspace`` file as root. For instance if you are in-``/home/me/code/myproject/src``, then dune will look for all these files in-order:---  ``/dune-workspace``--  ``/home/dune-workspace``--  ``/home/me/dune-workspace``--  ``/home/me/code/dune-workspace``--  ``/home/me/code/myproject/dune-workspace``--  ``/home/me/code/myproject/src/dune-workspace``--The first entry to match in this list will determine the root. In-practice this means that if you nest your workspaces, dune will-always use the outermost one.--In addition to determining the root, ``dune`` will read this file-to setup the configuration of the workspace unless the ``--workspace``-command line option is used. See the section :ref:`dune-workspace`-for the syntax of this file.--The ``Entering directory`` message can be suppressed with the-``--no-print-directory`` command line option (as in GNU make).+This message can be suppressed with the ``--no-print-directory``+command line option (as in GNU make).++Dune requires at least one ``dune-workspace`` file or ``dune-project``

I updated the text following our discussion on slack

jeremiedimino

comment created time in 4 days

PullRequestReviewEvent

push eventjeremiedimino/dune

Jeremie Dimino

commit sha 8f78af911cc6dda9645279b71bcf82d4c50158b7

_ Signed-off-by: Jeremie Dimino <jeremie@dimino.org>

view details

push time in 4 days

push eventjeremiedimino/dune

Jeremie Dimino

commit sha 7963346a657b2393ed6a34acba09c3ecc37a412b

_ Signed-off-by: Jeremie Dimino <jeremie@dimino.org>

view details

push time in 4 days

push eventjeremiedimino/dune

Jeremie Dimino

commit sha de175b70798f0264b7ab7e427d2b26cdf3ae7d80

_ Signed-off-by: Jeremie Dimino <jeremie@dimino.org>

view details

push time in 4 days

PullRequestReviewEvent
PullRequestReviewEvent

Pull request review commentocaml/ocaml

Add {In,Out}_channel.with_open_{bin,text,gen} and In_channel.input_all

 let really_input_string ic len =   | s -> Some s   | exception End_of_file -> None +(* Read up to [len] bytes into [buf], starting at [ofs]. Return total bytes+   read. *)+let read_upto ic buf ofs len =+  let rec loop ofs len =+    if len = 0 then ofs+    else begin+      let r = Stdlib.input ic buf ofs len in+      if r = 0 then+        ofs+      else+        loop (ofs + r) (len - r)+    end+  in+  loop ofs len - ofs++(* Return a buffer that has >= [ofs + n] bytes of storage, and+   coincides with [buf] at indices < [ofs]. *)+let ensure buf ofs n =+  let len = Bytes.length buf in+  if len >= ofs + n then buf+  else begin+    let new_len = ref len in+    while !new_len < ofs + n do+      new_len := 2 * !new_len + 1+    done;+    let new_len = !new_len in+    let new_len =+      if new_len <= Sys.max_string_length then+        new_len+      else if ofs < Sys.max_string_length then+        Sys.max_string_length

ensure doesn't respect the contract written in the doc comment in this case. For instance if ofs = Sys.max_string_length - 10 and n = 20, then the returned buffer will only have Sys.max_string_length bytes of storage rather than Sys.max_string_length + 10.

Looking at the way this function is used inside let rec loop ... bellow, this can be an issue as we call read_upto right after with len = chunk_size. This means that we might end up doing a call to Stdlib.input with ofs + len > Bytes.length buf, which would raise Invalid_argument "input".

nojb

comment created time in 4 days

Pull request review commentocaml/ocaml

Add {In,Out}_channel.with_open_{bin,text,gen} and In_channel.input_all

+(* TEST+readonly_files = "input_all.ml"+*)++let data_file =+  "data.txt"++let random_string size =+  String.init size (fun _ -> Char.chr (Random.int 256))++(* various sizes, binary mode *)++let check size =+  let data = random_string size in+  Out_channel.with_open_bin data_file (fun oc -> Out_channel.output_string oc data);+  let read_data = In_channel.with_open_bin data_file In_channel.input_all in+  assert (data = read_data)++let () =+  List.iter check [ 0; 1; 65536; 65536 + 1; 2 * 65536 ]++(* binary mode; non-zero starting position *)++let data_size = 65536++let check midpoint =+  let data = random_string data_size in+  Out_channel.with_open_bin data_file+    (fun oc -> Out_channel.output_string oc data);+  let contents =+    In_channel.with_open_bin data_file+      (fun ic ->+         let s1 = Option.get (In_channel.really_input_string ic midpoint) in+         let s2 = In_channel.input_all ic in+         s1 ^ s2+      )+  in+  assert (contents = data)++let () =+  List.iter check [0; 1; 100; data_size]++(* text mode *)++(* translates LF into CRLF in-place in [fn] *)+let unix2dos fn =+  let s = In_channel.with_open_text fn In_channel.input_all in+  Out_channel.with_open_text fn+    (fun oc -> Out_channel.output_string oc s)++let source_fn =+  "input_all.ml"

On Windows, whether input_all.ml has unix or dos end of lines will depend on how the user configures git. Does that matter here?

nojb

comment created time in 4 days