-
Notifications
You must be signed in to change notification settings - Fork 415
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
refactor(pkg): stop validating stuff we don't use #9030
refactor(pkg): stop validating stuff we don't use #9030
Conversation
As I suggested this to be added originally, I argued that it would make sense to make sure that what we add is an In fact, the git codepath is missing the validation logic and I would argue that it should probably also be implemented, for the same reasons. cc @gridbugs |
That's funny because I'm using the same reasons you are for arguing against this validation. I think the best way to avoid drift between our opam repositories and upstream is to be disciplined with how we interact with opam repos. In particular, we should assume as little as possible about the layout of the repo and let opam's client libraries take care of these details for us. That way, our task of making sure we never differ from upstream is simplified to just keeping our opam libray up to date. More concretely, here are some possible changes that opam is within its rights to make that would immediately create an incompatibility between our repos and opam's:
Now contrast this with how we handle package files themselves. We don't make any assumptions ourselves, and yet the API allows us to read only valid opam files exactly in the same way as opam would view them. I would like the repository layout to be abstracted away from us in the same way. |
Btw, I still left validation for stuff that we do rely on - like the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to also remove the mkrepo
function from test/blackbox-tests/test-cases/pkg/helpers.sh while you're at it?
0c3f64a
to
31d92f0
Compare
I didn't remove it, but I did simplify it to stop creating the unnecessary |
Maybe the question is to ask OPAM maintainers what they consider an OPAM repo to be? In particular, I assume that any repo change will be marked in a way so that it is detectable in some way that OPAM uses. As such, I would find it potentially dangerous to ignore the I am not sure we can rely on the OPAM libs to do the validation - e.g. in the case of the Git-backed |
We should ask them to go beyond that: encode those constraints in the code for their libraries.
These are important problems, but they should be solved by whoever is maintaining the opam libraries. In fact, I don't see how such a hypothetical upgrade can be done without considering how the client libraries could handle it.
Yes, that is exactly what they should do. They're already thinking about introducing a different storage layer for repos. It would be highly productive if they could abstract away all these details from us.
I don't see these interfaces as a bad thing, but rather as critical to guarantee there's never any misunderstanding between dune and opam about the layout of repositories. The loss of flexibility you're pointing is indeed regrettable, but it's completely solvable by a less assuming design of the client library. To re-iterate my point about validation in general:
Neither of those two categories is applicable to the checks removed in this PR. |
We don't use [repo] files for anything. So we should not care about their existence, format, or version. Signed-off-by: Rudi Grinberg <[email protected]> <!-- ps-id: 5c8b5541-d923-4e98-ad89-5e3e71db0837 -->
31d92f0
to
dff1dfd
Compare
We don't use [repo] files for anything. So we should not care about their
existence, format, or version.
Signed-off-by: Rudi Grinberg [email protected]