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

Include support for using Pkg with SOCKS proxies #10754

Closed
isislovecruft opened this issue Apr 5, 2015 · 13 comments
Closed

Include support for using Pkg with SOCKS proxies #10754

isislovecruft opened this issue Apr 5, 2015 · 13 comments
Labels
packages Package management and loading

Comments

@isislovecruft
Copy link

I am on a network behind a very restrictive firewall, and I can only use Tor to reach the internet. I have seen issues like #3001, and my git is globally configured to use https:// instead of git:// (by the way, that is a severe security issue which actually warrants filing CVE, I strongly suggest fixing #7005).

I suggest, for Julia users like myself with restricted connections, that Julia adopt support for respecting system proxy settings, as well as support for both HTTP and SOCKS proxies. My apologies that I am still quite new to Julia, and do not yet have any more concrete suggestions as to where/how to implement this support.

To show you a bit of the difficultly that your new users are facing, the following comprise my attempts to get IJulia installed:

∃!isisⒶwintermute:~ ∴ julia
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "help()" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.3.2
 _/ |\__'_|_|_|\__'_|  |
|__/                   |  x86_64-linux-gnu

julia> Pkg.status()
ERROR: unable to read directory METADATA: No such file or directory
 in readdir1838 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in status at ./pkg/entry.jl:107
 in anonymous at ./pkg/dir.jl:28
 in cd1904 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in cd at ./pkg/dir.jl:28
 in status at ./pkg.jl:28 (repeats 2 times)

julia> quit()

∃!isisⒶwintermute:~ ∴ ls .julia
∃!isisⒶwintermute:~ ∴ mkdir .julia/v0.3
∃!isisⒶwintermute:~ ∴ cd .julia/v0.3
∃!isisⒶwintermute:~/.julia/v0.3 ∴ torsocks git clone git://github.com/JuliaLang/METADATA.jl
Cloning into 'METADATA.jl'...
remote: Counting objects: 35783, done.
remote: Compressing objects: 100% (68/68), done.
remote: Total 35783 (delta 14), reused 0 (delta 0), pack-reused 35699
Receiving objects: 100% (35783/35783), 4.34 MiB | 118.00 KiB/s, done.
Resolving deltas: 100% (8455/8455), done.
Checking connectivity... done.
∃!isisⒶwintermute:~/.julia/v0.3 ∴ julia
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "help()" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.3.2
 _/ |\__'_|_|_|\__'_|  |
|__/                   |  x86_64-linux-gnu

julia> Pkg.status()
ERROR: unable to read directory METADATA: No such file or directory
 in readdir1838 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in status at ./pkg/entry.jl:107
 in anonymous at ./pkg/dir.jl:28
 in cd1904 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in cd at ./pkg/dir.jl:28
 in status at ./pkg.jl:28 (repeats 2 times)

julia> quit()

∃!isisⒶwintermute:~/.julia/v0.3 ∴ cd METADATA.jl/
∃!isisⒶwintermute:(metadata-v2=)~/.julia/v0.3/METADATA.jl ∴ cat IJulia/url                                
git://github.com/JuliaLang/IJulia.jl.git
∃!isisⒶwintermute:(metadata-v2=)~/.julia/v0.3/METADATA.jl ∴ cd ..
∃!isisⒶwintermute:~/.julia/v0.3 ∴ torsocks git clone https://github.com/JuliaLang/IJulia.jl
Cloning into 'IJulia.jl'...
remote: Counting objects: 1396, done.
remote: Total 1396 (delta 0), reused 0 (delta 0), pack-reused 1396
Receiving objects: 100% (1396/1396), 616.39 KiB | 117.00 KiB/s, done.
Resolving deltas: 100% (796/796), done.
Checking connectivity... done.
∃!isisⒶwintermute:~/.julia/v0.3 ∴ julia
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "help()" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.3.2
 _/ |\__'_|_|_|\__'_|  |
|__/                   |  x86_64-linux-gnu

