[Slackbuilds-users] RFC for building a golang with modules program (restic)

414N 414N at slacky.it
Tue Jan 12 22:14:00 UTC 2021


Greetings,

I could not find info about this topic, so I decided to ask directly.

I'm working on a restic[1] SlackBuild script that builds it from source.
Given that:

 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
$GOPATH/pkg/mod;

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?[2]).

Given that currently there are no SlackBuild templates for golang
programs, I can also contribute one based on what I've done with restic.


[1]: https://restic.net/
[2]: https://sourceforge.net/projects/slackbuildsdirectlinks/

Kindest regards

-- 
Alan Alberghini

SBo clone: GitHub <https://github.com/414n/slackbuilds.org>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 455 bytes
Desc: OpenPGP digital signature
URL: <http://lists.slackbuilds.org/pipermail/slackbuilds-users/attachments/20210112/22fabd33/attachment-0001.asc>


More information about the SlackBuilds-users mailing list