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

depexts for test-only dependencies #4024

Open
avsm opened this issue Nov 5, 2019 · 3 comments
Open

depexts for test-only dependencies #4024

avsm opened this issue Nov 5, 2019 · 3 comments

Comments

@avsm
Copy link
Member

avsm commented Nov 5, 2019

I'm trying to add a depext that is only installed for a test installation in opam for ctypes:

depexts: [
  ["libffi-dev"] {os-distribution = "alpine"}
  ["fts-dev"] {os-distribution = "alpine" & with-test}

unfortunately, this doesn't work with opam list --external --with-test ctypes-foreign, and fts-dev is never installed. Is there some other way to get test-only depexts?

This is distinct from opam depext -t which installs the "mainline" depexts for dependent libraries required for a test suite. In this case, I only want to install libfts-dev to run the ctypes-foreign test suite, and not install it if the test suite isnt built.

@rjbou
Copy link
Collaborator

rjbou commented Nov 5, 2019

The option is only available as a package selector. Concerning the filter variable, it is not defined in the scope of depexts: field (cf. https://opam.ocaml.org/doc/Manual.html#Package-variables).
Maybe worth add it, plus with the incoming depext integration...
cc @AltGr

@avsm
Copy link
Member Author

avsm commented Nov 5, 2019

Thanks for the clarification; I'll add a conf-fts {with-test} package dependency to handle it for now, but it would be useful to have the filter variable in the upcoming integration indeed :-)

@AltGr
Copy link
Member

AltGr commented May 27, 2020

In fact that would possibly add quite a lot of complexity, because with-* filters are resolved much later, at solver call time (they depend on the package and the command-line) ; and at the moment all depexts are computed (and used) at switch load time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants