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

Multiple source-level builds, reusable caching #147

Open
philpennock opened this issue May 29, 2018 · 1 comment
Open

Multiple source-level builds, reusable caching #147

philpennock opened this issue May 29, 2018 · 1 comment

Comments

@philpennock
Copy link
Contributor

Is there enough interest/use-case for being able to specify gimme abcdef1234 to get a specific git sha and be able to do so repeatably, using cached builds rather than rebuilding each time?

If so, then this is a sketch of how we might do it:

  1. Require a git new enough to support --reference
  2. Maintain a bare repo at ~/.gimme/versions/go.git, use git fetch to update it
  3. Whenever we build tip, or a specific SHA, resolve it first, then effectively do git clone --reference ~/.gimme/versions/go.git https://github.com/golang/go ~/.gimme/versions/ref.abcdef1234
  4. Cache based on existence of that specific directory; resolve tip each time. This gives us working tip which updates but caches correctly
  5. Have gimme update a log-file on each invocation, recording (timestamp, version)
  6. Have gimme clean use the log-file to figure out any local version not used in the past two weeks (default) and nuke them.

There are problems with --reference but they relate to having one repo mapped into Docker but not the other repo. That should not be an issue with the internals of the gimme directory (and --dissociate is available if we really must bloat with redundant copies).

I'm tentatively willing to do this work, once 1.5.0 is out, as work for 1.6.0.

@anitgandhi
Copy link

That would definitely be useful in my opinion, and the re-usable caching sounds like it would solve #146 as well. gimme clean would be very useful!

philpennock added a commit that referenced this issue Jun 4, 2018
Use a common git bare repo for fetching code, build from git in specific
directories so that each is reusable.

Cleans up some of the gunk/tech-debt I accrued earlier in version
parsing.  I _think_ this approach succeeds with everything the earlier
approach did.

This is part 1 of addressing #147 where I sketched out the design; no
log-files yet.
philpennock added a commit that referenced this issue Jun 5, 2018
This gives us the other part of multiple git builds, each isolated, per
issue #147.

Caveat: the use of aliases breaks the log-file's utility.  For now, I'm
handling that by not implementing aliases for git and constraining clean
to be only for git.  We can revisit if desired.
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

2 participants