-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
discourage depext
outside conf-*
packages
#5791
Comments
That was the initial idea about |
What about putting a flag in the |
Restricting I don't think there's a need for a new flag, though, or for rules about package names. A diagnostic (from |
I'm definitely all for this 👍 :) |
@yallop I find your proposal a bit unsatisfying on a semantics level (there is nothing really logical about linking @dsheets are there reason to suspect that not factoring all The |
I don't like solutions based on names because suddenly names gain semantics when they should be opaque. I favor opting into this constraint because it is currently the case that you can easily write some bindings or other system-dependent code and throw |
@dsheets the point of "opam lint" is to change the path of least resistance to steer towards people good packaging practice. I know that it is convenient for peole today to throw depexts in a package, but then it creates lots of problems down the road. My proposal is precisely to make this bad habit inconvenient by having Q/A tools complain about it, making users prefer other options. I'm all for minimizing the cost on existing package bases, but I do not believe that disabling this check for future package submissions is in the interest of any non-central repository, whether they care or not. I would thus rather be in favor of not letting people opt out for the indefinite future. I would think about it this way: if OPAM was not released yet and we were discussing the semantics of the |
@gasche Yes, I would argue in favor of letting people opt out of the restriction just as I am in favor of having optional warnings in the OCaml compiler. There should be only a single type of package definition and it currently makes sense (but isn't a particularly good idea) for a package to have both How would you implement the warning? In |
Names are important for users. Deciding that depexts should only be stored in packages named conf-* is both easy to understand by them and easy to enforce by opam-lint. The dedicated header solution does not make sense, since Note that a standard behavior to come is to look for the package with the depexts for the library you need. Only the conf-* solution provides an easy way to achieve this task. |
|
Although the two obviously interfere, I like to keep the rules required by opam and repository convention separate when possible. Then, the repository convention would impose that Note that ¹ if it doesn't seem so it's because the tools aren't on the same version of the opam lib |
Just as a little stat the current number of packages that still have depexts in one of their versions in the current state of the repository is the following:
|
I think that any enforcement of depext requires better integration with the solver to account for the finer grained constraints needed (e.g. by OS version). The relevant opam issue is ocaml/opam#2919 Until then, I can't see much progressing here in the opam-repo and don't see much point shuffling depexts around into packages until the broader feature is designed and implemented in opam2. I propose closing this issue and shifting the discussion to how best to solve it using the opam2 feature set instead. |
The value of shuffling depexts around is that it allows to share a set of depexts across several packages (that depend on the same system dependency) or several versions of the same package (otherwise maintainers would only update depexts on recent versions, leaving users of, say, older OCaml versions in the dark). Does this not already make sense within the current opam language and feature set? |
I think that as @gasche mentions there's no harm for packages to gradually move to However I don't think its worth keeping this issue open and discussion should indeed occur in ocaml/opam#2919 so I'm closing this. |
Hi,
Thinking about #5766 and #5783, it seems to me that it was a mistake to sprinkle
depext
dependencies in packages in the first place. Every replacement of adepext
by a dependency on aconf-*
package is a win, because it refers to a single point of definition for a given logical notion (system dependency on X), that can be updated to support other systems (instead of having to update each field using the depext(s)).Are there cases where having a
depext
in a package is appropriate, and moving that to aconf-*
package would be the wrong thing?If there is not, I think we could consider doing the following to improve the quality of repositories:
opam lint
to complain aboutdepext
field in packages whose name does not matchconf-*
.external
field (default:false
), and only acceptdepext
in packages withexternal: true
.The text was updated successfully, but these errors were encountered: