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

should pin-depends imply depends ? #5795

Open
zapashcanon opened this issue Jan 22, 2024 · 3 comments · May be fixed by #6317
Open

should pin-depends imply depends ? #5795

zapashcanon opened this issue Jan 22, 2024 · 3 comments · May be fixed by #6317

Comments

@zapashcanon
Copy link
Contributor

Hi,

I realized that if I have the following owi.opam file:

depends: []
pin-depends: [
  [ "encoding.dev" "git+https://github.com/formalsec/encoding"]
]

Then, running opam install -y ./*.opam --deps-only --with-test would not install encoding.

But if I add it to the depends fields:

depends: [ "encoding" ]
pin-depends: [
  [ "encoding.dev" "git+https://github.com/formalsec/encoding"]
]

Then it would be properly installed with the same command.

I'm wondering if there is a reason why a package being present in pin-depends does not imply it is part of depends ?

Thanks!

@kit-ty-kate
Copy link
Member

I'm wondering if there is a reason why a package being present in pin-depends does not imply it is part of depends ?

one reason i can think of out of my head at the moment is: it could be a depopt (optional dependency) instead

@kit-ty-kate
Copy link
Member

TODO for us: we could add a lint check to warn users when a pin-depends is not listed in either depends or depopts

@zapashcanon
Copy link
Contributor Author

Oh indeed, that's a nice idea. In our case, it would have been enough to detect our mistake earlier. :)

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