Harmen
unread,Apr 30, 2024, 2:35:25 AMApr 30Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to golang-nuts
Hi,
in both my Nix and Docker builds I have a step to build all libraries in
/vendor, and then cache that. Works great, saves me multiple minutes for every
CI build.
Now I would like to improve the command, this is what I currently use:
$ go build -v `cat vendor/modules.txt |grep -v '#'|grep -v sys/windows|grep -v tpmutil/tbs|grep -v internal`
In order to keep the cache key valid I can't depend on my own code, I can only
depend on go.{mod,sum} and on what's in /vendor/. The sys/windows and tpmutil/tbs are packages which
have "build constraints exclude all Go files".
It all works fine, just wondering if there's a nicer way to get all
"compilable" packages stored in /vendor.
Thanks!