buildsystem: fix go-based packages #4357
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A couple of issues are now plaguing Jenkins:
syncthing
is runninggo generate -v
with a defaultGOPATH
that results ingo
modules being installed into$HOME/go
. Obviously this is messy and wrong, and there is no guarantee this is "thread safe" should multiplego
-based packages concurrently install modules at the same time into the same$HOME/go
directory.syncthing
installsgo
modules with bonkers read-only file permissions that can't subsequently be deleted when cleaning the package or when deleting the entire build directory - this is breaking Jenkins. When cleaning packages we need to ensure we have read/write access prior to removal. The actual error is:Although we can now successfully clean individual packages, users will still experience an error when attempting to delete a build directory that contains a partially or fully built
syncthing
build directory. I don't have a clean solution for this - even runningchmod
in the package isn't guaranteed to be successful.Jenkins will likely need to be aware of this issue and deal with it specifically when cleaning up.
To reduce the amount of duplicated
go
configuration, I've added helper functions.I've successfully built
docker
andsyncthing
(along with associated add-on dependencies:containerd
,runc
,libnetwork
) without issue for RPi, RPi2 and Generic.I have NOT run-time tested the resulting add-ons.