Bug 13883

Summary: The use of `go mod` inside OE-Core is broken
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Otavio Salvador <otavio>
Component: devtools / tool chainAssignee: Khem Raj <raj.khem>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: Medium+ CC: matt, meta.mr.watcher, meta.watcher, raj.khem
Version: 3.1   
Target Milestone: 3.2 M1   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: New (Never tested)
Verified: Documentation change: Yes (doc changes required)
Attachments:
Description Flags
telegraf_1.14.2.bb none

Description Otavio Salvador 2020-04-27 12:55:26 UTC
We had a customer which asked the packaging of telegraf however, we got nowhere. The `go mod` support is starting to become the standard however it does not work at all on OE-Core.

I am not used to `go mod` but would be keen to help if someone knows well how to do the proper integration.
Comment 1 Matt Madison 2020-05-12 08:53:19 UTC
Created attachment 4673 [details]
telegraf_1.14.2.bb

See comments in the recipe for how I made go module support work.
Comment 2 Matt Madison 2020-05-12 09:00:08 UTC
I had a couple of hours to look at this, and while I got telegraf to build OK, I'm less certain about how to generalize the changes I made to work for any package that uses go modules.

I don't have time to look into this any further, but hopefully the above recipe will help point someone in the right direction.
Comment 3 Otavio Salvador 2020-05-21 19:24:54 UTC
I sent the patches fixing this. I made a class which makes it easier to get it right and cleaned it a lot.

Matt, thanks for your effort on looking at this, it helped a lot.