julia> Pkg.status()
ERROR: unable to read directory METADATA: No such file or directory
 in readdir1838 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in status at ./pkg/entry.jl:107
 in anonymous at ./pkg/dir.jl:28
 in cd1904 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in cd at ./pkg/dir.jl:28
 in status at ./pkg.jl:28 (repeats 2 times)

julia> quit()
∃!isisⒶwintermute:~/.julia/v0.3 ∴ mv METADATA.jl METADATA
∃!isisⒶwintermute:~/.julia/v0.3 ∴ julia
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "help()" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.3.2
 _/ |\__'_|_|_|\__'_|  |
|__/                   |  x86_64-linux-gnu

julia> Pkg.status()
1 additional packages:
 - IJulia.jl                     0.0.0-             master (unregistered)

julia> Pkg.add("IJulia")
INFO: Cloning cache of BinDeps from git://github.com/JuliaLang/BinDeps.jl.git
^CERROR: unlink: no such file or directory (ENOENT)
 in wait1743 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in wait1783 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in wait at ./task.jl:48
 in sync_end1865 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in add at ./pkg/entry.jl:65
 in add at ./pkg/entry.jl:71
 in anonymous at ./pkg/dir.jl:28
 in cd1904 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in __cd#227__1872 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in add at ./pkg.jl:20

julia> quit()

∃!isisⒶwintermute:~/.julia/v0.3 ∴ torsocks git clone https://github.com/JuliaLang/BinDeps.jl BinDeps
Cloning into 'BinDeps'...
remote: Counting objects: 666, done.
remote: Total 666 (delta 0), reused 0 (delta 0), pack-reused 666
Receiving objects: 100% (666/666), 153.41 KiB | 79.00 KiB/s, done.
Resolving deltas: 100% (347/347), done.
Checking connectivity... done.
∃!isisⒶwintermute:~/.julia/v0.3 ∴ julia
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "help()" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.3.2
 _/ |\__'_|_|_|\__'_|  |
|__/                   |  x86_64-linux-gnu

julia> Pkg.add("IJulia")
INFO: Cloning cache of Compat from git://github.com/JuliaLang/Compat.jl.git
^CERROR: unlink: no such file or directory (ENOENT)
 in wait1743 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in wait1783 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in wait at ./task.jl:48
 in sync_end1865 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in add at ./pkg/entry.jl:65
 in add at ./pkg/entry.jl:71
 in anonymous at ./pkg/dir.jl:28
 in cd1904 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in __cd#227__1872 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in add at ./pkg.jl:20

julia> quit()
∃!isisⒶwintermute:~/.julia/v0.3 ∴ torsocks git clone https://github.com/JuliaLang/Compat.jl Compat
Cloning into 'Compat'...
remote: Counting objects: 355, done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 355 (delta 0), reused 0 (delta 0), pack-reused 349
Receiving objects: 100% (355/355), 62.84 KiB | 41.00 KiB/s, done.
Resolving deltas: 100% (155/155), done.
Checking connectivity... done.
∃!isisⒶwintermute:~/.julia/v0.3 ∴ julia
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "help()" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.3.2
 _/ |\__'_|_|_|\__'_|  |
|__/                   |  x86_64-linux-gnu

julia> Pkg.add("IJulia")
INFO: Cloning cache of IJulia from git://github.com/JuliaLang/IJulia.jl.git
fatal: unable to connect to github.com:
github.com[0: 192.30.252.131]: errno=Connection timed out

ERROR: unlink: no such file or directory (ENOENT)
 in wait1743 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in wait1783 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in wait at ./task.jl:48
 in sync_end1865 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in add at ./pkg/entry.jl:65
 in add at ./pkg/entry.jl:71
 in anonymous at ./pkg/dir.jl:28
 in cd1904 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in __cd#227__1872 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in add at ./pkg.jl:20

julia> quit()
∃!isisⒶwintermute:~/.julia/v0.3 ∴ mv IJulia.jl IJulia
∃!isisⒶwintermute:~/.julia/v0.3 ∴ julia
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "help()" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.3.2
 _/ |\__'_|_|_|\__'_|  |
