Since 7.4.0, custom beats reuse common mage targets from beats, for that they make use of mage:import. This is not using vendored beats in the vendor directory, though other go tools do use it. This causes problems if a different version of beats is in the GOPATH, like this one:
# command-line-arguments
./mage_output_file.go:498:5: undefined: common.AddLicenseHeaders
./mage_output_file.go:518:5: undefined: common.CheckLicenseHeaders
Error: error compiling magefiles
It was reported in the mage repository (magefile/mage#244). Migration of Beats to go modules is proposed there as solution.
We will need to look for another solution in the meantime. Or look for an alternative way of reusing targets.
For confirmed bugs, please report:
- Version: >= 7.4.0
- Steps to Reproduce: Create a new beat from a version of beats that makes use of
mage:import in magefiles, and checkout a different version in the GOPATH.
// cc: @radoondas
Since 7.4.0, custom beats reuse common mage targets from beats, for that they make use of
mage:import. This is not using vendored beats in thevendordirectory, though other go tools do use it. This causes problems if a different version of beats is in theGOPATH, like this one:It was reported in the mage repository (magefile/mage#244). Migration of Beats to go modules is proposed there as solution.
We will need to look for another solution in the meantime. Or look for an alternative way of reusing targets.
For confirmed bugs, please report:
mage:importin magefiles, and checkout a different version in theGOPATH.// cc: @radoondas