JuliaWeb / GnuTLS.jl

Transport Level Security for Julia Streams provided by GnuTLS
Other
8 stars 13 forks source link

Fix Base.write() return value change #35

Closed staticfloat closed 9 years ago

staticfloat commented 9 years ago

Without this change, anything involving https fails on 0.4:

julia> get(URI("https://google.com"))
ERROR: cfunction: return type of write does not match
 in associate_stream at /Users/sabae/.julia/v0.4/GnuTLS/src/GnuTLS.jl:299
 in open_stream at /Users/sabae/.julia/v0.4/Requests/src/Requests.jl:219
 in open_stream at /Users/sabae/.julia/v0.4/Requests/src/Requests.jl:205
 in do_request at /Users/sabae/.julia/v0.4/Requests/src/Requests.jl:565
 in get at /Users/sabae/.julia/v0.4/Requests/src/Requests.jl:579
staticfloat commented 9 years ago

Note that I'm using the weird typeof(uint64(1)) stuff because on 0.3 it's called Uint64 and on 0.4 it's called UInt64.

IainNZ commented 9 years ago

@staticfloat does GnuTLS work otherwise for you?

IainNZ commented 9 years ago

Also Travis still seems to be failing for something related to this

staticfloat commented 9 years ago

Mmmm, no. A Pkg.test("GnuTLS") segfaults for me. :(

staticfloat commented 9 years ago

With this change however, I can at least submit things to Coveralls

timholy commented 9 years ago

I noticed this as a problem too. Not that I know how to fix the various issues folks are suddenly seeing.

sbromberger commented 9 years ago

I'm confused as to why these errors are just now cropping up, especially since the last commit was a relatively innocuous compat fix, and the commit before that was last October.

sbromberger commented 9 years ago

Also: not sure this fixes things under 0.4. Here's the travis log:

INFO: Testing GnuTLS
ERROR: LoadError: cfunction: return type of write does not match
 in cfunction at c.jl:39
 in associate_stream at /home/travis/.julia/v0.4/GnuTLS/src/GnuTLS.jl:303
 in associate_stream at /home/travis/.julia/v0.4/GnuTLS/src/GnuTLS.jl:294
 in include at ./boot.jl:249
 in include_from_node1 at loading.jl:128
 in process_options at ./client.jl:319
 in _start at ./client.jl:403
while loading /home/travis/.julia/v0.4/GnuTLS/test/runtests.jl, in expression starting on line 6
sbromberger commented 9 years ago

@staticfloat

Note that I'm using the weird typeof(uint64(1)) stuff because on 0.3 it's called Uint64 and on 0.4 it's called UInt64.

Is there no way to use Compat for this and just call it UInt64?

IainNZ commented 9 years ago

@timholy GnuTLS.jl is basically broken as far as I can tell on 0.3 and 0.4, and I'm surprised more people don't notice. PkgEval is essentially out of action unless I chop out all the github parts.

sbromberger commented 9 years ago

I need help testing proposed fixes. They're in GnuTLS.jl, branch sab/fixup1 and Requests.jl, branch sab/fixup. Please see https://github.com/JuliaWeb/GnuTLS.jl/issues/21 for some details, and please report back there.

sbromberger commented 9 years ago

I can't reproduce the original issue:

julia> using Requests

julia> get(URI("https://google.com"))
Response(301 Moved Permanently, 15 Headers, 220 Bytes in Body)

julia> Base.versioninfo()
Julia Version 0.4.0-dev+3099
Commit 3420529 (2015-02-03 20:18 UTC)
Platform Info:
  System: Darwin (x86_64-apple-darwin14.1.0)
  CPU: Intel(R) Core(TM) i7-3820QM CPU @ 2.70GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge)
  LAPACK: libopenblas
  LIBM: libopenlibm
  LLVM: libLLVM-3.3
sbromberger commented 9 years ago

I'll be damned. It's still failing on Travis but working on all of my systems. Why is that?

staticfloat commented 9 years ago

My guess is that because this bug is something that changed in Base, your version of Julia is too old to exhibit the issue. I'll try running a git bisect to figure out what exactly is going on. Your suggestion on using Compat is a good one as well.

sbromberger commented 9 years ago

It had to have changed sometime in the past 13 days. In any case, I modified this a bit and merged it in with my other massive PR. Hopefully Travis won't puke :)

sbromberger commented 9 years ago

Implemented in #36. Thank you!