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

build on ARM #1069

Closed
blasagna opened this issue Jan 18, 2018 · 6 comments

Comments

Projects
None yet
5 participants
@blasagna
Copy link

commented Jan 18, 2018

Describe what happened:
Attempting to build the project on a Raspberry Pi 3 resulted in these errors:

~/go/src/github.com/DataDog/datadog-agent $ invoke agent.build --build-exclude=snmp
# github.com/DataDog/datadog-agent/pkg/collector/py
pkg/collector/py/datadog_agent.go:148: type [1073741824]*C.char larger than address space
pkg/collector/py/datadog_agent.go:148: type [1073741824]*C.char too large

Is it currently possible to compile on (32-bit) ARM platforms, or cross-compile for them?

@masci masci added the kind/question label Jan 18, 2018

@masci

This comment has been minimized.

Copy link
Contributor

commented Jan 18, 2018

@blasagna yes that's possible even if through an undocumented feature (docs will come soon).

You can build what we call the "Puppy Agent", a lightweight version of the full Agent that cross compiles to different platforms at the price of having less features (most notably, the Python engine is missing, meaning you can't execute Python checks on Puppy).

To build the Puppy:

~/go/src/github.com/DataDog/datadog-agent $ invoke agent.build --puppy

You can cross compile like any other Go project:

~/go/src/github.com/DataDog/datadog-agent $ GOOS=linux GOARCH=arm GOARM=5 invoke agent.build --puppy

Let me know if this helps, we want ARM architectures to be first-class citizens so any feedback is appreciated!

@tuangeek

This comment has been minimized.

Copy link

commented Feb 4, 2018

I had a similar problem
pkg/collector/py/datadog_agent.go:148: type [1073741824]*C.char larger than address space pkg/collector/py/datadog_agent.go:148: type [1073741824]*C.char too large

But building Puppy worked:

invoke agent.build --puppy
Successfully wrote /home/pi/go/src/github.com/DataDog/datadog-agent/cmd/agent/dist/datadog.yaml

Thanks @masci

@blasagna

This comment has been minimized.

Copy link
Author

commented Feb 4, 2018

Thanks @masci , building puppy worked for me as well

@masci

This comment has been minimized.

Copy link
Contributor

commented Mar 5, 2018

Cool, closing for now, feel free to re-open if you experience issues on the ARM platforms.

@masci masci closed this Mar 5, 2018

@tmcgann

This comment has been minimized.

Copy link

commented Mar 13, 2018

I attempted to cross-compile from my Mac and experienced a different issue:

$ env GOOS=linux GOARCH=arm GOARM=5 invoke agent.build
go build github.com/DataDog/datadog-agent/vendor/github.com/sbinet/go-python: build constraints exclude all Go files in /Users/taylor/projects/go/src/github.com/DataDog/datadog-agent/vendor/github.com/sbinet/go-python

But once I added the --puppy option, the build worked for me as well.

@probert-mtv

This comment has been minimized.

Copy link

commented Aug 6, 2018

For the record, I have the same problem on a i686 box (Debian 8.11) with Go 1.10.3. i386.

# invoke agent.build --build-exclude=snmp,systemd
# github.com/DataDog/datadog-agent/pkg/collector/py
pkg/collector/py/datadog_agent.go:159: type [1073741824]*_Ctype_char larger than address space
pkg/collector/py/datadog_agent.go:159: type [1073741824]*_Ctype_char too large
pkg/collector/py/datadog_agent.go:263: type [1073741824]*_Ctype_char larger than address space
pkg/collector/py/datadog_agent.go:263: type [1073741824]*_Ctype_char too large

Building the Puppy version works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.