mason.nvim icon indicating copy to clipboard operation
mason.nvim copied to clipboard

Customize download process

Open zdufour-asp opened this issue 3 years ago • 5 comments

I've searched open issues for similar requests

  • [X] Yes

Is your feature request related to a problem? Please describe.

curl https://github.com with SSL errors because of a network tool installed on my work laptop, so I ended up needing to point CURL_CA_BUNDLE somewhere.

That fixed curl, and the issues I was having with installing some Mason packages, (namely the ones that get downloaded from github releases), but it breaks a bunch of other stuff that also looks for CURL_CA_BUNDLE for some reason.

Describe the solution you'd like

It'd be nice to be able to pass environment variables to the subprocesses that mason spins up, since Mason is basically the only reason I ever curl github.

Unsure of the exact details of where that should go. Maybe github.shell_env?

Describe potential alternatives you've considered

My current solution is to just set CURL_CA_BUNDLE with let, which seems to break pip, because pip uses CURL_CA_BUNDLE.

Another nifty idea would be to support configuring which CLI tool to use for downloading from github (https github.com from httpie seemed to be working fine without CURL_CA_BUNDLE), although that's kind of a weird feature, and probably less generalizable than being able to inject environment variables.

Additional context

No response

zdufour-asp avatar Aug 11 '22 23:08 zdufour-asp

I have a similar request. Python's language server pyright can be installed using pip or npm. Mason by default installs it using npm. Customizing this behavior is useful as I have to install npm to install pyright using Mason. The alternative to which is to manage pyright manually and remember to update frequently.

With customized downloads , Mason will install pyright using pip/pipx intead of npm.

pspiagicw avatar Aug 16 '22 15:08 pspiagicw

Hello! Hm, out of interest what other errors do you get if you set the CURL_CA_BUNDLE?

I wouldn't mind adding a setting for curl similar to pip to allow injecting extra command arguments.

williamboman avatar Aug 16 '22 21:08 williamboman

Python's language server pyright can be installed using pip or npm.

I didn't know pyright could be installed through pip. Will look into switching as it definitely makes more sense to use pip for a Python tool.

williamboman avatar Aug 16 '22 21:08 williamboman

Hello! Hm, out of interest what other errors do you get if you set the CURL_CA_BUNDLE?

❯ python -m pip install requests
output
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCe
rtVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c
:1091)'))': /simple/requests/
WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCe
rtVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c
:1091)'))': /simple/requests/
WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCe
rtVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c
:1091)'))': /simple/requests/
WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCe
rtVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c
:1091)'))': /simple/requests/
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'SSLError(SSLCe
rtVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c
:1091)'))': /simple/requests/
Could not fetch URL https://pypi.org/simple/requests/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(hos
t='pypi.org', port=443): Max retries exceeded with url: /simple/requests/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: C
ERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1091)'))) - skipping
ERROR: Could not find a version that satisfies the requirement requests (from versions: none)
ERROR: No matching distribution found for requests
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confirming the ssl certificate: HTTPSConnectionPool(host='py
pi.org', port=443): Max retries exceeded with url: /simple/pip/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE
_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1091)'))) - skipping
</details>

zdufour-asp avatar Aug 17 '22 16:08 zdufour-asp

@williamboman , I'm guessing the issue in my specific case is that netskope is configured to man-in-the-middle github.com but not pypi.org, although I'm not sure (tbh, I don't really understand what netskope does or what its value is -- I just know that our IT peeps think it's good to have)

zdufour-asp avatar Aug 17 '22 17:08 zdufour-asp