Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

buildsystem: fix go-based packages #4357

Merged
merged 4 commits into from
May 6, 2020
Merged

buildsystem: fix go-based packages #4357

merged 4 commits into from
May 6, 2020

Conversation

MilhouseVH
Copy link
Contributor

A couple of issues are now plaguing Jenkins:

  1. syncthing is running go generate -v with a default GOPATH that results in go modules being installed into $HOME/go. Obviously this is messy and wrong, and there is no guarantee this is "thread safe" should multiple go-based packages concurrently install modules at the same time into the same $HOME/go directory.

  2. syncthing installs go 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:

rm: cannot remove '/home/ubuntu/projects/xLibreELEC.tv/build.LibreELEC-RPi2.arm-9.80-devel/build/syncthing-1.2.0/.gopath/pkg/mod/github.com/sasha-s/[email protected]/LICENSE': Permission denied
rm: cannot remove '/home/ubuntu/projects/xLibreELEC.tv/build.LibreELEC-RPi2.arm-9.80-devel/build/syncthing-1.2.0/.gopath/pkg/mod/github.com/sasha-s/[email protected]/deadlock.go': Permission denied
rm: cannot remove '/home/ubuntu/projects/xLibreELEC.tv/build.LibreELEC-RPi2.arm-9.80-devel/build/syncthing-1.2.0/.gopath/pkg/mod/github.com/sasha-s/[email protected]/stacktraces.go': Permission denied
rm: cannot remove '/home/ubuntu/projects/xLibreELEC.tv/build.LibreELEC-RPi2.arm-9.80-devel/build/syncthing-1.2.0/.gopath/pkg/mod/github.com/sasha-s/[email protected]/Readme.md': Permission denied
rm: cannot remove '/home/ubuntu/projects/xLibreELEC.tv/build.LibreELEC-RPi2.arm-9.80-devel/build/syncthing-1.2.0/.gopath/pkg/mod/github.com/sasha-s/[email protected]/.travis.yml': Permission denied
rm: cannot remove '/home/ubuntu/projects/xLibreELEC.tv/build.LibreELEC-RPi2.arm-9.80-devel/build/syncthing-1.2.0/.gopath/pkg/mod/github.com/sasha-s/[email protected]/deadlock_test.go': Permission denied
...

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 running chmod 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 and syncthing (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.

@MilhouseVH
Copy link
Contributor Author

golang/go#31481 adds GFLAGS=-modcacherw support in go-1.14 which avoids the read-only nonsense. Thanks @HiassofT.

Bumping to go-1.14.2 breaks syncthing-1.2.0, so bump that too.

@awiouy
Copy link
Collaborator

awiouy commented May 5, 2020

@MilhouseVH I rebased this on master, updated syncthing to 1.5.0 and simplified syncthing's package.mk

Copy link
Collaborator

@awiouy awiouy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Syncthing 1.5.0 builds ans runs

@awiouy
Copy link
Collaborator

awiouy commented May 6, 2020

Thank you @HiassofT.
Ready to merge, I guess.

@HiassofT HiassofT merged commit c7c6430 into LibreELEC:master May 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants