-
Notifications
You must be signed in to change notification settings - Fork 12
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
Initial layer caching implementation #95
base: master
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
|
Signed-off-by: Gavin Zhao <[email protected]>
Signed-off-by: Gavin Zhao <[email protected]>
Signed-off-by: Gavin Zhao <[email protected]>
Signed-off-by: Gavin Zhao <[email protected]>
Signed-off-by: Gavin Zhao <[email protected]>
Signed-off-by: Gavin Zhao <[email protected]>
Signed-off-by: Gavin Zhao <[email protected]>
Signed-off-by: Gavin Zhao <[email protected]>
Signed-off-by: Gavin Zhao <[email protected]>
Signed-off-by: Gavin Zhao <[email protected]>
Signed-off-by: Gavin Zhao <[email protected]>
@joebonrichie Arghh I completely overlooked the |
WIP.
Current issues:
solbuild build
andsudo rm -rf /var/cache/solbuild/layers/<hash>
. Or justsudo rm -rf /var/cache/solbuild/layers
to delete all layers.This PR shouldn't touch anything outside of
/var/cache/solbuild/layers
, so if anything catastrophic happens, just runsudo solbuild dc
and start over.Test instructions:
xxhash
package installed because you need thexxxh128sum
binary in your PATH.gh pr checkout 95
or checkout this branch however you prefer to.make
solbuild
binary in./bin/solbuild
. Use thissolbuild
as 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.