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

Codify support for scopes/namespaces in package identifers #5974

Open
shonfeder opened this issue May 26, 2024 · 0 comments
Open

Codify support for scopes/namespaces in package identifers #5974

shonfeder opened this issue May 26, 2024 · 0 comments

Comments

@shonfeder
Copy link
Contributor

This issue is to record a feature request which seems to come up on forums from time to time, and which we've recently had reason to consider in the opam maintainer meeting, but which does not yet seem to have made its way into an issue in this repo.

tl;dr

The opam repository has a gradually expanding set of hoc rules based on --delimited name prefixes. In effect we seem to be imposing a scoping scheme on package identifiers, and opam (and the repository) may benefit from adding explicit support for this functionality.

Symptoms of a problem

We have been using ad hoc means of imposing additional structure and discipline on package naming. E.g.,:

  1. To address namesquating or misleading names, we have added an excessively strict) name collision linting step, and otherwise rely on ad hoc judgement calls from opam repo maintainers. A scoping system could help address this, by following the example of package repositories that support "scopes" or "namespaces" for package identifiers (i.e., npm), that allow packages to be grouped by the individuals or organizations authoring and maintaining them.

  2. Due to historical conventions, the prefix ocaml- has a special, restricted use in the opam repository.

  3. Follow the example of conf-, restricted prefixes are being introduced to communicate the function of certain classes of packaged. Following Update ocaml-base-compiler, ocaml-system and ocaml-variants 4.13.0+ with support for native Windows opam-repository#25861, we will be adding three new restricted prefixes, supported by new CI logic Add linting check for new restricted prefixes ocurrent/opam-repo-ci#315

The underlying problem seems to be that package identifiers are atomic, but we actually need them to support a richer structure. We have been hacking this in by convention, but dedicated support for a richer structure may address these (and future) needs in a systematic way.

Prior discussion

This general idea has been discussed before, in at least the following places:

Related issues

Scopes/namespaces in other packaging systems

I'm not aware of others, but I will expand this list if we find some.

Proposed way forward

No particular solution is proposed here (in particular no concrete syntax or extensions to the CLI or internal data structures). I suggest we use this issue to gather input, and to record a more systematic account of the needs motivating the prior discussions and our emergent practice.

cc @raphael-proust and @kit-ty-kate

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

No branches or pull requests

1 participant