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

Update to Go 1.8 features #17

Merged
merged 7 commits into from Feb 24, 2017
Merged

Update to Go 1.8 features #17

merged 7 commits into from Feb 24, 2017

Conversation

xenoscopic
Copy link
Member

@xenoscopic xenoscopic commented Feb 21, 2017

Go 1.8 brings a lot of goodies that are worth using. Ideally, I'd like to take advantage of the following:

  • Enforce usage of Go 1.8 using build constraints
  • Update CI systems to use Go 1.8. This is currently blocked by Go 1.8 appveyor/ci#1330. We could use Chocolatey to update, but 32-bit support is hard in that case, and AppVeyor usually gets these updates out quickly anyway. AppVeyor has updated to Go 1.8.
  • Add support for 32-bit MIPS architectures (little- and big-endian)
  • Utilize sort.Slice
  • Update filesystem.Normalize to take advantage of Go 1.8 behavior
  • Switch to using os.Executable instead of kardianos/osext. Actually, it turns out that the os.Executable implementation on OpenBSD uses procfs to determine the executable path. This is somewhat more technically correct, but OpenBSD killed support for procfs, so this doesn't really work. The kardianos/osext package attempts to find the process using argv[0], which is sufficient for our purposes despite being imperfect. Although in newer versions, it just falls back to os.Executable if available, so we'll have to be careful not to use it.

I've changed the deploy condition a bit to be closer to what the Travis
documentation recommends:

https://docs.travis-ci.com/user/languages/go#Environment-Variable

AppVeyor should always be on the latest Go release without having to
change configurations.
We haven't actually made any changes that require Go 1.8 yet, but this
branch will be full of them. In general, we'll only support the latest
version since there's really no difficulty in using the latest. Yes, it
will mean dropping support for some older platforms, but these don't
seem to be well-supported in older Go versions anyway.

I'm not a huge fan of our build constraint mechanism here, because it
doesn't really provide any feedback as to why Mutagen is failing to
build, and it relies on code trying to pull in Mutagen version
information, but there's not really any other way to approach this.
This isn't strictly necessary and almost certainly won't boost
performance, but it does clean up the code a bit.
We should also look into aligning the CI steps at some point, but they
aren't exactly 1-to-1 between Travis and AppVeyor.
This commit also removes some old comments about MIPS uname values,
because I'm fairly certain they're correct at this point and if not then
someone can complain about it and then I'll have a MIPS tester.
This wouldn't gain us anything but would require an additional
allocation for each encoding, so it's not worth it. Strict checking
might also just be slower.
Now that we're using Go 1.8, filepath.Abs will automatically call
filepath.Clean on its result.
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.

None yet

1 participant