From dca41efb319bc0dd7ebffbf1c39487bfda40799a Mon Sep 17 00:00:00 2001 From: Alistair Michael Date: Tue, 24 Sep 2024 14:29:48 +1000 Subject: [PATCH 01/10] separate server module --- asli.opam | 3 --- aslp_server/aslp_server.opam | 34 ++++++++++++++++++++++++ aslp_server/bin/dune | 6 +++++ bin/server.ml => aslp_server/bin/main.ml | 8 ------ aslp_server/dune-project | 30 +++++++++++++++++++++ aslp_server/lib/dune | 2 ++ aslp_server/test/dune | 2 ++ aslp_server/test/test_aslp_server.ml | 0 bin/dune | 9 ------- dune-project | 3 --- 10 files changed, 74 insertions(+), 23 deletions(-) create mode 100644 aslp_server/aslp_server.opam create mode 100644 aslp_server/bin/dune rename bin/server.ml => aslp_server/bin/main.ml (97%) create mode 100644 aslp_server/dune-project create mode 100644 aslp_server/lib/dune create mode 100644 aslp_server/test/dune create mode 100644 aslp_server/test/test_aslp_server.ml diff --git a/asli.opam b/asli.opam index c36f30e1..113ecdfb 100644 --- a/asli.opam +++ b/asli.opam @@ -26,9 +26,6 @@ depends: [ "z3" {>= "4.8.7"} "alcotest" {with-test} "ppx_blob" - "lwt" - "cohttp-lwt-unix" - "yojson" "mlbdd" "odoc" {with-doc} ] diff --git a/aslp_server/aslp_server.opam b/aslp_server/aslp_server.opam new file mode 100644 index 00000000..e8c36ccd --- /dev/null +++ b/aslp_server/aslp_server.opam @@ -0,0 +1,34 @@ +# This file is generated by dune, edit dune-project instead +opam-version: "2.0" +synopsis: "A short synopsis" +description: "A longer description" +maintainer: ["Maintainer Name"] +authors: ["Author Name"] +license: "LICENSE" +tags: ["topics" "to describe" "your" "project"] +homepage: "https://github.com/username/reponame" +doc: "https://url/to/documentation" +bug-reports: "https://github.com/username/reponame/issues" +depends: [ + "ocaml" + "dune" {>= "3.16"} + "cohttp-lwt-unix" + "yojson" + "asli" {= "0.2.0"} + "odoc" {with-doc} +] +build: [ + ["dune" "subst"] {dev} + [ + "dune" + "build" + "-p" + name + "-j" + jobs + "@install" + "@runtest" {with-test} + "@doc" {with-doc} + ] +] +dev-repo: "git+https://github.com/username/reponame.git" diff --git a/aslp_server/bin/dune b/aslp_server/bin/dune new file mode 100644 index 00000000..4bf7d5df --- /dev/null +++ b/aslp_server/bin/dune @@ -0,0 +1,6 @@ +(executable + (public_name aslp_server) + (name main) + (modules main) + (libraries asli.libASL lwt.unix yojson cohttp-lwt cohttp-lwt-unix pprint)) + diff --git a/bin/server.ml b/aslp_server/bin/main.ml similarity index 97% rename from bin/server.ml rename to aslp_server/bin/main.ml index 759eee24..c1551c86 100644 --- a/bin/server.ml +++ b/aslp_server/bin/main.ml @@ -1,17 +1,9 @@ open LibASL - -open Yojson open Cohttp -open Cohttp_lwt open Cohttp_lwt_unix -open String open List -open Array open Asl_ast -open Value -open Eval -open Asl_utils open Lwt diff --git a/aslp_server/dune-project b/aslp_server/dune-project new file mode 100644 index 00000000..ee4073d0 --- /dev/null +++ b/aslp_server/dune-project @@ -0,0 +1,30 @@ +(lang dune 3.16) + +(name aslp_server) + +(generate_opam_files true) + +(source + (github username/reponame)) + +(authors "Author Name") + +(maintainers "Maintainer Name") + +(license LICENSE) + +(documentation https://url/to/documentation) + +(package + (name aslp_server) + (synopsis "A short synopsis") + (description "A longer description") + (depends ocaml dune + "cohttp-lwt-unix" + "yojson" + ("asli" (= 0.2.0)) + ) + (tags + (topics "to describe" your project))) + +; See the complete stanza docs at https://dune.readthedocs.io/en/stable/reference/dune-project/index.html diff --git a/aslp_server/lib/dune b/aslp_server/lib/dune new file mode 100644 index 00000000..adcd4474 --- /dev/null +++ b/aslp_server/lib/dune @@ -0,0 +1,2 @@ +(library + (name aslp_server)) diff --git a/aslp_server/test/dune b/aslp_server/test/dune new file mode 100644 index 00000000..cc27592b --- /dev/null +++ b/aslp_server/test/dune @@ -0,0 +1,2 @@ +(test + (name test_aslp_server)) diff --git a/aslp_server/test/test_aslp_server.ml b/aslp_server/test/test_aslp_server.ml new file mode 100644 index 00000000..e69de29b diff --git a/bin/dune b/bin/dune index 7b572c03..72b325f5 100644 --- a/bin/dune +++ b/bin/dune @@ -8,15 +8,6 @@ (libraries asli.libASL linenoise pprint) ) -(executable - (name server) - (public_name aslp-server) - (modes exe) - (modules server) - (flags (-cclib -lstdc++)) - (libraries asli.libASL pprint lwt.unix yojson cohttp-lwt cohttp-lwt-unix)) - - (executable (name testlexer) (modes exe) diff --git a/dune-project b/dune-project index ec36847e..f78a06fc 100644 --- a/dune-project +++ b/dune-project @@ -24,9 +24,6 @@ ("z3" (>= "4.8.7")) ("alcotest" :with-test) "ppx_blob" - "lwt" - "cohttp-lwt-unix" - "yojson" "mlbdd" ) ) From 590dc8c37adf0faee1085aae6627e521b27ac9fb Mon Sep 17 00:00:00 2001 From: Alistair Michael Date: Tue, 24 Sep 2024 14:32:15 +1000 Subject: [PATCH 02/10] remove unused --- aslp_server/lib/dune | 2 -- aslp_server/test/dune | 2 -- aslp_server/test/test_aslp_server.ml | 0 3 files changed, 4 deletions(-) delete mode 100644 aslp_server/lib/dune delete mode 100644 aslp_server/test/dune delete mode 100644 aslp_server/test/test_aslp_server.ml diff --git a/aslp_server/lib/dune b/aslp_server/lib/dune deleted file mode 100644 index adcd4474..00000000 --- a/aslp_server/lib/dune +++ /dev/null @@ -1,2 +0,0 @@ -(library - (name aslp_server)) diff --git a/aslp_server/test/dune b/aslp_server/test/dune deleted file mode 100644 index cc27592b..00000000 --- a/aslp_server/test/dune +++ /dev/null @@ -1,2 +0,0 @@ -(test - (name test_aslp_server)) diff --git a/aslp_server/test/test_aslp_server.ml b/aslp_server/test/test_aslp_server.ml deleted file mode 100644 index e69de29b..00000000 From 224811e1d98c97444781f8deb5bd54e05fbb8530 Mon Sep 17 00:00:00 2001 From: Alistair Michael Date: Tue, 24 Sep 2024 14:55:02 +1000 Subject: [PATCH 03/10] build aslp_server ga --- .github/workflows/opam.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/opam.yml b/.github/workflows/opam.yml index 8b95df3b..d25e97cc 100644 --- a/.github/workflows/opam.yml +++ b/.github/workflows/opam.yml @@ -25,4 +25,6 @@ jobs: - run: opam install dune - run: opam install . --deps-only --with-test - run: opam exec -- dune build --profile release + - run: cd aslp_server && opam install . --deps-only + - run: cd aslp_server && opam exec -- dune build --profile release From bb562ac84683869ac78b9fa1853a1cae93bd6a77 Mon Sep 17 00:00:00 2001 From: Alistair Michael Date: Tue, 24 Sep 2024 15:11:57 +1000 Subject: [PATCH 04/10] asli version --- aslp_server/dune-project | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aslp_server/dune-project b/aslp_server/dune-project index ee4073d0..86804d1c 100644 --- a/aslp_server/dune-project +++ b/aslp_server/dune-project @@ -22,7 +22,7 @@ (depends ocaml dune "cohttp-lwt-unix" "yojson" - ("asli" (= 0.2.0)) + "asli" ) (tags (topics "to describe" your project))) From cf0cc900e8278d16d7886154ea9751a3dd97b7b0 Mon Sep 17 00:00:00 2001 From: Alistair Michael Date: Tue, 24 Sep 2024 15:36:40 +1000 Subject: [PATCH 05/10] update dune proj --- .github/workflows/opam.yml | 1 + aslp_server/dune-project | 18 ++++++++---------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/opam.yml b/.github/workflows/opam.yml index d25e97cc..f5a8481d 100644 --- a/.github/workflows/opam.yml +++ b/.github/workflows/opam.yml @@ -25,6 +25,7 @@ jobs: - run: opam install dune - run: opam install . --deps-only --with-test - run: opam exec -- dune build --profile release + - run: opam exec -- dune install - run: cd aslp_server && opam install . --deps-only - run: cd aslp_server && opam exec -- dune build --profile release diff --git a/aslp_server/dune-project b/aslp_server/dune-project index 86804d1c..e106a40a 100644 --- a/aslp_server/dune-project +++ b/aslp_server/dune-project @@ -5,26 +5,24 @@ (generate_opam_files true) (source - (github username/reponame)) + (github UQ-PAC/aslp)) -(authors "Author Name") +(authors "ailrst") +(maintainers "ailrst") -(maintainers "Maintainer Name") +(license BSD-3-Clause) -(license LICENSE) - -(documentation https://url/to/documentation) +(documentation https://github.com/UQ-PAC/aslp) (package (name aslp_server) - (synopsis "A short synopsis") - (description "A longer description") + (synopsis "REST server for ASLp") + (description "") (depends ocaml dune "cohttp-lwt-unix" "yojson" "asli" ) - (tags - (topics "to describe" your project))) + ) ; See the complete stanza docs at https://dune.readthedocs.io/en/stable/reference/dune-project/index.html From 0424fbf12011cc998454c0f3dd9898f0254635d2 Mon Sep 17 00:00:00 2001 From: Alistair Michael Date: Tue, 24 Sep 2024 16:00:26 +1000 Subject: [PATCH 06/10] update action --- .github/workflows/opam.yml | 3 +-- aslp_server/aslp_server.opam | 21 ++++++++++----------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/.github/workflows/opam.yml b/.github/workflows/opam.yml index f5a8481d..9cf99a56 100644 --- a/.github/workflows/opam.yml +++ b/.github/workflows/opam.yml @@ -26,6 +26,5 @@ jobs: - run: opam install . --deps-only --with-test - run: opam exec -- dune build --profile release - run: opam exec -- dune install - - run: cd aslp_server && opam install . --deps-only - - run: cd aslp_server && opam exec -- dune build --profile release + - run: opam exec -- dune build aslp_server --profile release diff --git a/aslp_server/aslp_server.opam b/aslp_server/aslp_server.opam index e8c36ccd..6567ef38 100644 --- a/aslp_server/aslp_server.opam +++ b/aslp_server/aslp_server.opam @@ -1,20 +1,19 @@ # This file is generated by dune, edit dune-project instead opam-version: "2.0" -synopsis: "A short synopsis" -description: "A longer description" -maintainer: ["Maintainer Name"] -authors: ["Author Name"] -license: "LICENSE" -tags: ["topics" "to describe" "your" "project"] -homepage: "https://github.com/username/reponame" -doc: "https://url/to/documentation" -bug-reports: "https://github.com/username/reponame/issues" +synopsis: "REST server for ASLp" +description: "" +maintainer: ["ailrst"] +authors: ["ailrst"] +license: "BSD-3-Clause" +homepage: "https://github.com/UQ-PAC/aslp" +doc: "https://github.com/UQ-PAC/aslp" +bug-reports: "https://github.com/UQ-PAC/aslp/issues" depends: [ "ocaml" "dune" {>= "3.16"} "cohttp-lwt-unix" "yojson" - "asli" {= "0.2.0"} + "asli" "odoc" {with-doc} ] build: [ @@ -31,4 +30,4 @@ build: [ "@doc" {with-doc} ] ] -dev-repo: "git+https://github.com/username/reponame.git" +dev-repo: "git+https://github.com/UQ-PAC/aslp.git" From 3e5aca0afe58ce5aed959663c412e77acdfb297a Mon Sep 17 00:00:00 2001 From: Alistair Michael Date: Tue, 24 Sep 2024 16:19:17 +1000 Subject: [PATCH 07/10] update action --- .github/workflows/opam.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/opam.yml b/.github/workflows/opam.yml index 9cf99a56..672335d9 100644 --- a/.github/workflows/opam.yml +++ b/.github/workflows/opam.yml @@ -25,6 +25,5 @@ jobs: - run: opam install dune - run: opam install . --deps-only --with-test - run: opam exec -- dune build --profile release - - run: opam exec -- dune install - run: opam exec -- dune build aslp_server --profile release From 9222666a8c14906ace852d77bfaaf2ecd198fe4e Mon Sep 17 00:00:00 2001 From: Alistair Michael Date: Wed, 25 Sep 2024 14:39:00 +1000 Subject: [PATCH 08/10] update workflow --- .github/workflows/opam.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/opam.yml b/.github/workflows/opam.yml index 672335d9..3af5f0b9 100644 --- a/.github/workflows/opam.yml +++ b/.github/workflows/opam.yml @@ -25,5 +25,6 @@ jobs: - run: opam install dune - run: opam install . --deps-only --with-test - run: opam exec -- dune build --profile release + - run: opam install aslp_server --deps-only --with-test - run: opam exec -- dune build aslp_server --profile release From 9e25cfd81555f93869ab4df4b66dc2739dedaa45 Mon Sep 17 00:00:00 2001 From: rina Date: Mon, 16 Dec 2024 17:12:48 +1000 Subject: [PATCH 09/10] update workflow --- .github/workflows/opam.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/opam.yml b/.github/workflows/opam.yml index 3af5f0b9..40691964 100644 --- a/.github/workflows/opam.yml +++ b/.github/workflows/opam.yml @@ -19,12 +19,17 @@ jobs: steps: - uses: actions/checkout@v4 + - uses: ocaml/setup-ocaml@v2 with: ocaml-compiler: 4.14 - run: opam install dune + - run: opam install . --deps-only --with-test - run: opam exec -- dune build --profile release - - run: opam install aslp_server --deps-only --with-test + + - run: opam install . --deps-only --with-test + working-directory: aslp_server - run: opam exec -- dune build aslp_server --profile release + working-directory: aslp_server From 4c966892747aac0b51bdf44b3697e5566306e55d Mon Sep 17 00:00:00 2001 From: rina Date: Mon, 16 Dec 2024 17:56:16 +1000 Subject: [PATCH 10/10] fix ci for aslp_server. however... the parent aslp repository seems to be aware of the child project when executing `dune install`. this leads to problems like $ dune install Error: The following .install are missing: - _build/default/aslp_server/aslp_server.install Hint: try running 'dune build [-p ] @install' running the suggested `dune build -p aslp_server @install` will fail because asli is not installed yet. so you have to dune build dune install -p asli dune build -p aslp_server @install dune install -p aslp_server which is a bit uncomfortable --- .github/workflows/opam.yml | 2 +- aslp_server/aslp_server.opam | 2 +- aslp_server/bin/dune | 1 + aslp_server/dune-project | 2 +- aslp_server/dune-workspace | 0 5 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 aslp_server/dune-workspace diff --git a/.github/workflows/opam.yml b/.github/workflows/opam.yml index 40691964..8e0131ec 100644 --- a/.github/workflows/opam.yml +++ b/.github/workflows/opam.yml @@ -30,6 +30,6 @@ jobs: - run: opam install . --deps-only --with-test working-directory: aslp_server - - run: opam exec -- dune build aslp_server --profile release + - run: opam exec -- dune build --profile release working-directory: aslp_server diff --git a/aslp_server/aslp_server.opam b/aslp_server/aslp_server.opam index 6567ef38..68be2ccd 100644 --- a/aslp_server/aslp_server.opam +++ b/aslp_server/aslp_server.opam @@ -10,7 +10,7 @@ doc: "https://github.com/UQ-PAC/aslp" bug-reports: "https://github.com/UQ-PAC/aslp/issues" depends: [ "ocaml" - "dune" {>= "3.16"} + "dune" {>= "2.8"} "cohttp-lwt-unix" "yojson" "asli" diff --git a/aslp_server/bin/dune b/aslp_server/bin/dune index 4bf7d5df..3c9353cc 100644 --- a/aslp_server/bin/dune +++ b/aslp_server/bin/dune @@ -1,5 +1,6 @@ (executable (public_name aslp_server) + (modes exe byte) (name main) (modules main) (libraries asli.libASL lwt.unix yojson cohttp-lwt cohttp-lwt-unix pprint)) diff --git a/aslp_server/dune-project b/aslp_server/dune-project index e106a40a..8c9f37ab 100644 --- a/aslp_server/dune-project +++ b/aslp_server/dune-project @@ -1,4 +1,4 @@ -(lang dune 3.16) +(lang dune 2.8) (name aslp_server) diff --git a/aslp_server/dune-workspace b/aslp_server/dune-workspace new file mode 100644 index 00000000..e69de29b