-
Notifications
You must be signed in to change notification settings - Fork 50
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
fix for Go 1.10 #34
fix for Go 1.10 #34
Conversation
A couple of fixes so that fsevents builds in Go 1.10. Sadly this breaks compatibility with Go 1.9 and below, but there doesn't seem to be any way to avoid that. - the `kFSEventStreamEventIdSinceNow` type is now correctly unsigned, so the the need to convert from a signed integer is no longer needed. - nil must be changed to 0 in a few places now. - We must cast to the correct C type in a few places.
we could perhaps use the flag |
For a quick fix could just make a complete copy of the old wrap.go and put it behind the build flag and not waste time on reorganization |
mh, no, unfortunately it won't work. unless we don't modify the |
There were backwards incompatible changes to cgo in Go 1.10: - https://golang.org/doc/go1.10#cgo
I pushed a change that should build for all versions of Go, the travis build passed for latest Xcode: It failed for the oldest version of Xcode though, for what seems like an unrelated issue. I'm testing building with multiple versions of Go now. |
Test with Go 1.8, 1.9, 1.10 and latest stable (in case we forget to update this later). sw_vers is only present on the osx_image builds so make the output for it conditional.
Codecov Report
@@ Coverage Diff @@
## master #34 +/- ##
=========================================
- Coverage 43.03% 42.7% -0.33%
=========================================
Files 2 3 +1
Lines 165 288 +123
=========================================
+ Hits 71 123 +52
- Misses 84 147 +63
- Partials 10 18 +8
Continue to review full report at Codecov.
|
Ok, I've pushed some changes to the Travis config so that it tests with Go 1.8, 1.9 and 1.10. All builds pass: https://travis-ci.org/fsnotify/fsevents/builds/344036544 |
I hope this patch will be merged soon! :-) |
wrap_go1.9 probably would have been sufficient :D |
Testing this in my project, tests look good. We're losing some coverage b/c of the duplication of code |
great work, thank you for your contribution 🎉 🎉 🎉 |
This pulls in fsnotify/fsevents#34, which fixes Go 1.10+ support on mac OS.
This pulls in fsnotify/fsevents#34, which fixes Go 1.10+ support on mac OS.
* fix for Go 1.10 A couple of fixes so that fsevents builds in Go 1.10. Sadly this breaks compatibility with Go 1.9 and below, but there doesn't seem to be any way to avoid that. - the `kFSEventStreamEventIdSinceNow` type is now correctly unsigned, so the the need to convert from a signed integer is no longer needed. - nil must be changed to 0 in a few places now. - We must cast to the correct C type in a few places. * add wrap_deprecated.go for Go 1.9 and older There were backwards incompatible changes to cgo in Go 1.10: - https://golang.org/doc/go1.10#cgo * Update travis.yml Test with Go 1.8, 1.9, 1.10 and latest stable (in case we forget to update this later). sw_vers is only present on the osx_image builds so make the output for it conditional. * fix to work with Go 1.9.2+
* fix for Go 1.10 A couple of fixes so that fsevents builds in Go 1.10. Sadly this breaks compatibility with Go 1.9 and below, but there doesn't seem to be any way to avoid that. - the `kFSEventStreamEventIdSinceNow` type is now correctly unsigned, so the the need to convert from a signed integer is no longer needed. - nil must be changed to 0 in a few places now. - We must cast to the correct C type in a few places. * add wrap_deprecated.go for Go 1.9 and older There were backwards incompatible changes to cgo in Go 1.10: - https://golang.org/doc/go1.10#cgo * Update travis.yml Test with Go 1.8, 1.9, 1.10 and latest stable (in case we forget to update this later). sw_vers is only present on the osx_image builds so make the output for it conditional. * fix to work with Go 1.9.2+
Cherry pick of fsnotify#34 to enable Go 1.10 compilation. > * fix for Go 1.10 > > A couple of fixes so that fsevents builds in Go 1.10. Sadly this breaks > compatibility with Go 1.9 and below, but there doesn't seem to be any > way to avoid that. > > - the `kFSEventStreamEventIdSinceNow` type is now correctly unsigned, so > the the need to convert from a signed integer is no longer needed. > > - nil must be changed to 0 in a few places now. > > - We must cast to the correct C type in a few places. > > * add wrap_deprecated.go for Go 1.9 and older > > There were backwards incompatible changes to cgo in Go 1.10: > > - https://golang.org/doc/go1.10#cgo > > * Update travis.yml > > Test with Go 1.8, 1.9, 1.10 and latest stable (in case we forget to > update this later). sw_vers is only present on the osx_image builds so > make the output for it conditional. > > * fix to work with Go 1.9.2+
fixes #40 Cannot use nil for CFType (Go 1.10+), round 2 reducing code changes between Go versions conversions can occur in older Go versions too extract eventIDSinceNow constant to other files Go-version specific files. reworks #34 which resolves int overflow #31 minimize code differences between Go versions Work around bizarre bugs in 1.10.3 (not 1.10.4) golang/go#24161 use C.kCFAllocatorDefault instead of C.CFAllocatorRef(0) thanks to @havoc-io for the tip reduce duplication between go 1.10 before/after thanks to C.kCFAllocatorDefault change
fixes #40 Cannot use nil for CFType (Go 1.10+), round 2 reducing code changes between Go versions conversions can occur in older Go versions too extract eventIDSinceNow constant to other files Go-version specific files. reworks #34 which resolves int overflow #31 minimize code differences between Go versions Work around bizarre bugs in 1.10.3 (not 1.10.4) golang/go#24161 use C.kCFAllocatorDefault instead of C.CFAllocatorRef(0) thanks to @havoc-io for the tip reduce duplication between go 1.10 before/after thanks to C.kCFAllocatorDefault change
fixes fsnotify#40 Cannot use nil for CFType (Go 1.10+), round 2 reducing code changes between Go versions conversions can occur in older Go versions too extract eventIDSinceNow constant to other files Go-version specific files. reworks fsnotify#34 which resolves int overflow fsnotify#31 minimize code differences between Go versions Work around bizarre bugs in 1.10.3 (not 1.10.4) golang/go#24161 use C.kCFAllocatorDefault instead of C.CFAllocatorRef(0) thanks to @havoc-io for the tip reduce duplication between go 1.10 before/after thanks to C.kCFAllocatorDefault change
fixes fsnotify#40 Cannot use nil for CFType (Go 1.10+), round 2 reducing code changes between Go versions conversions can occur in older Go versions too extract eventIDSinceNow constant to other files Go-version specific files. reworks fsnotify#34 which resolves int overflow fsnotify#31 minimize code differences between Go versions Work around bizarre bugs in 1.10.3 (not 1.10.4) golang/go#24161 use C.kCFAllocatorDefault instead of C.CFAllocatorRef(0) thanks to @havoc-io for the tip reduce duplication between go 1.10 before/after thanks to C.kCFAllocatorDefault change
fixes fsnotify#40 Cannot use nil for CFType (Go 1.10+), round 2 reducing code changes between Go versions conversions can occur in older Go versions too extract eventIDSinceNow constant to other files Go-version specific files. reworks fsnotify#34 which resolves int overflow fsnotify#31 minimize code differences between Go versions Work around bizarre bugs in 1.10.3 (not 1.10.4) golang/go#24161 use C.kCFAllocatorDefault instead of C.CFAllocatorRef(0) thanks to @havoc-io for the tip reduce duplication between go 1.10 before/after thanks to C.kCFAllocatorDefault change
Fixes #33 and #31.
A couple of fixes so that fsevents builds in Go 1.10. Sadly this breaks
compatibility with Go 1.9 and below, but there doesn't seem to be any
way to avoid that. I have not fully vetted it, just confirmed that it builds and the example runs.
the
kFSEventStreamEventIdSinceNow
type is now correctly unsigned, sothe the need to convert from a signed integer is no longer needed.
nil must be changed to 0 in a few places now.
We must cast to the correct C type in a few places.