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

gimme awareness of available versions #110

Closed
philpennock opened this issue Aug 26, 2017 · 4 comments
Closed

gimme awareness of available versions #110

philpennock opened this issue Aug 26, 2017 · 4 comments
Assignees

Comments

@philpennock
Copy link
Contributor

At present, the gimme script knows very little about what versions of Go exist and are potentially available. There's testdata, which has that. At a layer above gimme, travis-ci/travis-build is doing some substitution work to make 1.9.x work, by knowing what .x should be at any given point in time.

People keep expecting this to be part of travis-ci/gimme itself, which is absolutely fair. It looks like gimme, it smells like gimme, they're filing bugs against gimme and it would be useful for gimme to handle this.

Should travis-ci/gimme handle this?

  1. No, keep things as they are
  2. Detect .x and error out with a diagnostic explicitly pointing towards something higher up, suggesting travis-build.
  3. Implement version tracking and caching as part of gimme itself, or perhaps just ability to spot in-repo data when run from a repo?
  4. Something else?
@meatballhat
Copy link
Contributor

I'm not sure how to interpret the 👍 reactions given 4 options 😁.

I would be OK with internal version availability awareness under certain conditions, and I think I would even be OK with the kind of rudimentary aliasing that's done at the travis-build level. Things that I would like to avoid:

  • 🚫 automatically downloading and writing stuff somewhere when:
    • responding to query-like commands such as gimme list
    • installing/activating a requested version
  • 🚫 supporting aliasing or version matching beyond .x style

@meatballhat meatballhat self-assigned this Jan 19, 2018
@philpennock
Copy link
Contributor Author

Note that a month before I filed this issue, I merged a contribution adding -k/--known to gimme, which does probe remotely. We have that already, it's not part of --list though. So this proposal somewhat skates around the edges of what you want to avoid, but I think this proposal fits into the design we have:

Idea sketch: gimme --known should cache to a file ~/.gimme/known.json (or plain text, one-per-line); by default, don't re-probe if the file is less than an hour old, to provide some build system caching. Add --force to always re-probe. Have --known use that file by preference if it exists, so we basically are making the existing command faster normally, at expense of not immediately getting the very latest versions of Go.

With this, we can say that if and only if the requested version contains .x then we'll do an implicit gimme --known. So we do automatically download a list (if needed) when installing a requested version, but only if asked for .x, not otherwise. And since gimme is inherently all about downloading and caching Go versions, so any install command can potentially download data, this does not seem to me to add unnecessary network access. The list is going to be a few KB at most, whereas the Go version to be downloaded will be around 100MB.

@AlekSi
Copy link
Contributor

AlekSi commented Jan 23, 2018

I'm not sure how to interpret the 👍 reactions given 4 options.

I think as "yes, we agree that is a problem worth discussing".

@AlekSi
Copy link
Contributor

AlekSi commented Jan 23, 2018

See also travis-ci/travis-build#1295. Now it looks like travis-build depends on gimme's testdata.

philpennock added a commit that referenced this issue Feb 17, 2018
* New persistent file, `~/.gimme/versions/known-versions.txt`, which is
  kept in sorted unique order
* Add `--resolve` for handling version specifiers in a
  normally-lightweight manner, where stdout gets the resolved version.
* Handle `NN.x` (and `NN.MM.x`) as a version specifier, against the
  known versions
* Have the `--known` output be cached to disk; there's a cache bypass
  mechanism (flag), and a cache age control environment variable.
* Rework some cache handling stuff to be in cleaner functional
  abstractions
* Adds a `_version_sort` filter
* Bug-fix for stable age using access-time not mod-time on darwin|*bsd

See the README updates for notes on interaction between `--resolve` and
git tag resolution, and how to avoid that.

Fixes #129
Resolves #110
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