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

Support cross compilation with xgo #230

Merged
merged 1 commit into from
Mar 21, 2019
Merged

Support cross compilation with xgo #230

merged 1 commit into from
Mar 21, 2019

Conversation

ferrouswheel
Copy link
Contributor

I've added a script using xgo, to allow us to build for arm6 (raspberry pi). Fixes #227

Side benefit of this is approach is that I was able to build for almost every platform Go supports (so also fixes #215).

However, I've constrained the default behaviour to only build for the major platforms.

Also changes some Int64 constants to fit in Int32 so compilation on arm works.

@ferrouswheel ferrouswheel requested a review from vsbogd March 20, 2019 00:53
@ferrouswheel
Copy link
Contributor Author

Not sure whether to also swap circleci to using xgo or if there are packaging scripts that should use this for releases, let me know if you want me to work on that too. cc @anandrgitnirman

@@ -12,7 +12,7 @@ func NewRateLimiter() rate.Limiter {
//By Default set the maximum value possible for the Burst Size ( assuming rate was defined ,but burst was not defined)
burstSize := config.GetInt(config.BurstSize)
if burstSize == 0 {
burstSize = math.MaxInt64
burstSize = math.MaxInt32
Copy link
Member

Choose a reason for hiding this comment

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

Was this change required for the cross compilation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, Int is 32bit on Arm6

Copy link
Member

Choose a reason for hiding this comment

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

Thanks

@@ -0,0 +1,22 @@
--- /home/joel/Downloads/watcher_fsevents_cgo.go 2019-03-20 13:14:12.643748593 +1300
Copy link
Member

Choose a reason for hiding this comment

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

Is this file related to cross compilation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, at least until we upgrade our deps and Go. This patch is required for compiling for OSX and gets automatically applied by the build script.

Copy link
Member

Choose a reason for hiding this comment

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

Thanks, that clarifies

@raamb
Copy link
Member

raamb commented Mar 20, 2019

@vinthedark once this is merged in, lets update out build scripts to generate releases with binaries for all platforms

Copy link
Member

@vsbogd vsbogd left a comment

Choose a reason for hiding this comment

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

Looks good to me

@anandrgitnirman anandrgitnirman merged commit 4d0c885 into singnet:master Mar 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ARM architecture support Unable to build Mac Binary of Daemon from Ubuntu
4 participants