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

usability: Parsing binary information from names on golang.org/dl is difficult #20892

Closed
kevinburke opened this issue Jul 3, 2017 · 10 comments
Closed
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@kevinburke
Copy link
Contributor

kevinburke commented Jul 3, 2017

From the Gophers Slack channel, someone is attempting to parse the filenames here: https://storage.googleapis.com/golang into their component parts.

Examples:

  • go1.3.darwin-386-osx10.6.tar.gz
  • go1.3.3.windows-amd64.zip
  • go1.3beta1.darwin-386-osx10.6.pkg
  • go1.3rc1.freebsd-amd64.tar.gz

Parsing these is a little less than trivial:

  • The version string may have one or two periods, and may include the words "beta" or "rc"

  • The machine may have two parts ("freebsd-386") or three ("darwin-amd64-osx10.8").

  • Multiple different possible endings - pkg, tar.gz, msi, zip.

It might be good to write a canonical version-string parser, or point people to an easier-to-parse information source, if one exists.

@OneOfOne
Copy link
Contributor

OneOfOne commented Jul 3, 2017

When all else fails, regexp will save us all, mark my words!

https://play.golang.org/p/krFqYD5HUy

@bradfitz
Copy link
Contributor

bradfitz commented Jul 3, 2017

Is this about getting JSON out of golang.org/x/tools/godoc/dl/dl.go?

@kevinburke
Copy link
Contributor Author

I'm not sure - @weingart was the initial requester.

@bradfitz bradfitz added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Jul 3, 2017
@bradfitz bradfitz added this to the Unreleased milestone Jul 3, 2017
@gopherbot
Copy link

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

@josharian
Copy link
Contributor

This seems rather relevant to the one-line install discussion. Re-opening to give @spf13 a chance to weigh in.

@josharian josharian reopened this Aug 3, 2017
@josharian
Copy link
Contributor

Thanks, @gopherbot, but I want this open.

@josharian josharian reopened this Aug 3, 2017
@bradfitz
Copy link
Contributor

bradfitz commented Aug 3, 2017

Hmm, @gopherbot shouldn't be fighting you. Most of the gopherbot tasks try hard to not re-do actions if it looks like somebody did the opposite. Maybe that task has a bug?

@bradfitz bradfitz removed the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Aug 3, 2017
@weingart
Copy link

Didn't realize that I was paged here. I was attempting to write a fairly simple download/install thing that could be used to "track" stable/beta/rc style candidates. While working on this, I also noticed that a new binary with a name/key of "getgo/installer_*" appeared... however, at the time I checked, the source for this was not available (looks to be part of a private github repo). I was optimistic that it would do what I wished... however, even the "dry_run" feature ended up splatting things all over my home directory/etc.

Documenting the filename format, possibly renaming a few of the files to be more consistent, or even publishing a go package that parses the filename format or gives you a way to list based on some parameters and get the URL for a download, would be awesome.

@weingart
Copy link

There's likely easier ways to do this, but this is what I ended up with, which seems sub-optimal. Various regexes may improve the verbosity and/or readability. I've not explored that direction much yet.

https://gist.github.com/weingart/7567dcee16796e7242356f3547a7d5b5

@agnivade
Copy link
Contributor

@weingart - We have https://golang.org/dl/?mode=json which returns json that you can parse. On top of it, this CL adds support for returning Archive and Unstable downloads too.

I guess that should suffice your requirements. Please let us know if you need anything else.

@agnivade agnivade added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Mar 15, 2019
@golang golang locked and limited conversation to collaborators Apr 14, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

7 participants