|__/                   |  x86_64-linux-gnu

julia> Pkg.add("IJulia")
INFO: Cloning cache of JSON from git://github.com/JuliaLang/JSON.jl.git
^CERROR: unlink: no such file or directory (ENOENT)
 in wait at ./task.jl:53
 in sync_end1865 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in add at ./pkg/entry.jl:65
 in add at ./pkg/entry.jl:71
 in anonymous at ./pkg/dir.jl:28
 in cd1904 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in __cd#227__1872 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in add at ./pkg.jl:20

julia> quit()
∃!isisⒶwintermute:~/.julia/v0.3 ∴ torsocks git clone https://github.com/JuliaLang/JSON.jl.git JSON
Cloning into 'JSON'...
remote: Counting objects: 652, done.
remote: Total 652 (delta 0), reused 0 (delta 0), pack-reused 652
Receiving objects: 100% (652/652), 129.70 KiB | 29.00 KiB/s, done.
Resolving deltas: 100% (244/244), done.
Checking connectivity... done.
∃!isisⒶwintermute:~/.julia/v0.3 ∴ julia
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "help()" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.3.2
 _/ |\__'_|_|_|\__'_|  |
|__/                   |  x86_64-linux-gnu

julia> Pkg.add("IJulia")
INFO: Cloning cache of Nettle from git://github.com/staticfloat/Nettle.jl.git
^CERROR: unlink: no such file or directory (ENOENT)
 in wait at ./task.jl:53
 in sync_end1865 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in add at ./pkg/entry.jl:65
 in add at ./pkg/entry.jl:71
 in anonymous at ./pkg/dir.jl:28
 in cd1904 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in __cd#227__1872 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in add at ./pkg.jl:20

julia> quit()
∃!isisⒶwintermute:~/.julia/v0.3 ∴ torsocks git clone https://github.com/staticfloat/Nettle.jl.git Nettle
Cloning into 'Nettle'...
remote: Counting objects: 239, done.
remote: Total 239 (delta 0), reused 0 (delta 0), pack-reused 239
Receiving objects: 100% (239/239), 36.56 KiB | 43.00 KiB/s, done.
Resolving deltas: 100% (97/97), done.
Checking connectivity... done.
∃!isisⒶwintermute:~/.julia/v0.3 ∴ julia
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "help()" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.3.2
 _/ |\__'_|_|_|\__'_|  |
|__/                   |  x86_64-linux-gnu

julia> Pkg.add("IJulia")
INFO: Cloning cache of REPLCompletions from git://github.com/Keno/REPLCompletions.jl.git
^CERROR: unlink: no such file or directory (ENOENT)
 in wait at ./task.jl:53
 in sync_end1865 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in add at ./pkg/entry.jl:65
 in add at ./pkg/entry.jl:71
 in anonymous at ./pkg/dir.jl:28
 in cd1904 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in __cd#227__1872 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in add at ./pkg.jl:20

julia> quit()
∃!isisⒶwintermute:~/.julia/v0.3 ∴ torsocks git clone https://github.com/Keno/REPLCompletions.jl.git REPLCompletions
Cloning into 'REPLCompletions'...
remote: Counting objects: 87, done.
remote: Total 87 (delta 0), reused 0 (delta 0), pack-reused 87
Unpacking objects: 100% (87/87), done.
Checking connectivity... done.
∃!isisⒶwintermute:~/.julia/v0.3 ∴ julia
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "help()" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.3.2
 _/ |\__'_|_|_|\__'_|  |
|__/                   |  x86_64-linux-gnu

julia> Pkg.add("IJulia")
INFO: Cloning cache of SHA from git://github.com/staticfloat/SHA.jl.git
^CERROR: rmdir: No such file or directory
 in wait at ./task.jl:53
 in sync_end1865 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in add at ./pkg/entry.jl:65
 in add at ./pkg/entry.jl:71
 in anonymous at ./pkg/dir.jl:28
 in cd1904 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in __cd#227__1872 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in add at ./pkg.jl:20

