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

source field required in Mason.toml for registration, misleading documentation #25063

Open
lucaferranti opened this issue May 16, 2024 · 4 comments

Comments

@lucaferranti
Copy link
Contributor

lucaferranti commented May 16, 2024

According to masonTomlFileCheck in masonPublish here, the Mason.toml file need to have a source field in order to be registered, otherwise it fails (example 1, example 2 ).

There is no mention of this in the documentation about Manifest file and in the documentation on publishing packages it is only mentioned in the second bullet list (manual steps), letting understand that if one uses mason publish this will be taken care of automatically (which is not the case).

A few solutions:

  • Mention in the first bullet list to add manually a source field pointing to the repository.
  • Let mason publish modify the Mason.toml to add the field if missing. Wouldnt work, would still need to commit the new manifest first.
  • (remove the requirement, but I guess it's there for a good reason, also I see no harm in the field being there)

and a few bonus points:

  • Mention the field in the documentation about Manifest.toml. While the field is strictly not compulsory unless one plans to publish on Mason, I think it would be good to mention there that it's good practice to have the field if you host your work in a repository, and it's needed if one wants to publish in mason
  • Initialize the field when running mason new this would require to ask for the user github account.
@benharsh
Copy link
Member

Thanks for this report! We're planning on going over and updating mason documentation in the near-ish future, and we'll make sure to address this case.

@lucaferranti
Copy link
Contributor Author

it is only mentioned in the second bullet list (manual steps), letting understand that if one uses mason publish this will be taken care of automatically (which is not the case).

Actually that mention refers to X.Y.Z.toml, so as far as I can tell source being required in the Mason.toml itself is not mentioned.

What was the idea behind that requirement? It can be a nice-to-have info, but I am not sure if it's strictly needed for anything. Does mason rely on it?

@benharsh
Copy link
Member

What was the idea behind that requirement? It can be a nice-to-have info, but I am not sure if it's strictly needed for anything. Does mason rely on it?

I believe mason relies on the source field to know where the source code for the package is hosted when pulling dependencies.

@lucaferranti
Copy link
Contributor Author

I believe mason relies on the source field to know where the source code for the package is hosted when pulling dependencies.

but that applies to the X.Y.Z.toml file in the registry, no? Indeed, I think mason would see a dependency Mason.toml only after having pulled the dependency

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

No branches or pull requests

3 participants