From 2379a4ac67ef60ba4d771946eb7f37232b8a38f3 Mon Sep 17 00:00:00 2001 From: ivg Date: Fri, 29 Jul 2022 18:29:20 -0400 Subject: [PATCH 1/4] switches to dune The only breaking change is that we have piqirun.pb and piqirun.ext but not piqirun, dune doesn't allow this. It should be noted that, in fact, piqirun was an empty library, which shouldn't be referenced at all and probably was added accidentally. --- .gitignore | 1 + dune | 1 + dune-project | 3 +++ opam | 27 +++++++++++++++------------ piqic-ocaml/dune | 9 +++++++++ piqic-ocaml/make_version.sh | 1 + piqirun/dune | 13 +++++++++++++ 7 files changed, 43 insertions(+), 12 deletions(-) create mode 100644 dune create mode 100644 dune-project create mode 100644 piqic-ocaml/dune create mode 100755 piqic-ocaml/make_version.sh create mode 100644 piqirun/dune diff --git a/.gitignore b/.gitignore index 01c9cd9..0e1b1d4 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ # vim: *.swp +/_build/ diff --git a/dune b/dune new file mode 100644 index 0000000..8daec20 --- /dev/null +++ b/dune @@ -0,0 +1 @@ +(env (dev (flags (:standard -warn-error -A)))) diff --git a/dune-project b/dune-project new file mode 100644 index 0000000..6770216 --- /dev/null +++ b/dune-project @@ -0,0 +1,3 @@ +(lang dune 2.0) + +(package (name piqirun)) diff --git a/opam b/opam index be9411e..4f8714d 100644 --- a/opam +++ b/opam @@ -4,18 +4,6 @@ authors: "Anton Lavrik " maintainer: "Anton Lavrik " homepage: "https://github.com/alavrik/piqi-ocaml" bug-reports: "https://github.com/alavrik/piqi-ocaml/issues" -build: [ - [make] - [make "test"] {with-test} -] -install: [ - [make "DESTDIR=%{prefix}%" "install"] -] -remove: [ - ["rm" "-f" "%{prefix}%/bin/piqic-ocaml"] - ["ocamlfind" "remove" "piqirun"] -] -flags: light-uninstall depends: [ "ocaml" {>= "4.02.0"} "ocamlfind" {build} @@ -24,3 +12,18 @@ depends: [ "num" {with-test} ] dev-repo: "git://github.com/alavrik/piqi-ocaml" + +build: [ + ["dune" "subst"] {dev} + [ + "dune" + "build" + "-p" + name + "-j" + jobs + "@install" + "@runtest" {with-test} + "@doc" {with-doc} + ] +] diff --git a/piqic-ocaml/dune b/piqic-ocaml/dune new file mode 100644 index 0000000..518f1b8 --- /dev/null +++ b/piqic-ocaml/dune @@ -0,0 +1,9 @@ +(executable + (name piqic_ocaml) + (public_name piqic-ocaml) + (libraries piqilib piqirun bytes stdlib-shims)) + +(rule + (target piqic_ocaml_version.ml) + (action (with-stdout-to %{target} + (bash ./make_version.sh)))) diff --git a/piqic-ocaml/make_version.sh b/piqic-ocaml/make_version.sh new file mode 100755 index 0000000..dfea812 --- /dev/null +++ b/piqic-ocaml/make_version.sh @@ -0,0 +1 @@ +echo "let version = \"$(head -1 ../VERSION)\"" diff --git a/piqirun/dune b/piqirun/dune new file mode 100644 index 0000000..feedf88 --- /dev/null +++ b/piqirun/dune @@ -0,0 +1,13 @@ +(library + (name piqirun) + (public_name piqirun.pb) + (wrapped false) + (libraries piqilib stdlib-shims) + (modules piqirun)) + +(library + (name piqirun_ext) + (public_name piqirun.ext) + (wrapped false) + (libraries piqilib stdlib-shims) + (modules piqirun_ext)) From d5693c02cca67cea477e636a1ffe70b3d8d12166 Mon Sep 17 00:00:00 2001 From: ivg Date: Fri, 29 Jul 2022 19:55:29 -0400 Subject: [PATCH 2/4] fixes the sandboxing issue --- dune-project | 1 + piqic-ocaml/dune | 3 +++ 2 files changed, 4 insertions(+) diff --git a/dune-project b/dune-project index 6770216..072dfe7 100644 --- a/dune-project +++ b/dune-project @@ -1,3 +1,4 @@ (lang dune 2.0) +(name piqi) (package (name piqirun)) diff --git a/piqic-ocaml/dune b/piqic-ocaml/dune index 518f1b8..ee95dd4 100644 --- a/piqic-ocaml/dune +++ b/piqic-ocaml/dune @@ -5,5 +5,8 @@ (rule (target piqic_ocaml_version.ml) + (deps + (file make_version.sh) + (file ../VERSION)) (action (with-stdout-to %{target} (bash ./make_version.sh)))) From 1b6883238a74a2b0efe5c5f40c076ef2eeed40ec Mon Sep 17 00:00:00 2001 From: Anton Lavrik Date: Mon, 1 Aug 2022 13:27:05 +0100 Subject: [PATCH 3/4] Fix 'dune build' --- dune-project | 1 + piqic-ocaml/dune | 1 + 2 files changed, 2 insertions(+) diff --git a/dune-project b/dune-project index 072dfe7..53dcc04 100644 --- a/dune-project +++ b/dune-project @@ -1,4 +1,5 @@ (lang dune 2.0) (name piqi) +(package (name piqi)) (package (name piqirun)) diff --git a/piqic-ocaml/dune b/piqic-ocaml/dune index ee95dd4..ce6af9b 100644 --- a/piqic-ocaml/dune +++ b/piqic-ocaml/dune @@ -1,6 +1,7 @@ (executable (name piqic_ocaml) (public_name piqic-ocaml) + (package piqi) (libraries piqilib piqirun bytes stdlib-shims)) (rule From aa44f89d5e84b86c4aa384de0499555fc884ba0b Mon Sep 17 00:00:00 2001 From: Anton Lavrik Date: Mon, 1 Aug 2022 13:54:50 +0100 Subject: [PATCH 4/4] Fix "opam install" after the previous dune-project change --- opam | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opam b/opam index 4f8714d..76403a4 100644 --- a/opam +++ b/opam @@ -19,7 +19,7 @@ build: [ "dune" "build" "-p" - name + "piqi,piqirun" "-j" jobs "@install"