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: 2 additions & 0 deletions .github/workflows/oxcaml.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ jobs:
opam-repositories: |
oxcaml: "git+https://github.com/oxcaml/opam-repository.git"
default: "git+https://github.com/ocaml/opam-repository.git"
opam-pin: false

- name: Install deps
run: |
opam pin add . -n --with-version=3.20.2+ox
opam install . --deps-only
opam install re spawn uutf

Expand Down
6 changes: 6 additions & 0 deletions otherlibs/stdune/src/queue.ml
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
include Stdlib.Queue

let create () = create ()
let push t x = add x t
let peek_exn t = peek t
let pop_exn t = pop t
let pop t = if is_empty t then None else Some (pop_exn t)
let peek t = if is_empty t then None else Some (peek t)
let clear t = clear t
let copy t = copy t
let is_empty t = is_empty t
let length t = length t
let iter t ~f = iter f t
let fold t ~f ~init = fold f init t
let transfer t1 t2 = transfer t1 t2
let to_list t = List.rev (fold t ~f:(fun acc a -> a :: acc) ~init:[])
6 changes: 3 additions & 3 deletions src/csexp_rpc/csexp_rpc.ml
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,10 @@ module Session = struct

external send : Unix.file_descr -> Bytes.t -> int -> int -> int = "dune_send"

let write =
let write t b =
match Platform.OS.value with
| Linux -> send
| _ -> Unix.single_write
| Linux -> send t b
| _ -> Unix.single_write t b
;;

let rec csexp_write_loop fd out_buf token =
Expand Down
17 changes: 8 additions & 9 deletions test/blackbox-tests/test-cases/oxcaml/local.t
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,21 @@ The test ensures we are able to run OxCaml tests for Dune.
> EOF

$ cat > main.ml << EOF
> let i @ local = 42
> let fst_local ((x, _) @ local) = x
> let () = print_int (fst_local (stack_ (1, 2)))
> EOF

$ cat > dune << EOF
> (executable
> (name main))
> EOF

The test fails with an OxCaml error to demonstrate it compiled the ml file with
the correct compiler.
$ dune build ./main.exe
File "main.ml", line 1, characters 4-5:
1 | let i @ local = 42
^
Error: This value is local, but expected to be global because it is inside a module.
[1]
The test succeeds to demonstrate it compiled the ml file with the correct
OxCaml compiler (since OCaml wouldn't recognize `@ local` or `stack_`
allocations).

$ dune exec ./main.exe
1

Demonstrate what happens when the extension isn't enabled:

Expand Down
Loading