Created attachment 258273 [details] Patch
Adam, since you're caring for go ports, maybe you can approve this?
This certainly LGTM and you've got my +1 on it. But what about the other targets? Do none of the others cause trouble? [1332.58 adamw@apnoea /usr/local/go123/src/debug] du -h -d 1 **/testdata 163K dwarf/testdata/ 154K elf/testdata/ 131K gosym/testdata/ 66K macho/testdata/ 173K pe/testdata/ 42K plan9obj/testdata/
All other files are probably statically linked. But I'd also like to remove them, if they are in fact unused on the target machine.
In reality, we install tons of go stuff that are never used; a big one there are test files. /usr/local/go123/test is 15MB, and all ~300 testdata dirs in go123/src/ are unused. As far as I can tell, the reasoning behind packagers included those dirs centers around, "*shrug*." I'd be perfectly happy to see all that stuff disappear, but I'm only 95% confident that they're useless and that's not enough.
Then let's stay on safe side and land the patch as-is?
(In reply to Gleb Popov from comment #5) I'm on board with that. I say, go for it.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=a9d50d18293658481ab9badf19ddc0dda84628b0 commit a9d50d18293658481ab9badf19ddc0dda84628b0 Author: Gleb Popov <arrowd@FreeBSD.org> AuthorDate: 2025-03-04 06:53:36 +0000 Commit: Gleb Popov <arrowd@FreeBSD.org> CommitDate: 2025-03-06 13:52:57 +0000 lang/go{120,121,122,123,-devel}: Stop install Linux test binaries With pkg's improved shared library tracking these [useless anyways] files started to confuse Poudriere. Reported by: bdrewery Approved by: adamw PR: 285151 lang/go-devel/Makefile | 3 ++- lang/go120/Makefile | 2 +- lang/go121/Makefile | 2 +- lang/go122/Makefile | 2 +- lang/go123/Makefile | 1 + 5 files changed, 6 insertions(+), 4 deletions(-)
"-f" is not necessary. ${RM} already does that.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=fd78d64546872a69da9e3ce11400f115e3428d25 commit fd78d64546872a69da9e3ce11400f115e3428d25 Author: Gleb Popov <arrowd@FreeBSD.org> AuthorDate: 2025-03-06 14:36:24 +0000 Commit: Gleb Popov <arrowd@FreeBSD.org> CommitDate: 2025-03-06 14:36:24 +0000 lang/go-devel: Remove -f from the ${RM} invocation PR: 285151 Reported by: pkubaj Fixes: a9d50d18293658481ab9badf19ddc0dda84628b0 lang/go-devel/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
The test data is needed if you want to run the unit tests of standard library packages. I strongly advice against removing random bits of the source distribution in our package; Debian has done the same before and it caused weird issues. Please revert.
(In reply to Robert Clausecker from comment #10) It seems strange to me that an end user would want to run go unit tests against an installed package. Aren't tests supposed to be run during the port build?
(In reply to Gleb Popov from comment #11) The Go tool permits running unit tests of all standard library packages. A user might e.g. want to run unit tests of all packages in his project and all dependencies recursively, which includes some standard library packages. If you delete test files, these tests will fail. This should be fixed by fixing pkg, not by removing random test files from the distribution.
(In reply to Robert Clausecker from comment #12) > The Go tool permits running unit tests of all standard library packages. A user might e.g. want to run unit tests of all packages in his project and all dependencies recursively, which includes some standard library packages. If you delete test files, these tests will fail. Makes sense, although I still find it a bit strange and unusual.
there is nothing to be fixed in pkg ;) pkg reports that testdata/gcc-386-freebsd-exec is a freebsd 32 bit binary required libc.so.6 (readelf -d on it you will see it is true) pkg can be instrumented not to analyse this file: like in this review: https://reviews.freebsd.org/D49260
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=aa6c40debfb19e4d0dcf6b5b400287cfad2aecb3 commit aa6c40debfb19e4d0dcf6b5b400287cfad2aecb3 Author: Gleb Popov <arrowd@FreeBSD.org> AuthorDate: 2025-03-07 06:01:03 +0000 Commit: Gleb Popov <arrowd@FreeBSD.org> CommitDate: 2025-03-07 06:04:45 +0000 lang/go{120,121,122,123,-devel}: Revert "Stop install Linux test binaries" This reverts commit a9d50d18293658481ab9badf19ddc0dda84628b0. A better solution was committed in a4327166148114c314ae5dd6f9c7e6776178e0ac PR: 285151 Reported by: fuz lang/go-devel/Makefile | 3 +-- lang/go120/Makefile | 2 +- lang/go121/Makefile | 2 +- lang/go122/Makefile | 2 +- lang/go123/Makefile | 2 +- lang/go124/Makefile | 2 +- 6 files changed, 6 insertions(+), 7 deletions(-)