-
Notifications
You must be signed in to change notification settings - Fork 414
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
Don't bundle ppx_inline_test tests in release mode #897
Comments
@diml what do you think of just hard coding Later on, we could improve the ENV stanza to perhaps control this feature. |
No more hard-coding please, however we can add support for release flags in ppx rewriters. For instance we could write this in the dune file of (library
...
(kind (ppx_rewriter (release_flags (-inline-test-drop)))) |
Okay, but I would suggest a syntax that is more consistent with how we handle env:
|
BTW, we were talking about this with @avsm the other day. Another way to sort this out would be to use variants and have a |
That seems alright as well. Although it would also create a lot of installed bloat if we're now including a variant for every single library with tests. Why doesn't the approach work with a functor btw? |
Let's say BTW, instead of specifying multiple flags, we could also just pass the build profile:
|
I ran into this issue when I used https://github.com/janestreet/ppx_inline_test and wanting to compile with a custom runtime, noticing that ppx_inline_test actually carries along some dependencies that require more Unix symbols than we have on MirageOS:
is the feature mentioned above on the roadmap of dune? would be great to have inline tests and being able to run on MirageOS! :) |
To keep things simple, let's pass the profile via a cookie, just as we do for the library name. Then we can simply change ppx_inline_test to inspect this cookie. |
Actually we should only pass it if a ppx requests it, to avoid extra rebuilds when not needed. I'm creating a ticket to describe the feature. |
I submitted a concrete proposal in #2020. |
Cases already covered up by external tests. Allows us to get rid of a runtime dep, see ocaml/dune#897
Now that > 1.5 years passed, and some work references this issue or 2020, I wonder whether it is possible to have inline tests which do not lead to runtime-dependencies in release mode? |
The last bit to make this work, i.e. respecting Dune's setting in ppx_inline_test hasn't been done. I just wrote a patch for it: janestreet/ppx_inline_test#21 It's currently being reviewed in Jane Street internal repo. Once it's merged, I'll backport it to the last release of ppx_inline_test. |
thanks jeremie :) |
does this mean that e.g. |
Nope, Incidentally, we were talking last week with @NathanReb about forking |
New release of ppx_inline_test submitted: ocaml/opam-repository#15933 At this point there is nothing more to do on the Dune side, so I'm closing this ticket. |
@diml my intuition is that since ppx_inline_test v0.13.1, a My experience, as stated in ocaml/opam-repository#16097 (comment) is different. Am I missing anything? Did you check a complete example that the dependencies are avoided? |
Not exactly, it makes sure the tests themselves are not part of the final executable but the code still needs to be preprocessed and there is currently no mechanism to avoid the runtime dependencies. Note that the code still needs to be preprocessed because if we leave the Our plan with @NathanReb is to first add a new syntax in [@@@test
...
] For instance: [@@@test
let some_helper = ...
let%expect_test = ...
] Then we will need a new feature in dune to have testing ppx rewriters be conditionally applied. |
These tests can introduce extra dependencies and bloat release binaries.
Don't build them when installing from OPAM.
See janestreet/ppx_inline_test#13 (comment)
The text was updated successfully, but these errors were encountered: