Skip to content

Commit

Permalink
WIP: Getting MDX tests working on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
polytypic committed Jul 21, 2023
1 parent e5a0e54 commit ad9e39c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -752,12 +752,17 @@ Eio.Io Net Connection_failure Refused Unix_error (Connection refused, "connect",
```

If we ran this using another backend, the `Unix_error` part might change.
To avoid this problem, you can use `Eio.Exn.Backend.show` to hide the backend-specific part of errors:
To avoid this problem, you can use `Eio.Exn.Backend.show`

```ocaml
# Eio.Exn.Backend.show := false;;
- : unit = ()
```

to hide the backend-specific part of errors:

<!-- $MDX skip -->
```ocaml
# Eio_main.run @@ fun env ->
let net = Eio.Stdenv.net env in
Switch.run @@ fun sw ->
Expand Down
1 change: 0 additions & 1 deletion dune
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,4 @@
(package eio_main)
(deps (package eio_main) (env_var "EIO_BACKEND"))
(preludes doc/prelude.ml)
(enabled_if (<> %{os_type} "Win32"))
(files README.md))
2 changes: 1 addition & 1 deletion eio_windows.opam
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ build: [
]
]
dev-repo: "git+https://github.com/ocaml-multicore/eio.git"
#available: [os-family = "windows"]
#available: [os = "win32"]
3 changes: 2 additions & 1 deletion lib_eio_windows/dune
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
(library
(name eio_windows)
(public_name eio_windows)
(library_flags :standard -ccopt -lbcrypt -ccopt -lntdll)
(library_flags :standard -cclib -lbcrypt -cclib -lntdll)
(enabled_if (= %{os_type} "Win32"))
(foreign_stubs
(language c)
(include_dirs ../lib_eio/unix/include)
(names eio_windows_stubs eio_windows_cstruct_stubs))
(c_library_flags :standard -lbcrypt -lntdll)
(libraries eio eio.unix eio.utils fmt))

(rule
Expand Down

0 comments on commit ad9e39c

Please sign in to comment.