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

Using ppx_expect when there is no libc #15

Open
emillon opened this issue Jul 18, 2019 · 3 comments
Open

Using ppx_expect when there is no libc #15

emillon opened this issue Jul 18, 2019 · 3 comments
Labels
forwarded-to-js-devs This report has been forwarded to Jane Street's internal review system.

Comments

@emillon
Copy link

emillon commented Jul 18, 2019

Hello,

This is a bit of an open question - sorry for the large scope.

I'm trying to build a library that has expect tests as part of a mirage unikernel.
I'm not interested in running the tests (just stripping the test nodes would work), but at the moment it's preventing compilation because ppx_expect has some C stubs that refer to some functions that are not available in mirage, like dup or dup2.

How do you think we could support this use case?

Thanks!

emillon added a commit to mirage/fiat that referenced this issue Jul 23, 2019
ppx_expect is in theory usable in Mirage since it strips the code in the released binaries; but for now it causes some cross-compilation issues because of C stubs that rely on POSIX APIs. So for now let's do without it!

See janestreet/ppx_expect#15
@hannesm
Copy link

hannesm commented Jul 23, 2019

I think this is related to the discussion in ocaml/dune#897, but please correct me if I'm wrong.

@github-iron github-iron added the forwarded-to-js-devs This report has been forwarded to Jane Street's internal review system. label May 25, 2020
@ghost
Copy link

ghost commented Jun 2, 2020

Whoops, completely missed this issue. We are now monitoring github issues with our internal review tool, so we should follow up more promptly in the future.

So thinking again about this, as long as you are happy to keep an opam dependency on ppx_expect even when tests are disabled, there is a pretty simple change we could do in dune to avoid the runtime dependency. If you also want to avoid the opam dependency, it is a bit more work.

@emillon
Copy link
Author

emillon commented Jun 3, 2020

It's great to see that a solution is possible. In the context of Mirage and opam metadata, I think that depending on ppx_expect in release mode is a bit heavy since it brings base. But if this can be made a test-dependency it's probably OK. This would also solve coinstallability problems, for cases where two libraries depend on incompatible versions of base just for tests.

It seems OK to wait for the solution described in ocaml/dune#897 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
forwarded-to-js-devs This report has been forwarded to Jane Street's internal review system.
Projects
None yet
Development

No branches or pull requests

3 participants