I'm trying out the <2>.28.0dev1 build of pants, an...
# general
b
I'm trying out the 2.28.0dev1 build of pants, and am looking to add ruff. When I run
pants lint ::
, it tries to download the ruff tarball. However, I believe the url gives a redirect; e.g. I can wget it, but with curl, I need to use -L to follow redirects. When running
pants lint ::
, it tried downloading the file but gets stuck and never finishes. I am in a corporate environment with a proxy, but I have http_proxy, https_proxy, etc. configured. I believe pants passes these value as well as ca cert dir and file to subprocesses. Is there a way I can tell pants to follow the redirect?
actually, not even sure about the redirect. But yeah... pants lint :: is hanging on the download for me. even tries adding a
Copy code
[subproces-environment]
env_vars.add = ["http_proxy", "https_proxy"]
no joy.
h
Pants should follow the redirect, so I assume this is an issue with your corp network environment
e
Having recently gone through some of this, you might want to try
env_vars.add = ["http_proxy", "https_proxy", "HTTP_PROXY", "HTTPS_PROXY"]
since I have come to understand that those proxy vars are not well standardized, and some tools use capitalized variants and some require lowercase
b
Tried the options on that page as well as all four vars... Still no joy. Is there an option of printing out the low level logs for the download? I'm using print stack trace and ldebug, and I can see in the logs that the nails client sending initialization chunk includes the proxy vars. But can't figure out why the download is stalling.
Hmm... I cleared the nce cache and then tried in a new repo. It's failing to download the cpython installer. If I curl the url, I get a 0 byte file. Wget works. Curl -L also works... I think it's a redirect that curl doesn't follow unless -L is provided. Right now, any pants command is failing trying to download cpython. Any ideas?
w
Is this the cpython located in github? As part of the bootstrapping process? e.g. when scie-pants tries to download it?
I guess my question is - is this BEFORE pants takes over, as in, this is an issue with the launcher (from the sounds of it)
b
I think it is. Was just looking through the pants code... What does pants use to download stuff? Eg pants itself in this case (looks like it's part of bootstrapping to download cpython, etc). But then when I got it manually installed before, if I set the liner to rust, it also failed to install rust. I'd like to isolate the problem as to where the issue is with the proxy. It looks like ptex is used for downloading. Is this correct? I've got http_proxy and the related env vars set... So it does look like the downloader isn't handling the redirects properly.
Fwiw, the curl --proto htts.... Get-pants.sh file to install pants works fine. It's when I run pants that I run into issues as it's not following the redirects.
I see references to ptex. Is this tool part of pants, or something outside? Can't seem to find documentation on it
w
Part of the
a-scie/lift
a-scie/ptex
a-scie/science
projects But yeah, I assumed that's where the grief was coming from. I don't know off the top of my head if there is built-in re-directs there, but I was also hoping we built fat scie-pants releases too (comes with python and maybe pants already). Looks like we don't. See: https://github.com/pantsbuild/scie-pants/issues/154#issuecomment-1565630394
b
Hmm... Creating an issue in scie-pants to discuss properly.
w
👍 I do think we should release fat scies alongside lazy ones - shouldn't be too hard grand scheme, and if you want to try it out, you can use what John mentioned in that ticket to generate one probably
b
Created issue created https://github.com/pantsbuild/scie-pants/issues/467. While fat scies can help, I had the same issue when setting ruff as a linter without having ruff installed. It tried to download and failed.