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

validate package with multiple top level module names on publish #3834

Open
Guria opened this issue Nov 15, 2024 · 3 comments · May be fixed by #3838
Open

validate package with multiple top level module names on publish #3834

Guria opened this issue Nov 15, 2024 · 3 comments · May be fixed by #3838
Labels
good first issue Good for newcomers help wanted Contributions encouraged priority:medium

Comments

@Guria
Copy link

Guria commented Nov 15, 2024

Problem

Since package names don't necessarily match module names, library authors can inadvertently pollute global module names. This is especially problematic as it's easy to introduce multiple top-level modules in a single library.

Given that we have a single namespace for all dependencies, unresolvable transitive conflicts can arise for package consumers.

Suggested Solution

Restrict packages from publishing more than one top-level module name unless explicitly defined in gleam.toml to indicate the library author's intent for potential valid use cases.

The CLI can optionally offer automatic gleam.toml updates. For stricter enforcement, we could require manual updates.

Related discussion:
https://discord.com/channels/768594524158427167/1281967484731265044/1281967484731265044

@lpil
Copy link
Member

lpil commented Nov 16, 2024

Thank you. Lets have it ask for confirmation as to whether it is correct when there's multiple top level names.

@lpil lpil added help wanted Contributions encouraged good first issue Good for newcomers priority:medium labels Nov 16, 2024
@Guria
Copy link
Author

Guria commented Nov 16, 2024

@lpil we still need way to bybass this confirmation for publishing from CI environment

We have 2 options:

  • explicitly define list of top level module names in gleam.toml
  • have a cli argument like --confirm-multiple-namespaces

@Guria
Copy link
Author

Guria commented Nov 16, 2024

I see there is --yes option that confirms bunch of warnings. But I am just not sure it is ok to use it since it will not catch an explicit conset for ones who already set up automate publish.

Would like to hear your thoughts on it

@Guria Guria linked a pull request Nov 16, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Contributions encouraged priority:medium
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants