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

Generated JSON data does not contain any link to the sources of the packages. #804

Closed
Zimmi48 opened this issue Jun 21, 2019 · 10 comments · Fixed by #906
Closed

Generated JSON data does not contain any link to the sources of the packages. #804

Zimmi48 opened this issue Jun 21, 2019 · 10 comments · Fixed by #906

Comments

@Zimmi48
Copy link
Member

Zimmi48 commented Jun 21, 2019

This is quite unfortunate as it does not allow to solve the issue that was raised in this thread: https://coq.discourse.group/t/coqhammer-1-1-1-for-coq-8-9/327.

The CoqGym (@yangky11) people crawled the Coq package index to get the URLs of packages.
Now they could obtain exactly the same results by doing cat coq-packages.json | jq '.[][1].versions[0].homepage', which is already an improvement.
However, it doesn't solve their bug which is to confuse the homepage of a package and the repository URL. It just happened that this confusion gave them correct results in most cases, but not for instance for math-classes and corn (as remarked by @spitters).

Would it be doable to add more meta-information to reflect, both the repository as declared in the opam meta-data, but also the URL of sources, which is defined there as well?

@ejgallego
Copy link
Member

Now that you mention the CoqGym use case, this is indeed an open problem in the upstream OCaml / OPAM world, you have the dune-universe repositories but a solution for a coherent view on the package world has still not been developed AFAICT. There are some issues lurking around tho.

@maximedenes
Copy link
Member

Would it be doable to add more meta-information to reflect, both the repository as declared in the opam meta-data, but also the URL of sources, which is defined there as well?

Yes, I plan to add all the necessary metadata. In fact, we may want to generate OPAM and Nix packages from the metadata at some point (so they should contain URLs to the source, build instructions, etc).

For now, the JSON data contains only what is needed by the web interface (I wanted to achieve separation between the website and the package index).

@spitters
Copy link
Contributor

Has there been any progress on this? I'm curious about CoqGym/coq_hammer.

@maximedenes
Copy link
Member

I personally won't have time to work on it before September, I'm afraid.

@spitters
Copy link
Contributor

@maximedenes It's September ;-)
It would be nice to provide Coq hammer with some better data.

@maximedenes
Copy link
Member

Working on it now.

@maximedenes
Copy link
Member

It seems that a few packages do not use the standard src attribute to point to their source. For example, paco uses http: https://github.com/coq/opam-coq-archive/blob/ba1715ee0406795a003de50b9abaa95ae5d91398/released/packages/coq-paco/coq-paco.4.0.0/opam#L34

I couldn't find a documentation of the allowed attributes, so I'm adding support only for src for now. I'd be happy to receive a documentation pointer, though. @Zimmi48 do you happen to know what's allowed in these files?

maximedenes added a commit to maximedenes/opam-coq-archive that referenced this issue Sep 19, 2019
Switched to OCaml 4.08 to use some convenient additions to OCaml's
stdlib.

Fixes coq#804
@palmskog
Copy link
Contributor

palmskog commented Sep 19, 2019

@maximedenes from the OPAM manual the allowed attributes are:

"One of src: <string> or archive: <string>, specifying the URL where the package can be downloaded from. When using HTTP or FTP, this should be an archive. The older alternative field names http:, local:, git:, hg: and darcs: are deprecated, prefer explicit URLs."

So basically http is allowed but deprecated.

@maximedenes
Copy link
Member

Ah, thanks a lot! I guess I'll support the two non-deprecated names. Will update my PR.

@Zimmi48
Copy link
Member Author

Zimmi48 commented Sep 19, 2019

We could also do a pass on the repository to fix all the deprecated fields...

maximedenes added a commit to maximedenes/opam-coq-archive that referenced this issue Sep 19, 2019
Switched to OCaml 4.08 to use some convenient additions to OCaml's
stdlib.

Fixes coq#804
maximedenes added a commit to maximedenes/opam-coq-archive that referenced this issue Sep 20, 2019
maximedenes added a commit to maximedenes/opam-coq-archive that referenced this issue Sep 20, 2019
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

Successfully merging a pull request may close this issue.

5 participants