-
-
Notifications
You must be signed in to change notification settings - Fork 60
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
--conditional meaning and documentation (remove --conditional from README) #329
Comments
What code are you reading? bisect_ppx/src/ppx/register.ml Lines 11 to 22 in a4b8cb6
In this code, when |
I did mention I'm a noob. ;) I misread '!' as the negation operator rather than the defer operator. Sorry about that. In any case, is the following accurate? By default, bisect_ppx is disabled, which means it runs the identity transform. To enable it, you must do the following at runtime: a) pass If it is accurate, I suggest adding something like it to the readme for the benefit of us newbies. The "at runtime" bit is important - I tried to pass the flag to the compiler at first. Thanks, G |
There is indeed a problem with that part of the README, but the issue is that it is recommending an obsolete way of triggering Bisect_ppx (using It might help to see either...
Almost. By default, if you supply
It is fairly accurate, but, I will make this into an issue about updating the Markup.ml example to match the current Dune instructions, rather than clarify the use of the older Thanks for pointing out this pretty major inconsistency in the README :) |
(...or if we merge the newest Dune integration first, I'll just replace both parts of the README with the latest instructions.) |
On Sat, Sep 26, 2020 at 9:15 AM Anton Bachin ***@***.***> wrote:
Almost. By default, if you supply (preprocess (pps bisect_ppx)) at all,
Bisect_ppx is *enabled*.
This is something Dune does, correct? I'm not using Dune, I'm writing
Bazel build rules, which is why I need detailed knowledge of how ppx stuff
works.
Thanks,
G
… |
I can immediately add the detail that the flag is added to the command line of the PPX rewriter (the Bisect_ppx binary run at build time, often also includes any other PPXs used by the project). The environment variable is also checked at build time by that same binary when it runs. But if you are writing rules for another build system, and it allows you to simply not run the PPX rewriter unless coverage is requested, do that instead. All these flags and environment variables are due to limitations of previous versions of Dune, which would run the rewriter unconditionally, so we had to make the rewriter itself check conditions. |
The code in The older way was for Bisect_ppx, and each other PPX, to build its own PPX binary, and all these binaries would be triggered one after another by the compiler. I think in that case you would have passed the option as part of the Bisect_ppx still builds a modified standalone binary for Bucklescript users in If you want to see what Dune is doing, you can take a Dune project that uses Bisect_ppx and run |
The readme says
Because of the --conditional flag, preprocessing is enabled only when BISECT_ENABLE=yes is set in the environment, so it is off by default.
I can't parse that. Reading the code, it looks to me like it's just wrong. BISECT_ENABLE=YES enables; so does --conditional. It looks like --conditional should be --enable, and either it or the env can be used to enable.
Am I misreading the code? Could be, I'm pretty new to OCaml.
Thanks,
Gregg
The text was updated successfully, but these errors were encountered: