elastic / beats

:tropical_fish: Beats - Lightweight shippers for Elasticsearch & Logstash
https://www.elastic.co/products/beats
Other
12.06k stars 4.89k forks source link

Macos BigSur 11.1 Packetbeat Cross-compile to windows #23543

Closed Aixic-Love closed 3 years ago

Aixic-Love commented 3 years ago

Mainly a problem with libpcap.

go.mod github.com/tsg/gopacket v0.0.0-20200626092518-2ab8e397a786

image First of all, when this problem occurred, I modified the pcap.go file. image WpdPack is downloaded from here:https://www.winpcap.org/devel.htm image

Try to cross compile... CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc GOOS=windows GOARCH=amd64 go build -x -v


image image

I need to deploy through the build machine, is there any solution?


Aixic-Love commented 3 years ago

I tried to modify pcap.go to look like this image It can be compiled normally, but it will report an error when it runs. image

elasticmachine commented 3 years ago

Pinging @elastic/security-external-integrations (Team:Security-External Integrations)

andrewkroh commented 3 years ago

Cross-compile for Windows can be accomplished with the package target. You must have Docker setup on your macos.

cd packetbeat
make mage
PLATFORMS='windows/amd64' mage package
ls -la build/distributions