From 9172cc15d2f0d5bd125925fa56d1b173b31fb552 Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Wed, 20 Nov 2024 09:00:05 +0100 Subject: [PATCH] builder: fix cache paths in -size=full output This fixes long paths from the TinyGo cached GOROOT, as can be seen here: code rodata data bss | flash ram | package ------------------------------- | --------------- | ------- 0 5 0 5 | 5 5 | (padding) 148 0 0 5 | 148 5 | (unknown) 76 0 0 0 | 76 0 | /home/ayke/.cache/tinygo/goroot-ce8827882be9dc201bed279a631881177ae124ea064510684a3cf4bb66436e1a/src/device/arm 4 0 0 0 | 4 0 | /home/ayke/.cache/tinygo/goroot-ce8827882be9dc201bed279a631881177ae124ea064510684a3cf4bb66436e1a/src/internal/task They're now attributed to the correct package instead (device/arm and internal/task). --- builder/build.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builder/build.go b/builder/build.go index 4c49fe13c..64a1fde61 100644 --- a/builder/build.go +++ b/builder/build.go @@ -690,7 +690,7 @@ func Build(pkgName, outpath, tmpdir string, config *compileopts.Config) (BuildRe for _, pkg := range lprogram.Sorted() { pkg := pkg for _, filename := range pkg.CFiles { - abspath := filepath.Join(pkg.Dir, filename) + abspath := filepath.Join(pkg.OriginalDir(), filename) job := &compileJob{ description: "compile CGo file " + abspath, run: func(job *compileJob) error {