[Slackbuilds-users] RFC for building a golang with modules program (restic)
414N at slacky.it
Tue Jan 12 22:14:00 UTC 2021
I could not find info about this topic, so I decided to ask directly.
I'm working on a restic SlackBuild script that builds it from source.
1. the program is written in golang;
2. it uses the new-ish module system for itself and its dependencies,
which also simplifies the build procedure (no need to "emulate" the
previously expected $GOPATH/src/package_name directory structure);
3. the dependencies get automatically downloaded during build in
what I devised when building it is the following:
1. override GOPATH, GOCACHE and GOENV to a path under $TMP to avoid
polluting /root/go with build artifacts/caches;
2. packaged all the dependencies downloaded during "go get" under
$GOPATH/pkg/mod in a ~100MB tarball, that gets unpacked before building
if found -- this should enable totally offline and reproducible builds,
while also speeding up the build process.
I'd like to inquire if these measures are acceptable for a SBo
submission and, in case, where should the "dependencies cache" be put
(SBo SF.net repo?).
Given that currently there are no SlackBuild templates for golang
programs, I can also contribute one based on what I've done with restic.
SBo clone: GitHub <https://github.com/414n/slackbuilds.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 455 bytes
Desc: OpenPGP digital signature
More information about the SlackBuilds-users