Skip to content

Commit

Permalink
Be friends with linters
Browse files Browse the repository at this point in the history
Signed-off-by: Gavin Zhao <[email protected]>
  • Loading branch information
GZGavinZhao committed Sep 20, 2023
1 parent fbf24f5 commit ca352d6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions builder/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,15 @@ func (p *Package) BindSources(o *Overlay) error {
return nil
}

// BindCache will make all cache defined in [caches] available to the build
// BindCache will make all cache defined in [caches] available to the build.
func (p *Package) BindCaches(o *Overlay) error {
mountMan := disk.GetMountManager()

for _, c := range Caches {
var cacheSource string
var cacheDir string
var (
cacheSource string
cacheDir string
)

if p.Type == PackageTypeYpkg {
cacheSource = filepath.Join(CacheDirectory, c.Name, "ypkg")
Expand All @@ -132,8 +134,9 @@ func (p *Package) BindCaches(o *Overlay) error {

// Bind mount local ccache into chroot
if err := mountMan.BindMount(cacheSource, cacheDir); err != nil {
return fmt.Errorf("Failed to bind mount %s %s, reason: %s\n", c.Name, cacheDir, err)
return fmt.Errorf("Failed to bind mount %s %s, reason: %w\n", c.Name, cacheDir, err)
}

o.ExtraMounts = append(o.ExtraMounts, cacheDir)
}

Expand Down
2 changes: 1 addition & 1 deletion builder/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const (
// PackageCacheDirectory is where we share packages between all builders.
PackageCacheDirectory = "/var/lib/solbuild/packages"

// CacheDirectory is where packages' build cache are stored
// CacheDirectory is where packages' build cache are stored.
CacheDirectory = "/var/lib/solbuild/cache"

// Obsolete cache directories. These are only still specified so that the
Expand Down

0 comments on commit ca352d6

Please sign in to comment.