JuliaWeb / GnuTLS.jl

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

Fails to install on Windows #14

Closed IainNZ closed 9 years ago

IainNZ commented 10 years ago

Julia 0.2, added via HttpServer:

...
INFO: Installing GnuTLS v0.0.0
...

INFO: Building GnuTLS
INFO: Attempting to Create directory C:\Users\Iain\.julia\GnuTLS\deps\downloads
INFO: Downloading file ftp://ftp.gnutls.org/gcrypt/gnutls/w32/gnutls-3.2.1-w32.z
ip
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 5260k  100 5260k    0     0  1057k      0  0:00:04  0:00:04 --:--:-- 1317k
INFO: Done downloading file ftp://ftp.gnutls.org/gcrypt/gnutls/w32/gnutls-3.2.1-
w32.zip
INFO: Attempting to Create directory C:\Users\Iain\.julia\GnuTLS
INFO: Directory C:\Users\Iain\.julia\GnuTLS already created
INFO: Attempting to Create directory C:\Users\Iain\.julia\GnuTLS\deps\usr

7-Zip [64] 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-18

Processing archive: C:\Users\Iain\.julia\GnuTLS\deps\downloads\gnutls-3.2.1-w32.
zip

Extracting  COPYING
Extracting  COPYING.LESSER
Extracting  bin
Extracting  bin\gnutls-cli.exe
...
*snip*
...

Everything is Ok

Folders: 6
Files: 105
Size:       22021087
Compressed: 5386257
===============================[ ERROR: GnuTLS ]================================

WARNING: backtraces on your platform are often misleading or partially incorrect

Directory C:\Users\Iain\.julia\GnuTLS\deps\usr was not created successfully (Tri
ed to run `7z x 'C:\Users\Iain\.julia\GnuTLS\deps\downloads\gnutls-3.2.1-w32.zip
' -y '-oC:\Users\Iain\.julia\GnuTLS\deps'` )
at C:\Users\Iain\.julia\GnuTLS\deps\build.jl:49

================================================================================

then

julia> using GnuTLS
ERROR: Could not load library gnutls. Try running Pkg.build() to install miss
 dependencies!
 in error at error.jl:21
 in include at boot.jl:238
 in include_from_node1 at loading.jl:114
 in reload_path at loading.jl:140
 in reload_path at loading.jl:139

at C:\Users\Iain\.julia\GnuTLS\src\GnuTLS.jl:595
IainNZ commented 10 years ago

In C:\Users\Iain\.julia\GnuTLS\deps\bin there is a libgnutls-28.dll but that isn't on the alias list, testing adding that...

IainNZ commented 10 years ago

I added libnettle-4-7.dll for Nettle and libgnutls-28.dll for gnutls but still says it can't load it.

IainNZ commented 10 years ago

Ahh... hold on: provides(Binaries,URI("ftp://ftp.gnutls.org/gcrypt/gnutls/w32/gnutls-3.2.1-w32.zip"),gnutls,os = :Windows) so its trying to load 32-bit binaries?

IainNZ commented 10 years ago

I can't seem to find 64-bit binaries, but I'm not sure why it can't extract that folder anyway.

mlubin commented 10 years ago

There's a gnutls package available through WinRPM, but after installing it and modifying build.jl to search for libgnutls-28 both 32- and 64-bit julia crash when running using GnuTLS.

Error message for win32:

$ ~/Desktop/win32/julia-05c6461b55/bin/julia-basic.exe -e "using GnuTLS"
Warning: Possible conflict in library symbol SystemFunction036
INFO: Updating WinRPM package list
INFO: Downloading http://download.opensuse.org/repositories/windows:/mingw:/win3
2/openSUSE_Factory//repodata/repomd.xml
INFO: Downloading http://download.opensuse.org/repositories/windows:/mingw:/win6
4/openSUSE_Factory//repodata/repomd.xml
Please submit a bug report with steps to reproduce this fault, and any error mes
sages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x0 -- ??? at ???: offset 0
??? at ???: offset 0
gnutls_x509_trust_list_add_system_trust at ???: offset 66da2eae
gnutls_certificate_set_x509_system_trust at ???: offset 66da8c82
jl_apply_generic at ???: offset 6978f8a6
jl_dump_function at ???: offset 697b9b08
jl_dump_function at ???: offset 697ba7d2
jl_dump_function at ???: offset 697b9d89
jl_dump_function at ???: offset 697b9f75
jl_dump_function at ???: offset 697bac96
jl_dump_function at ???: offset 697b99e1
jl_dump_function at ???: offset 697bafa1
jl_toplevel_eval at ???: offset 697c7ab2
jl_toplevel_eval at ???: offset 697c7c3f
jl_toplevel_eval at ???: offset 697c79b9
jl_toplevel_eval at ???: offset 697c7e7f
jl_load at ???: offset 697c8013
jl_apply_generic at ???: offset 6978f8a6
uv_msafd_poll at ???: offset 69d4b4b4
uv_msafd_poll at ???: offset 698a6106
uv_msafd_poll at ???: offset 69a03397
RtlFreeHeap at ???: offset 777de023
free at ???: offset 76ee98da
free at ???: offset 76ee98cd
free at ???: offset 76ee98da

Win64 is silent when it crashes.

Any help here @ihnorton, @vtjnash?

ihnorton commented 10 years ago

Did you remove the win32 DLLs? Also, mind to post the modified build.jl in a gist?

mlubin commented 10 years ago

Yes, removed the old DLLs. Here's my modified build.jl: https://gist.github.com/mlubin/8500398

ihnorton commented 10 years ago

https://github.com/loladiro/GnuTLS.jl/pull/16 uses the caching mechanism (which in this case just means it crashes faster)

ihnorton commented 10 years ago

It works when julia is run as Administrator [edit: nevermind. no it doesn't]. Perhaps this is why @loladiro is downloading a newer version of libgnutls than what is available from WinRPM.

mlubin commented 10 years ago

Oh, I just assumed this was pre-WinRPM.

ihnorton commented 10 years ago

@mlubin this: https://github.com/loladiro/GnuTLS.jl/pull/17 appears to fix it.

mlubin commented 10 years ago

Thanks, never would've figured that out! It works for me now. @loladiro, could we merge and bump in METADATA? @IainNZ and I are on a short timeframe for the course we're teaching.

IainNZ commented 10 years ago

Apologetic bump, but I think this might be the only blocker for getting the webstack working on Windows.

Keno commented 10 years ago

I'll have a look.

ihnorton commented 10 years ago

@loladiro it seems necessary to set the memory handlers before calling set_system_trust or else we get https://github.com/loladiro/GnuTLS.jl/issues/14#issuecomment-32700049 ... This was just a hunch based on some gnutls list threads, and appears to be confirmed on both of our computers with #17 (which is kind of ugly, maybe there is a nicer way to arrange init() to happen first).

mlubin commented 10 years ago

Thanks for merging. Mind if I bump in METADATA?

Keno commented 10 years ago

Go ahead.

mlubin commented 10 years ago

Done.

sbromberger commented 9 years ago

Closing this out since it's over a year old. Assuming the issue has been fixed - if not, please let me know and I'll reopen.