Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 926281 - go-module.eclass: "dependency tarball" example produces tarballs with duplicate files
Summary: go-module.eclass: "dependency tarball" example produces tarballs with duplica...
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: William Hubbs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-06 19:11 UTC by Michał Górny
Modified: 2025-03-01 06:16 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2024-03-06 19:11:41 UTC
The commands provided to generate dependency tarballs in go-module.eclass produce tarballs with duplicate files, that are much larger than they need to be.

The `go-mod` directory ends up containing a `cache` subdirectory that includes downloaded .zip archives of Go packages, and other subdirectories containing the same packages unpacked from these .zip archives.  Not only is the data duplicated — but since one copy is deflate-compressed, they end up being compressed inefficiently.

If I removed all .zip files, go-module.eclass seems to be able to build, test and install the package without issue.  Not sure which other files can be removed.

For app-misc/siegfried-1.11.0, the archive is almost 2.5x smaller:

original command: 31M
after removing .zip files: 13M
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2025-03-01 06:03:34 UTC
Ping.
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-03-01 06:16:03 UTC
IIRC I pinged William about it a few times and he added something like this based on mine:

commit 5119efd002380b3d1d56f4dc5aa9bde577ea7edf
Author: William Hubbs <williamh@gentoo.org>
Date:   Wed May 15 14:40:20 2024 -0500

    dev-go/go-dep-tarball: new package, add 0

    Signed-off-by: William Hubbs <williamh@gentoo.org>

... but the eclassdocs still don't refer to it.