diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2026-01-09 15:49:30 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2026-01-09 16:04:58 +0000 |
| commit | 64c076ea8f57b01c61f2a55fbf9e82ef73fd011a (patch) | |
| tree | d360378d12d67b19afb16ae29087f5a2912b2f5e | |
| parent | 726feca9d81fa0ab28174bbe0b987b9f1c094fb0 (diff) | |
pkg/aflow/action/kernel: fix removal on unneeded build files
Paths passed to filepath.WalkDir are absolute (include the dir prefix), account for that.
Strings returned by filepath.Ext include the dot, account for that as well.
| -rw-r--r-- | pkg/aflow/action/kernel/build.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pkg/aflow/action/kernel/build.go b/pkg/aflow/action/kernel/build.go index 4da9e9d89..5cc9fd796 100644 --- a/pkg/aflow/action/kernel/build.go +++ b/pkg/aflow/action/kernel/build.go @@ -51,11 +51,11 @@ func buildKernel(ctx *aflow.Context, args buildArgs) (buildResult, error) { } // Remove main intermediate build files, we don't need them anymore // and they take lots of space. Keep generated source files. - keepExt := map[string]bool{"h": true, "c": true, "s": true, "S": true} + keepExt := map[string]bool{".h": true, ".c": true, ".s": true, ".S": true} keepFiles := map[string]bool{ - image: true, - target.KernelObject: true, - compileCommnads: true, + filepath.Join(dir, image): true, + filepath.Join(dir, target.KernelObject): true, + filepath.Join(dir, compileCommnads): true, } return filepath.WalkDir(dir, func(path string, d fs.DirEntry, err error) error { if err != nil || d.IsDir() || keepFiles[path] || keepExt[filepath.Ext(d.Name())] { |