julia> quit()
∃!isisⒶwintermute:~/.julia/v0.3 ∴ torsocks git clone https://github.com/staticfloat/SHA.jl.git SHA
Cloning into 'SHA'...
remote: Counting objects: 88, done.
remote: Total 88 (delta 0), reused 0 (delta 0), pack-reused 88
Unpacking objects: 100% (88/88), done.
Checking connectivity... done.
∃!isisⒶwintermute:~/.julia/v0.3 ∴ julia
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "help()" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.3.2
 _/ |\__'_|_|_|\__'_|  |
|__/                   |  x86_64-linux-gnu

julia> Pkg.add("IJulia")
INFO: Cloning cache of URIParser from git://github.com/JuliaWeb/URIParser.jl.git
^CERROR: unlink: no such file or directory (ENOENT)
 in wait at ./task.jl:53
 in sync_end1865 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in add at ./pkg/entry.jl:65
 in add at ./pkg/entry.jl:71
 in anonymous at ./pkg/dir.jl:28
 in cd1904 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in __cd#227__1872 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in add at ./pkg.jl:20

julia> quit()
∃!isisⒶwintermute:~/.julia/v0.3 ∴ torsocks git clone https://github.com/JuliaWeb/URIParser.jl.git URIParser
Cloning into 'URIParser'...
remote: Counting objects: 141, done.
remote: Total 141 (delta 0), reused 0 (delta 0), pack-reused 141
Receiving objects: 100% (141/141), 27.01 KiB | 29.00 KiB/s, done.
Resolving deltas: 100% (66/66), done.
Checking connectivity... done.
∃!isisⒶwintermute:~/.julia/v0.3 ∴ julia
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "help()" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.3.2
 _/ |\__'_|_|_|\__'_|  |
|__/                   |  x86_64-linux-gnu

julia> Pkg.add("IJulia")
INFO: Cloning cache of ZMQ from git://github.com/JuliaLang/ZMQ.jl.git
^CERROR: unlink: no such file or directory (ENOENT)
 in wait at ./task.jl:53
 in sync_end1865 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in add at ./pkg/entry.jl:65
 in add at ./pkg/entry.jl:71
 in anonymous at ./pkg/dir.jl:28
 in cd1904 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in __cd#227__1872 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in add at ./pkg.jl:20

julia> quit()
∃!isisⒶwintermute:~/.julia/v0.3 ∴ torsocks git clone https://github.com/JuliaLang/ZMQ.jl.git ZMQ
Cloning into 'ZMQ'...
remote: Counting objects: 419, done.
remote: Total 419 (delta 0), reused 0 (delta 0), pack-reused 419
Receiving objects: 100% (419/419), 78.68 KiB | 41.00 KiB/s, done.
Resolving deltas: 100% (168/168), done.
Checking connectivity... done.
∃!isisⒶwintermute:~/.julia/v0.3 ∴ julia
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "help()" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.3.2
 _/ |\__'_|_|_|\__'_|  |
|__/                   |  x86_64-linux-gnu

julia> Pkg.add("IJulia")
INFO: No packages to install, update or remove
INFO: Package database updated
^CERROR: interrupt
 in wait at ./task.jl:53
 in sync_end1865 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in add at ./pkg/entry.jl:65
 in add at ./pkg/entry.jl:71
 in anonymous at ./pkg/dir.jl:28
 in cd1904 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in __cd#227__1872 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in add at ./pkg.jl:20

julia> Pkg.add("IJulia")
INFO: Nothing to be done

^CINFO: METADATA might be out-of-date — you may not have the latest version of IJulia
INFO: Use `Pkg.update()` to get the latest versions of your packages

julia> Pkg.update()
INFO: Updating METADATA...
^CERROR: interrupt
 in process_events1743 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in wait1743 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in wait1783 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in stream_wait1760 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in wait1760 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in success at ./process.jl:493
 in run at ./pkg/git.jl:22
 in anonymous at ./pkg/entry.jl:246
 in with_env at ./env.jl:177
 in anonymous at ./pkg/entry.jl:245
 in cd1904 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in update1904 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in anonymous at ./pkg/dir.jl:28
 in cd1904 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in __cd#227__1872 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in update1871 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so (repeats 2 times)

