asdf-community / asdf-python

Python plugin for the asdf version manager
https://github.com/asdf-vm/asdf
MIT License
651 stars 56 forks source link

Ability to Utilize Proxies for Downloading Source #107

Open MrPaulAR opened 3 years ago

MrPaulAR commented 3 years ago

Is your feature request related to a problem? Please describe

When asdf runs curl it doesn't seem to be honoring the ~/.curlrc file. I've got a .curlrc file defined and curl itself works fine but when asdf launches curl this doesn't seem to be honored.

Logs from asdf

asdf install python 3.9.2
python-build 3.9.2 /home/xxxx/.asdf/installs/python/3.9.2                                                                                                                         
Downloading Python-3.9.2.tar.xz...                                                                                                                                                   
-> https://www.python.org/ftp/python/3.9.2/Python-3.9.2.tar.xz                                                                                                                       
error: failed to download Python-3.9.2.tar.xz                                                                                                                                        

BUILD FAILED (CentOS Linux 7 using python-build 2.0.3-2-g84a65357)                        

Results logged to /tmp/python-build.20210715143150.51079.log                              

Last 10 log lines:                                                                                                                                                                   
/tmp/python-build.20210715143150.51079 ~/git_repos/ansible                                                                                                                           
curl: (7) Failed to connect to 2a04:4e42:2f::223: Network is unreachable  

Validation that curl works

curl -Is https://www.python.org/ftp/python/3.9.2/Python-3.9.2.tar.xz | head -n 1
HTTP/1.0 200 Connection established

Describe the proposed solution

Have curl honor ~/.curlrc

Describe similar asdf features and why they are not sufficient

I've been unable to locate this in the documentation. The server is behind a firewall so I have to use proxies to get to the internet.

Describe other workarounds you've considered

Manually copying the source but I haven't been able to identify a mechanisim to have ASDF point pyenv to a pre-downloaded tarball.

I also see that the asdf curl request is trying to pull from an IPv6 address while the shell is pulling from an IPv4 address (not clear by shell output). This is because I have IPv4 only in my ~/.curlrc which is below.

--proxy http://10.37.26.22:3128
--ipv4