-
Notifications
You must be signed in to change notification settings - Fork 51
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
Conversation
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, that clarifies
@vinthedark once this is merged in, lets update out build scripts to generate releases with binaries for all platforms |
There was a problem hiding this 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
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.