-
-
Notifications
You must be signed in to change notification settings - Fork 66
Support ppxlib.0.36.0 #448
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
base: master
Are you sure you want to change the base?
Conversation
|
@patricoferris i believe this can be undrafted now |
|
Any news? |
|
@aantron ^^ |
|
I think this patch is causing #450. There's something fishy going on when instrumenting I'll look into it and push a fix! Once that's done I'm also happy to help getting a release in any way I can @aantron ! |
|
Opened a PR to @patricoferris' branch here: patricoferris#1 |
|
The test suite is broken at the moment so I tried to make the minimal set of changes required to make my new regression test work, for anybody willing to try it out, you can run just the one test with: to get a clean output that's not polluted by the other errors. I'd also be happy to contribute a refresh of the test suite and to help with the project maintenance. Don't hesitate to reach out if you're looking for a bit of help on that front! |
Signed-off-by: Nathan Rebours <nathan.rebours@ocamlpro.com>
Signed-off-by: Nathan Rebours <nathan.rebours@ocamlpro.com>
|
Pulled your changes in @NathanReb -- thanks ! |
|
I took a look at all the background today and I'm going to continue with reviewing the code in the coming days. |
|
Links for the future:
|
|
FYI: OCaml 5.4.0 was released yesterday |
|
The test suite presently works for dune build -p bisect_ppx
NO_COLOR=yes dune build -p bisect_ppx @runtest
File "test/instrument/control/function.t", line 1, characters 0-0:
/usr/bin/git --no-pager diff --no-index --color=always -u _build/default/test/instrument/control/function.t _build/default/test/instrument/control/function.t.corrected
diff --git a/_build/default/test/instrument/control/function.t b/_build/default/test/instrument/control/function.t.corrected
index bfb978d..a39693a 100644
--- a/_build/default/test/instrument/control/function.t
+++ b/_build/default/test/instrument/control/function.t.corrected
@@ -59,6 +59,7 @@ Or-pattern.
> EOF
let _ =
fun ___bisect_matched_value___ ->
+ ___bisect_visit___ 2;
match ___bisect_matched_value___ with
| None | Some _ ->
(match[@ocaml.warning "-4-8-9-11-26-27-28-33"]
File "test/instrument/control/newtype.t", line 1, characters 0-0:
/usr/bin/git --no-pager diff --no-index --color=always -u _build/default/test/instrument/control/newtype.t _build/default/test/instrument/control/newtype.t.corrected
diff --git a/_build/default/test/instrument/control/newtype.t b/_build/default/test/instrument/control/newtype.t.corrected
index 630a122..12927d2 100644
--- a/_build/default/test/instrument/control/newtype.t
+++ b/_build/default/test/instrument/control/newtype.t.corrected
@@ -28,6 +28,6 @@ Subexpression in tail position iff whole expression is in tail position.
let _ = fun (type _t) -> ___bisect_post_visit___ 0 (print_endline "foo")
let _ =
- fun () ->
+ fun () (type _t) ->
___bisect_visit___ 1;
- fun (type _t) -> print_endline "foo"
+ print_endline "foo"
File "test/instrument/pattern/exception.t", line 1, characters 0-0:
/usr/bin/git --no-pager diff --no-index --color=always -u _build/default/test/instrument/pattern/exception.t _build/default/test/instrument/pattern/exception.t.corrected
diff --git a/_build/default/test/instrument/pattern/exception.t b/_build/default/test/instrument/pattern/exception.t.corrected
index 5c660dc..e383838 100644
--- a/_build/default/test/instrument/pattern/exception.t
+++ b/_build/default/test/instrument/pattern/exception.t.corrected
@@ -38,10 +38,12 @@ patterns.
> | _ -> print_endline "baz"
> EOF
let _ =
- let ___bisect_case_0___ x () =
+ let ___bisect_case_0___ x =
+ fun [@ppxlib.migration.stop_taking] () ->
ignore x;
___bisect_post_visit___ 0 (print_endline "foo")
- and ___bisect_case_1___ y () =
+ and ___bisect_case_1___ y =
+ fun [@ppxlib.migration.stop_taking] () ->
ignore y;
___bisect_post_visit___ 1 (print_endline "bar")
in
File "test/instrument/recent/gadt.t", line 1, characters 0-0:
/usr/bin/git --no-pager diff --no-index --color=always -u _build/default/test/instrument/recent/gadt.t _build/default/test/instrument/recent/gadt.t.corrected
diff --git a/_build/default/test/instrument/recent/gadt.t b/_build/default/test/instrument/recent/gadt.t.corrected
index d65beb4..789f6d4 100644
--- a/_build/default/test/instrument/recent/gadt.t
+++ b/_build/default/test/instrument/recent/gadt.t.corrected
@@ -39,6 +39,7 @@ With function.
let f : type a. a t -> unit =
fun ___bisect_matched_value___ ->
+ ___bisect_visit___ 2;
match ___bisect_matched_value___ with
| A | B ->
(match[@ocaml.warning "-4-8-9-11-26-27-28-33"]
File "test/instrument/value.t", line 1, characters 0-0:
/usr/bin/git --no-pager diff --no-index --color=always -u _build/default/test/instrument/value.t _build/default/test/instrument/value.t.corrected
diff --git a/_build/default/test/instrument/value.t b/_build/default/test/instrument/value.t.corrected
index 2d9e0fa..58562b7 100644
--- a/_build/default/test/instrument/value.t
+++ b/_build/default/test/instrument/value.t.corrected
@@ -194,7 +194,11 @@ No instrumentation is inserted into expressions that are (syntactic) values.
let _ = (___bisect_post_visit___ 1 (f ()) :> [ `Foo | `Bar ])
- let _ = fun () -> (f () :> [ `Foo | `Bar ])
+ let _ =
+ fun () ->
+ (___bisect_visit___ 2;
+ f ()
+ :> [ `Foo | `Bar ])
$ bash test.sh <<'EOF'
make: *** [Makefile:13: test] Error 1 |
|
This difference diff --git a/_build/default/test/instrument/value.t b/_build/default/test/instrument/value.t.corrected
index 2d9e0fa..08f2932 100644
--- a/_build/default/test/instrument/value.t
+++ b/_build/default/test/instrument/value.t.corrected
@@ -194,7 +194,10 @@ No instrumentation is inserted into expressions that are (syntactic) values.
let _ = (___bisect_post_visit___ 1 (f ()) :> [ `Foo | `Bar ])
- let _ = fun () -> (f () :> [ `Foo | `Bar ])
+ let _ =
+ fun () ->
+ ___bisect_visit___ 2;
+ (f () :> [ `Foo | `Bar ])
$ bash test.sh <<'EOF'appears in the 4.14 and 5.0.0 run in |
Would be very glad to merge updates to the test suite, and help with project maintenance. What would you like to do? Do you need write access to the repo? |
|
Thanks @aantron. - let ___bisect_case_0___ x () =
+ let ___bisect_case_0___ x =
+ fun [@ppxlib.migration.stop_taking] () ->
ignore x;
___bisect_post_visit___ 0 (print_endline "foo")
- and ___bisect_case_1___ y () =
+ and ___bisect_case_1___ y =
+ fun [@ppxlib.migration.stop_taking] () ->
ignore y;
___bisect_post_visit___ 1 (print_endline "bar")
inthese failures are a known bug that is fixed upstream, see ocaml-ppx/ppxlib#604. The others look like some interaction with the new function layout in the parsetree (which I may have not implemented correctly). diff --git a/_build/default/test/instrument/control/newtype.t b/_build/default/test/instrument/control/newtype.t.corrected
index 630a122..12927d2 100644
--- a/_build/default/test/instrument/control/newtype.t
+++ b/_build/default/test/instrument/control/newtype.t.corrected
@@ -28,6 +28,6 @@ Subexpression in tail position iff whole expression is in tail position.
let _ = fun (type _t) -> ___bisect_post_visit___ 0 (print_endline "foo")
let _ =
- fun () ->
+ fun () (type _t) ->
___bisect_visit___ 1;
- fun (type _t) -> print_endline "foo"
+ print_endline "foo"This looks like we go all the way to the end of the functions params before inserting the bisect code. Before ppxlib.0.36 this would have been diff --git a/_build/default/test/instrument/control/function.t b/_build/default/test/instrument/control/function.t.corrected
index bfb978d..a39693a 100644
--- a/_build/default/test/instrument/control/function.t
+++ b/_build/default/test/instrument/control/function.t.corrected
@@ -59,6 +59,7 @@ Or-pattern.
> EOF
let _ =
fun ___bisect_matched_value___ ->
+ ___bisect_visit___ 2;
match ___bisect_matched_value___ with
| None | Some _ ->
(match[@ocaml.warning "-4-8-9-11-26-27-28-33"]This looks similar, the representation before would have been |
That looks like the wrong issue link but I was able to find ocaml-ppx/ppxlib#597 from your hint, thank you. Leaving this comment here so that we have a link to that issue for future reading :) |
|
Thanks @aantron for catching that! I have pushed a commit ebb3526 that fixes the control/function.t and control/newtype.t. The fix was to match more closely how the original instrumentation caught |
|
Thank you all for the work on this PR! In the meanwhile, I have found great value in using https://github.com/kit-ty-kate/opam-alpha-repository Thanks! @kit-ty-kate may I request that you add a new preview package for bisect_ppx which would include the latest fix for #450 this would allow continue the 5.4 testing while things settles. I am not completely sure it's possible to find a candidate version though (just in case this is possible to find such a revision to build from). Thank you! |
|
Apparently, the fix is not robust enough. It still does not work with the following example: [@@@warning "-37"]
type 'a bt = (int * 'a) list
type x
type ('a, 'b) t =
| B : 'a bt -> ('a, 'b) t
| C : ('a, 'b) t
| D : ('a, 'b) t
let _action (f : int -> 'a -> 'b -> 'b) (acc : 'b) : ('a, x) t -> 'b =
function
| C | D -> acc
| B l -> List.fold_left (fun acc (cs,x) -> f cs x acc) acc l
[@@@warning "+37"]Without coverage, it compiles, with bisect we get the following error: This is a reduced example taken from Frama-C. I can point out the actual file if it is useful. |
|
@AllanBlanchard thanks for the minimization, I confirm I can reproduce the error with it and am working on a fix! |
Signed-off-by: Nathan Rebours <nathan.rebours@ocamlpro.com>
Signed-off-by: Nathan Rebours <nathan.rebours@ocamlpro.com>
|
Just opened patricoferris#2 which should fix the error @AllanBlanchard ! |
|
@kit-ty-kate Very nice. I re-run a few CIs to pick up this new pkg and I can confirm this fixed the bisect_ppx related issues with 5.4 I had seen in these PRs. Continuing with the 5.4 transition here. Thanks a lot, and thank you too to maintainers and contributors for the work! |
|
@aantron what are the remaining blockers on this PR? |
|
Thanks @NathanReb! Merged into this branch. |
Tested today, we can compile and test Frama-C with this fix. There are a few micro-differences on some counters but it changes global coverage by less than 0.05%. Thanks a lot for that! |
|
Thanks everyone! I will review it in its current state shortly, and if there are |
|
Gentile ping |
|
For transparency for what's going on on my end, right now I am handing over Dream to a team of maintainers (https://discuss.ocaml.org/t/dream-looking-for-maintainers-to-take-ownership/17607). I hope to complete the main part of that within a week (but subject to it being the holiday season for most people, though not me). After that I will either have enough attention resources to personally work on all the rest of my projects, including Bisect_ppx, since all of them together need much less attention than Dream, or I will start handing them over, too, probably starting with Bisect_ppx as the next-most significant one after Dream for the OCaml community. Thanks for still having patience, which I ended up testing considerably, though not intentionally! |
|
Thanks for the update @aantron, I think the https://github.com/ocaml-ppx organisation could be a home for bisect_ppx (if you don't already have one in mind e.g. https://github.com/ocaml-community). Let me know if there's anything I can do on my end :) |
This is a draft PR bump to
bisect_ppxto the latest ppxlib.I think this is realistically going to need #445 and I'll need to look into some of the failing tests (some are formatting/pretty-printing related I think).