julia> Pkg.update()
INFO: Updating METADATA...
^CERROR: interrupt
 in process_events1743 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in wait1743 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in wait1783 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in stream_wait1760 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in wait1760 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in success at ./process.jl:493
 in run at ./pkg/git.jl:22
 in anonymous at ./pkg/entry.jl:246
 in with_env at ./env.jl:177
 in anonymous at ./pkg/entry.jl:245
 in cd1904 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in update1904 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in anonymous at ./pkg/dir.jl:28
 in cd1904 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in __cd#227__1872 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
 in update1871 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so (repeats 2 times)

(Towards the end, the "Updating METADATA" task merely hung indefinitely, with no signs of network activity.)

Long story short, I did get IJulia installed and working… but it was painful.

I really love the design of Julia, but I fear that treating new users like this is going to make many who come to your community, excited to try a new language, give up quickly thinking that the language is buggy and incomplete, or still too young for serious work.

@tkelman
Copy link
Contributor

tkelman commented Apr 5, 2015

Welcome. What we're shortest on is qualified labor. We've had a to-do item to rewrite our package manager using libgit2 instead of shelling out to command-line git, that is going exceptionally slowly for lack of anyone working on it. I'm guessing/assuming that would help here, but I'm not absolutely sure.

I believe the majority of the shelling-out to git happens here: https://github.com/JuliaLang/julia/blob/master/base/pkg/git.jl so if you have a local from-source build, you can try modifying the commands that get created there to add the extra proxy wrapper. Hopefully there's a more general solution for this issue but that'll need someone who knows what they're talking about. Sounds like you do, so PR's would be great if you have suggestions.

@tkelman tkelman added the packages Package management and loading label Apr 5, 2015
@ihnorton
Copy link
Member

ihnorton commented Apr 6, 2015

I suggest, for Julia users like myself with restricted connections, that Julia adopt support for respecting system proxy settings, as well as support for both HTTP and SOCKS proxies.

As far as I can tell (corrections welcome), proxy config is basically program-specific on Linux, so I'm not quite sure how this would work. One option is to use redsocks or tsocks. Or for git only, set core.gitproxy to an appropriate helper script (e.g. this one from the LHC-CMS folks, see discussion).

We just shell out to the first "git" found on linux, so you might be able to get away with a helper script such as below (assuming ~/bin has precedence in your PATH; or you could modify your Julia-specific path with ENV["PATH"] = ...)

~/bin/git:

#!/bin/bash
torsocks git "$@"

@isislovecruft
Copy link
Author

I suggest, for Julia users like myself with restricted connections, that Julia adopt support for respecting system proxy settings, as well as support for both HTTP and SOCKS proxies.

As far as I can tell (corrections welcome), proxy config is basically program-specific on Linux, so I'm not quite sure how this would work. One option is to use redsocks or tsocks.

Yes. Both redsocks and tsocks have issues with leaking packets, allowing leaks through file descriptors passed over UNIX sockets, etc, due to the fact that both (IIRC) only wrap connect(). To attempt to amend these issues for Tor users, torsocks was created by @dgoulet, which (as of version 2.0) does full syscall proxying and filtering. The standard way to use it is unfortunately with some LD_PRELOAD magics, which seems to be causing some trouble, possibly with one of Julia's shared libraries?

∃!isisⒶwintermute:~ ∴ torsocks julia
[Apr 06 00:19:45] WARNING torsocks[25228]: [syscall] Unsupported syscall number 293. Denying the call (in tsocks_syscall() at syscall.c:237)
[Apr 06 00:19:45] WARNING torsocks[25228]: [syscall] Unsupported syscall number 291. Denying the call (in tsocks_syscall() at syscall.c:237)
[Apr 06 00:19:45] WARNING torsocks[25228]: [syscall] Unsupported syscall number 213. Denying the call (in tsocks_syscall() at syscall.c:237)
Segmentation fault
∃!isisⒶwintermute:~ ∴ 

