Skip to content

Commit

Permalink
Change build command from jbuilder to dune
Browse files Browse the repository at this point in the history
This enables more warnings as errors so it required a few other
source code changes.
  • Loading branch information
brendanlong committed Jan 28, 2019
1 parent 5d0a418 commit 7ec3873
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 11 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
all: build

build:
@jbuilder build @install
@dune build @install

clean:
@rm -rf `find . -name 'bisect*.out'` _coverage
@jbuilder clean
@dune clean

coverage: clean
@BISECT_ENABLE=YES jbuilder runtest
@BISECT_ENABLE=YES dune runtest
@bisect-ppx-report -I _build/default/ -html _coverage/ \
`find . -name 'bisect*.out'`

Expand All @@ -17,7 +17,7 @@ pin:
opam pin add -yn mssql .

test:
@jbuilder runtest --force
@dune runtest --force

# until we have https://github.com/ocaml/opam-publish/issues/38
REPO=../opam-repository
Expand Down
4 changes: 2 additions & 2 deletions mssql.opam
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ synopsis: "Async SQL Server client using FreeTDS"
description: "Mssql wraps FreeTDS in a nicer and safer interface, with support for parameterized queries, thread-based async IO, and a thread pool."

build: [
["jbuilder" "build" "-p" name "-j" jobs]
["jbuilder" "runtest" "-p" name "-j" jobs] {with-test}
["dune" "build" "-p" name "-j" jobs]
["dune" "runtest" "-p" name "-j" jobs] {with-test}
]

depends: [
Expand Down
4 changes: 2 additions & 2 deletions src/client.ml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ let format_query query params =
Array.get params_formatted i)
|> String.concat ~sep:""

let execute' ?params ~query ~formatted_query ({ month_offset } as t) =
let execute' ?params ~query ~formatted_query ({ month_offset ; _ } as t) =
sequencer_enqueue t @@ fun conn ->
In_thread.run (fun () ->
Mssql_error.with_wrap ~query ?params ~formatted_query [%here] (fun () ->
Expand Down Expand Up @@ -232,7 +232,7 @@ let init_conn c =
SET CONCAT_NULL_YIELDS_NULL ON"
|> Deferred.ignore

let close ({ conn } as t) =
let close ({ conn ; _ } as t) =
match conn with
(* already closed *)
| None -> Deferred.unit
Expand Down
1 change: 0 additions & 1 deletion src/client.mli
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
open Core
open Async

type t
Expand Down
2 changes: 1 addition & 1 deletion src/db_field.ml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ let recode ~src ~dst input =
| Dec_error -> failwith "Decode error"
| Dec_need_more -> failwith "Decoder ended with partial character"
done;
String.sub output 0 !enc_i
String.sub output ~pos:0 ~len:!enc_i
with exn ->
Logger.info !"Recoding error, falling back to ascii filter %{sexp: exn} %s"
exn input;
Expand Down
2 changes: 1 addition & 1 deletion test/test_mssql.ml
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ let test_param_out_of_range () =
| Ok _ ->
assert_failure "Command should have thrown param out of range exception"
| Error (Mssql.Error { msg ; query
; params }) ->
; params ; _ }) ->
ae_sexp [%sexp_of: string] expect_msg msg;
ae_sexp [%sexp_of: string option] (Some expect_query) query;
ae_sexp [%sexp_of: Mssql.Param.t option list]
Expand Down

0 comments on commit 7ec3873

Please sign in to comment.