-
-
Notifications
You must be signed in to change notification settings - Fork 59
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
Problem using with Esy/Reason/Dune #187
Problem using with Esy/Reason/Dune #187
Comments
The immediate problem of --- a/package.json
+++ b/package.json
@@ -11,7 +11,7 @@
},
"scripts": {
"test": "esy x RunTests.exe",
- "coverage": "esy bisect-ppx-report -I '#{self.target_dir}/default/' -html coverage/ bisect0001.out -verbose"
+ "coverage": "esy bisect-ppx-report -I '#{self.target_dir}/default/' -html coverage/ bisect0001.out -ignore-missing-files -verbose"
},
"dependencies": {
"@opam/dune": "*", However, this results in an empty coverage report, and the two problems are probably connected. Looking further... |
So far, this isn't an esy problem; I can reproduce it in a "pure-Dune" project. Still looking into whether it is Dune or Reason, my guess is the latter. A bit busy, but hope to have an answer to this soon. |
This is what seems to be happening:
Bisect_ppx uses I think Bisect_ppx has to use It seems that the solution should be to have OMP set However, with the way Dune calls @rgrinberg and/or @diml, what do you think should be done to address this? |
The original source file name is marshaled along the binary ast, so normally that shouldn't be an issue. I remember that we fixed something related to that in ppxlib, could you try adding ppxlib to the preprocess list to see if it fixes the issue? If yes, then we will need to apply the same change to omp. |
Adding ppxlib produces
which is better, as it seems that ppxlib sets |
The original filename is stored in the binary ast at the beginning. Could you inspect |
Yes, I'm aware, and it is |
Ok, and what about in the output of |
Actually, I missed a detail in your previous comment. When you say |
Yes, when linked as part of |
I wrote the PRs for omp and ppxlib, testing would be welcome :) |
I can confirm that the OMP change works, too. I didn't try the ppxlib change because Bisect_ppx doesn't depend on it (and I don't have a project handy that does). Thanks, @diml! |
I'm closing this issue in favor of asking people to track ocaml-ppx/ocaml-migrate-parsetree#66. This should be fixed by an OMP release. Thanks for the report! |
@diml I think I found a case where the omp change isn't working, far from a minimal example, but tough to repro otherwise https://github.com/facebookexperimental/reason-native/tree/benderson/play-with-bisect_ppx . Dune's copy_files wasn't working (separate problem, but kinda understandable) so I moved the file that was being copied directly into the library and am running into (I think) what @aantron hit earlier. (the minimal example I posted with this PR works now for me too). |
@bandersongit At first glance, this looks unrelated to Bisect_ppx. Would you mind trying to preprocess the files with any other PPX (e.g., |
@aantron Using ppx_let worked successfully, I also was able to use copy_files with ppx_let. |
Ok, since |
I can't really make sense of the console output. Does bisect_ppx accesses the original file at preprocessing time? |
BTW, just a thought: this pipeline (refmt --> ppx) is too complicated. We could simply statically link in the refmt parser in the ppx driver. That would simplify things. |
This disables the comment parser, which parses source files for old-style Bisect comments like (*BISECT-IGNORE*). See #187 (comment)
@bandersongit, @diml is correct that Bisect_ppx accesses the original source file during preprocessing. To fix that, try adding a resolution to the commit linked above this comment, and making this change: --- a/src/rely/dune
+++ b/src/rely/dune
@@ -1,7 +1,7 @@
(library
(name Rely)
(public_name rely.lib)
- (preprocess (pps bisect_ppx))
+ (preprocess (pps bisect_ppx -no-comment-parsing))
(libraries pastel.lib file-context-printer.lib unix junit re)
)
(copy_files# ../../shared-src/common/*) The reason for the source file access is that Bisect_ppx supports special comments like We'll probably drop comment support soon-ish. The I'll merge this into |
Ok. At least the filename seems to be correct in the error message, which makes me think that the omp change is doing what it is supposed to, so I'll merge the PR |
@aantron using the resolution to that commit and the -no-comment flag makes things work without needing to undo the copy_files stuff. I did have to use -ignore-missing-files because bisect-ppx-report was still having problems with missing files, but I could see that just being required. However with that flag I was able to generate a useful coverage report, which I am super stoked about! |
Great :) I'm going to work on a couple more issues slowly over the coming week or so, then release this in 1.4.1. Thanks @bandersongit, @ulrikstrid, and @diml! |
This is now released and installable from opam in Bisect_ppx 1.4.1. |
I haven't been able to get bisect_ppx working with my current setup (Dune/Esy/Reason). I've tried adopting the dune instructions from the advanced section of the docs and I am pretty sure after examination that
#{self.target_dir}/build
is what I want to pass to the -I flag, and I know that #132 is still open, however I don't think anything mentioned there should be relevant.Repo: https://github.com/bandersongit/rely-talk/tree/bisect_ppx-integration
The README.md on the bisect_ppx-integration branch has a fairly detailed description.
I'm really excited about being able to use bisect_ppx for a bunch of my projects and would love to get this working.
The text was updated successfully, but these errors were encountered: