Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port the ppx from omp to ppxlib #327

Merged
merged 20 commits into from
Feb 4, 2021
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
12 changes: 0 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,6 @@ scripts:
- |
OCAMLC=`ocamlc -version`
case ${OCAMLC:0:6} in
"4.02.3") OCAMLFORMAT_BINARY=YES;;
"4.03.0") OCAMLFORMAT_BINARY=YES;;
"4.04.2") OCAMLFORMAT_BINARY=YES;;
"4.05.0") OCAMLFORMAT_BINARY=YES;;
"4.12.0") OCAMLFORMAT_BINARY=YES;;
Expand Down Expand Up @@ -121,8 +119,6 @@ scripts:
- make build
- |
case `ocamlc -version` in
"4.02.3") TEST_ALIAS=@compatible;;
"4.03.0") TEST_ALIAS=@compatible;;
"4.04.2") TEST_ALIAS=@compatible;;
"4.05.0") TEST_ALIAS=@compatible;;
"4.06.1") TEST_ALIAS=@compatible;;
Expand Down Expand Up @@ -197,12 +193,6 @@ matrix:
- <<: *opam
os: linux
env: COMPILER=4.04.2
- <<: *opam
os: linux
env: COMPILER=4.03.0
- <<: *opam
os: linux
env: COMPILER=4.02.3

allow_failures:
- env: COMPILER=ocaml-variants.4.12.0+trunk REPOSITORIES=--repositories=default,beta=git+https://github.com/ocaml/ocaml-beta-repository.git
Expand All @@ -212,8 +202,6 @@ matrix:
- env: COMPILER=4.07.1 USAGE_TEST=YES
- env: COMPILER=4.06.1
- env: COMPILER=4.05.0
- env: COMPILER=4.04.2
- env: COMPILER=4.03.0

fast_finish: true

Expand Down
3 changes: 1 addition & 2 deletions binaries.esy.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
"ocaml": ">= 4.2.0",
"@opam/cmdliner": "^1.0.0",
"@opam/dune": "^2.7.0",
"@opam/ocaml-migrate-parsetree": "^1.7.0",
"@opam/ppx_tools_versioned": "^5.4.0"
"@opam/ppxlib": ">= 0.21.0"
},
"esy": {
"build": "dune build -p bisect_ppx",
Expand Down
12 changes: 2 additions & 10 deletions bisect_ppx.opam
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,9 @@ depends: [
"cmdliner" {>= "1.0.0"}
"dune" {>= "2.7.0"}
"ocaml" {>= "4.02.0"}
"ocaml-migrate-parsetree" {>= "1.7.0" & < "2.0.0"}
"ppx_tools_versioned" {>= "5.4.0"}
"ppxlib" {>= "0.21.0"}

"ocamlformat" {with-test & = "git.1bf68a7"}
]

pin-depends: [
# This is the last commit before ocamlformat's ppxlib conversion. A newer
# commit, or no pin at all, can be used once Bisect_ppx is also converted to
# ppxlib.
["ocamlformat.git.1bf68a7" "git+https://github.com/ocaml-ppx/ocamlformat.git#1bf68a70f1480df80a8ab0bd20a799b8e1df0081"]
"ocamlformat" {with-test & = "0.16.0"}
]

build: [
Expand Down
2 changes: 1 addition & 1 deletion src/ppx/bucklescript/dune
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
(executable
(name ppx)
(libraries bisect_ppx ocaml-migrate-parsetree))
(libraries bisect_ppx ppxlib))
11 changes: 2 additions & 9 deletions src/ppx/bucklescript/ppx.ml
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
let () =
let argc = Array.length Sys.argv in
let argv =
let output_file = Sys.argv.(argc - 1) in
Array.(append
(sub Sys.argv 0 (argc - 1))
[|"-o"; output_file; "--dump-ast"; "--conditional"|])
in
let _ = Bisect_ppx.Register.conditional := true

Migrate_parsetree.Driver.run_main ~argv ()
let () = Ppxlib.Driver.run_as_ppx_rewriter ()
5 changes: 3 additions & 2 deletions src/ppx/dune
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
(instrumentation.backend (ppx bisect_ppx))
(synopsis "Code coverage for OCaml")
(ppx_runtime_libraries bisect_ppx.runtime)
(preprocess (pps ppx_tools_versioned.metaquot_411))
(libraries bisect_ppx.common ocaml-migrate-parsetree ppx_tools_versioned str))
(preprocess (pps ppxlib.metaquot))
(flags (:standard -open Ocaml_shadow))
(libraries bisect_ppx.common ppxlib str))
Loading