-
Notifications
You must be signed in to change notification settings - Fork 14
Initial layer caching implementation #95
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
base: main
Are you sure you want to change the base?
Conversation
|
It looks like I also tried an implementation with XXH3 import "github.com/zeebo/xxh3"
func FileXXH3Sum(path string) (string, error) {
defer timeTaken("FileXXH3Sum")()
mfile, err := os.Open(path)
if err != nil {
return "", err
}
defer mfile.Close()
h := xxh3.New()
_, err = io.Copy(h, mfile)
if err != nil {
return "", err
}
return fmt.Sprintf("%x", h.Sum128().Bytes()), nil
}
func timeTaken(name string) func() {
start := time.Now()
return func() {
fmt.Printf("%s execution time: %v\n", name, time.Since(start))
}
}A similar thing could be done with blake3 which would allow 256bits again. Dirty benchmarks (m64py) edit: it looks like your hashFileBytes() implementation using io.Copy is slightly faster than the MapFile approach. |
|
Friendly reminder that this solbuild version appears to rundep on Should probably be added in the cover letter or in the readme + added as a proper solbuild rundep once this hits the repo... |
|
Feature-wise complete, I've been using this since April as well. Need some code cleanup and add this feature behind a flag, then this should be ready for review. |
|
Chrooting after a interrupted build seems to fail, even after deleting the layers |
|
@joebonrichie Arghh I completely overlooked the |
Signed-off-by: Gavin Zhao <git@gzgz.dev>
Signed-off-by: Gavin Zhao <git@gzgz.dev>
Signed-off-by: Gavin Zhao <git@gzgz.dev>
Signed-off-by: Gavin Zhao <git@gzgz.dev>
Signed-off-by: Gavin Zhao <git@gzgz.dev>
Signed-off-by: Gavin Zhao <git@gzgz.dev>
Signed-off-by: Gavin Zhao <git@gzgz.dev>
Signed-off-by: Gavin Zhao <git@gzgz.dev>
Signed-off-by: Gavin Zhao <git@gzgz.dev>
Signed-off-by: Gavin Zhao <git@gzgz.dev>
Signed-off-by: Gavin Zhao <git@gzgz.dev>
WIP.
Current issues:
solbuild buildandsudo rm -rf /var/cache/solbuild/layers/<hash>. Or justsudo rm -rf /var/cache/solbuild/layersto delete all layers.This PR shouldn't touch anything outside of
/var/cache/solbuild/layers, so if anything catastrophic happens, just runsudo solbuild dcand start over.Test instructions:
xxhashpackage installed because you need thexxxh128sumbinary in your PATH.gh pr checkout 95or checkout this branch however you prefer to.makesolbuildbinary in./bin/solbuild. Use thissolbuildas how you would normally build packages. You should notice that after you build a package once, when you build it the second time, it should jump straight to the setup phase, skipping the step of installing dependencies.