dmesg reported:

[233229.662624] julia[25228] segfault at 18 ip 00007f6547a03d9b sp 00007ffcf9e19cd0 error 4 in libjulia.so[7f654793c000+11d000] 

(This is with Julia packaged from Debian Jessie, however I'm totally willing to stop being lazy and compile Julia from source in order to further debug.)

Hence the above lengthy process of fetching the requisite dependencies manually.

Using your idea to proxy the first git on Julia's PATH worked (however, the path to the real git in the wrapper script must be absolute, i.e. /usr/bin/git, to avoid infinite recursion resulting from git internally shelling out to itself in various git commands):

∃!isisⒶwintermute:~/.julia ∴ cat /usr/local/bin/git
#!/bin/bash

/usr/local/bin/torsocks /usr/bin/git "$@"
exit $?
∃!isisⒶwintermute:~/.julia ∴ julia
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "help()" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.3.2
 _/ |\__'_|_|_|\__'_|  |  
|__/                   |  x86_64-linux-gnu

julia> Pkg.status()
1 required packages:
 - IJulia                        0.2.1+             master
8 additional packages:
 - BinDeps                       0.3.9              master
 - Compat                        0.3.6+             master
 - JSON                          0.4.2              master
 - Nettle                        0.1.8+             master
 - REPLCompletions               0.0.3              master
 - SHA                           0.0.4              master
 - URIParser                     0.0.5              master
 - ZMQ                           0.1.17+            master

julia> Pkg.update()
INFO: Updating METADATA...
INFO: Cloning cache of ZMQ from git://github.com/JuliaLang/ZMQ.jl.git
INFO: Cloning cache of IJulia from git://github.com/JuliaLang/IJulia.jl.git
INFO: Cloning cache of Compat from git://github.com/JuliaLang/Compat.jl.git
INFO: Cloning cache of SHA from git://github.com/staticfloat/SHA.jl.git
INFO: Cloning cache of JSON from git://github.com/JuliaLang/JSON.jl.git
INFO: Cloning cache of REPLCompletions from git://github.com/Keno/REPLCompletions.jl.git
INFO: Cloning cache of URIParser from git://github.com/JuliaWeb/URIParser.jl.git
INFO: Cloning cache of Nettle from git://github.com/staticfloat/Nettle.jl.git
INFO: Cloning cache of BinDeps from git://github.com/JuliaLang/BinDeps.jl.git
INFO: Updating JSON...
INFO: Updating SHA...
INFO: Updating ZMQ...
INFO: Updating Compat...
INFO: Updating BinDeps...
INFO: Updating REPLCompletions...
INFO: Updating URIParser...
INFO: Updating IJulia...
INFO: Updating Nettle...
INFO: Computing changes...
INFO: No packages to install, update or remove

julia> quit()

And combined with having already done git config --global url."https://".insteadOf git://, the remote URIs for the dependencies remained in their https:// forms from the above manual dependency cloning:

∃!isisⒶwintermute:~/.julia ∴ cd v0.3/ZMQ/
∃!isisⒶwintermute:(master=)~/.julia/v0.3/ZMQ ∴ git remote -v
origin  https://github.com/JuliaLang/ZMQ.jl.git (fetch)
origin  https://github.com/JuliaLang/ZMQ.jl.git (push)

This is a bit hacky… Perhaps it is possible for some more elegant solution? Also, that segmentation fault is a bit troubling.

@ihnorton
Copy link
Member

ihnorton commented Apr 6, 2015

Thanks for the patient explanation. The reason I noticed redsocks was that the suggested setup is to configure an iptable rule so that it will apply transparently for all programs. I guess that would be pointless with torsocks.

that segmentation fault is a bit troubling.
(This is with Julia packaged from Debian Jessie, however I'm totally willing to stop being lazy and compile Julia from source in order to further debug.)

Looks like someone else has seen this with a libuv-based project. So the segfault may be upstream. If you want to debug the libuv side, we could take a patch for that on our fork (and try to get it upstreamed). Beyond that though, I could imagine that pipe2 is not a syscall that torsocks wants to support...

@isislovecruft
Copy link
Author

@lhnorton Re:

Beyond that though, I could imagine that `pipe2

Perhaps GH ate the end of your comment?

@ihnorton
Copy link
Member

ihnorton commented Apr 6, 2015

Sorry about that, I accidentally hit some magic key combo and then edited in-place. Now in the web view it reads:

"I could imagine that pipe2 is not a syscall that torsocks wants to support."

Or at least, might not be -- due to the concern about compromised syscalls.

@ihnorton
Copy link
Member

ihnorton commented Apr 6, 2015

Do you have any suggestions for what a more elegant solution might look like? It seems there are issues with all available tools from either a security-hardening or compatibility standpoint... (?)

I would say that anyone in a situation where compromised syscalls could be a physical or livelihood threat should probably not be installing packages from METADATA automatically right now, and not at all without doing your own code review.

@Yawning
Copy link

Yawning commented Apr 7, 2015

@isislovecruft made me look at this.

Since I never used this before, and don't particularly have the time to learn all about it, is this the expected behaviour, starting from a fresh install?

ypres :: ~ % torsocks julia                                                     
[Apr 07 12:13:30] WARNING torsocks[12962]: [syscall] Unsupported syscall number 293. Denying the call (in tsocks_syscall() at syscall.c:465)
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "help()" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.3.7 (2015-03-23 21:36 UTC)
 _/ |\__'_|_|_|\__'_|  |  
|__/                   |  x86_64-unknown-linux-gnu

julia> Pkg.status()
INFO: Initializing package repository /home/yawning/.julia/v0.3
INFO: Cloning METADATA from git://github.com/JuliaLang/METADATA.jl
No packages installed

julia> 

There's a bunch of files that appear in the subdirectory, and and my tor traffic momentarily spikes, so I assume it's doing the right thing.... If so, I have a bunch of torsocks patches that make this work.

This might be enough: https://github.com/Yawning/torsocks-git-hax/blob/master/bug13294.patch
If not, apply the rest of the patches since they fix various other bits of torsocks brain damage.

NB:

  • The regression tests bundled as part of your libuv do not pass, so things may in fact be horrifically broken by torsocks. I don't have time to debug this.
  • Using syscall(2) to call routines that have perfectly functional libc methods a la libuv/src/unix/linux-syscalls.c is arguably rather silly as well. epoll/inotify/eventfd are old to the point where you'd have to be using a glibc from ~2008 to be missing libc support for them....

@StefanKarpinski
Copy link
Member

That's pretty normal behavior, aside from the torsocks warning, obviously. Julia itself doesn't use syscall(2) – libuv does, presumably for good reasons (probably involving cross-platform portability).

@tkelman
Copy link
Contributor

tkelman commented Apr 7, 2015

Thanks for the input @Yawning. The fact that our libuv fork doesn't pass its tests is a known bug, JuliaLang/libuv#29 - that would be ideally fixed by upstreaming our pipe API changes so we no longer need to use a fork.

@Yawning
Copy link

Yawning commented Apr 7, 2015

@tkelman No problem. I'm a bit worried that I might have broke additional things since less of the tests pass (beyond the expected udp test failures), so someone should evaluate if tcp networking from within julia itself still works when run through the patched torsocks. But if the usage pattern is "only run it through torsocks when updating packages, this is less of a concern, since the git client that's being fork/execed will work.

The torsocks warning that appears is harmless since the libuv code itself falls back to using pipe when the pipe2 syscall is unavailable.

@ViralBShah
Copy link
Member

Perhaps #17783 may help here.

@ViralBShah
Copy link
Member

Fixed by #17783.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packages Package management and loading
Projects
None yet
Development

No branches or pull requests

6 participants