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

spago registry search gives false positive result #1008

Open
edwardw opened this issue Sep 21, 2023 · 8 comments
Open

spago registry search gives false positive result #1008

edwardw opened this issue Sep 21, 2023 · 8 comments

Comments

@edwardw
Copy link

edwardw commented Sep 21, 2023

The package in question is iterable. The spago registry search iterable reports its existence in the package set, but actually adding the said package to the spago.yaml and building the project result in an error:

The following packages do not exist in your package set:
  - iterable

The spago version is the latest 0.93.9 and the spago.yaml is the minimum one after spago init. It also contradicts the result of its own spago ls packages command, which reports no such package.

@f-f
Copy link
Member

f-f commented Sep 21, 2023

spago registry search, as the name suggests, searches for a package in the Registry. Existence of a package in the registry does not guarantee inclusion in the package set.

spago ls packages instead will list all the packages in your current package set, which is only a subset of the packages in the Registry.

Are you able to point out if there's any bit of documentation that's confusing about this? We should make it clearer in the docs.

@f-f
Copy link
Member

f-f commented Sep 21, 2023

I think something that could help with this would be to enrich the results of spago registry search with a "latest package set" field

@edwardw
Copy link
Author

edwardw commented Sep 21, 2023

My confusion was probably stemmed from the help message of spago ls, which says spago ls packages should "List packages available in the local package set". It led me to think a "package set" is a local subset of remote packages, which is a "registry". The fact that other language package managers may work that way doesn't help I suppose.

I agree this is a documentation issue. Spelling out what registry and package set are in the document would be great! My current understanding is:

  • Registry: all (?) purescript packages
  • Package set: has version, a curated subset of registry. spago ls packages list the content of current package set.
  • spago ls deps: after spago install, they are the packages available locally

@f-f
Copy link
Member

f-f commented Sep 21, 2023

There already exists a section of the docs called "what's a package set?"

@edwardw
Copy link
Author

edwardw commented Sep 21, 2023

The document exists so I will close the ticket.

I'd argue that spago registry search has limited utility since one may or may not be able to add the result as a dependency. What I'd like to do is searching the package set actually.

@edwardw edwardw closed this as completed Sep 21, 2023
@f-f
Copy link
Member

f-f commented Sep 21, 2023

I'll reopen this - it sounds like we have quite a few areas that are ripe for improvement:

  • the command line help strings are not clear enough about what spago registry vs spago ls does
  • the documentation should give more info about the relationship between "package sets" and "the registry"
  • the output of spago registry search should include the latest package set that a package (and every package version) was found in - this will probably require some sort of database so we don't have to re-parse all the package sets all the time
  • the error message from spago install could be more actionable: sure, the package you wanted is not in the set, but maybe it can be found in the registry and it can be installed somehow?
  • ...which we should also allow. We could have a spago install --from-registry flag, that would add that Registry package to the extra_packages so that your local package set includes it

@f-f f-f reopened this Sep 21, 2023
@f-f
Copy link
Member

f-f commented Sep 21, 2023

I'd argue that spago registry search has limited utility

There is currently no other way of searching the totality of packages that are included in the Registry. In practice most of the folks will use package sets, but e.g. library authors are more likely to not do that, so it is useful to have some way of browsing the Registry

@thomashoneyman
Copy link
Member

I agree that it's still valuable to indicate the package exists in the registry but not in your local package set, because — as you noted, @f-f — there are many reasons a package could be missing from the set you're using and it doesn't mean that the package is inaccessible to you. You could very well install it by adding it to your extra_packages. It would be nice to remind users that they aren't restricted only to packages / versions in their chosen package set.

@f-f f-f added this to the spago-next alpha bugs milestone Nov 13, 2023
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

3 participants