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
30 changes: 11 additions & 19 deletions .github/workflows/ocaml-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,30 @@ on:

jobs:
ocaml-test:
strategy:
fail-fast: false
matrix:
ocaml-compiler:
- 4.08.1
- 4.14.0

name: Ocaml tests
runs-on: ubuntu-20.04
env:
package: "nbd nbd-tool nbd-unix"

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Pull configuration from xs-opam
run: |
curl --fail --silent https://raw.githubusercontent.com/xapi-project/xs-opam/master/tools/xs-opam-ci.env | cut -f2 -d " " > .env

- name: Load environment file
id: dotenv
uses: falti/dotenv-action@v0.2.4

- name: Use ocaml
uses: avsm/setup-ocaml@v1
uses: avsm/setup-ocaml@v2
with:
ocaml-version: ${{ steps.dotenv.outputs.ocaml_version_full }}
opam-repository: ${{ steps.dotenv.outputs.repository }}
ocaml-compiler: ${{ matrix.ocaml-compiler }}

- name: Install dependencies
run: |
opam pin add . --no-action
opam depext -u ${{ env.package }}
opam install ${{ env.package }} --deps-only --with-test -v
run: opam install . --deps-only --with-test -v

- name: Build
run: |
opam exec -- make build
run: opam exec -- make build

- name: Run tests
run: opam exec -- dune runtest --instrument-with bisect_ppx --force
Expand Down
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 6.0.1 (2022-09-16):
* Require mirage-block 3.0.0, drop io-page-unix.

# 6.0.0 (2022-08-19):
* Use Stdlib's Result type
* BREAKING: Avoid unerasable optional arguments in init_tls_get_ctx
Expand Down
13 changes: 12 additions & 1 deletion cli/dune
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,15 @@
(name main)
(public_name nbd-tool)
(package nbd-tool)
(libraries cmdliner lwt lwt.unix mirage-block-unix nbd-unix ssl uri))
(libraries
cmdliner
fmt
lwt
lwt.unix
lwt_log
mirage-block
mirage-block-unix
nbd
nbd-unix
ssl
uri))
4 changes: 0 additions & 4 deletions cli/main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ module Device = struct
Block.read t off bufs >>= function
| Result.Error `Disconnected ->
Lwt.return_error `Disconnected
| Result.Error `Unimplemented ->
Lwt.return_error `Unimplemented
| Result.Error _ ->
Lwt.return_error `Disconnected
| Result.Ok x ->
Expand All @@ -88,8 +86,6 @@ module Device = struct
Block.write t off bufs >>= function
| Result.Error `Disconnected ->
Lwt.return_error `Disconnected
| Result.Error `Unimplemented ->
Lwt.return_error `Unimplemented
| Result.Error `Is_read_only ->
Lwt.return_error `Is_read_only
| Result.Error _ ->
Expand Down
13 changes: 12 additions & 1 deletion lib/dune
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,18 @@
(public_name nbd)
(flags
(:standard -w -34-32))
(libraries cstruct io-page lwt lwt_log mirage-block-unix rresult sexplib)
(libraries
cstruct
fmt
io-page
lwt
lwt_log
lwt_log.core
mirage-block
rresult
sexplib
sexplib0
)
(instrumentation (backend bisect_ppx))
(preprocess
(pps ppx_cstruct ppx_sexp_conv -no-check)))
3 changes: 2 additions & 1 deletion lib_test/dune
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
(tests
(names suite mux_test)
(libraries alcotest alcotest-lwt io-page-unix lwt.unix lwt_log nbd))
(package nbd)
(libraries alcotest alcotest-lwt io-page lwt.unix lwt_log nbd))
4 changes: 2 additions & 2 deletions nbd-unix.opam
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ doc: "https://xapi-project.github.io/nbd/nbd-unix/index.html"
bug-reports: "https://github.com/xapi-project/nbd/issues"
depends: [
"ocaml" {>= "4.08.0"}
"bigarray-compat"
"bisect_ppx" {dev & >= "2.5.0"}
"dune" {>= "2.7.0"}
"cstruct-lwt"
"io-page"
"io-page-unix"
"io-page" {>= "2.4.0"}
"lwt" {>= "2.7.0"}
"lwt_ssl"
"mirage-block" {>= "2.0.0"}
Expand Down
6 changes: 3 additions & 3 deletions nbd.opam
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ depends: [
"alcotest" {with-test}
"alcotest-lwt" {with-test}
"cstruct" {>= "6.0.0"}
"io-page"
"io-page-unix" {with-test}
"mirage-block" {>= "2.0.0"}
"io-page" {>= "2.4.0"}
"mirage-block" {>= "3.0.0"}
"mirage-block-unix"
"lwt" {>= "2.7.0"}
"lwt_log"
Expand All @@ -32,6 +31,7 @@ depends: [
"sexplib"
"uri"
]
conflicts: ["result" {< "1.5"}]
tags: [ "org:mirage" "org:xapi-project" ]
synopsis: "Network Block Device (NBD) protocol implementation"
description: """
Expand Down
14 changes: 12 additions & 2 deletions unix/dune
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
(library
(name nbd_unix)
(public_name nbd-unix)
(libraries cstruct-lwt io-page io-page.unix lwt lwt.unix mirage-block
mirage-block-unix ssl lwt_ssl nbd)
(libraries
bigarray-compat
cstruct
cstruct-lwt
io-page
lwt
lwt.unix
mirage-block
mirage-block-unix
ssl
lwt_ssl
nbd)
(instrumentation (backend bisect_ppx)))