Hi everyone! I’m currently trying to install pants...
# general
l
Hi everyone! I’m currently trying to install pants onto my mac through “brew install pantsbuild/tap/pants” which runs successfully. When I try any pants command after though I’m met with the following response. What could be the reason?
c
That looks like it could be permissions issues perhaps. 🤔
f
The SSL error at the top of that screenshot seems relevant.
Is there some sort of web proxy in between your machine and GitHub?
The "self-signed certificate in certificate chain" part seems relevant.
Also, are you able to
curl
/
wget
that URL in the error?
l
When I run this code on the same machine and network i receive a 200 response
w
Are you able to
brew install
other things? And as tdyas asked, can you
curl
it? Normally this would imply some sort of ssl error, which is generally outside the reach of us
e.g. timestamp mismatch on your computer, proxy, etc.
l
Sorry for the delay, yes I am able to brew install other things and I was able to establish connection to that url via curl
b
Hi Pants team, we were able to make it work by downloading a previous version of pants binary using the formula from here. The giveaway was the part of the documentation where it talks about scie-pants having its own interpreter and the fact that this version was working on my machine under the same corporate setup. Maybe the packed interpreter is not respecting CA certs from the machine or from
pants.toml
? Worth taking a look?
w
Which "previous version" did you install, and what was the installed version that was problematic?
b
The version 0.12.0 binary was having a problem (I think that’s the latest) and the “previous version” that we installed is 0.11.0 (linked the homebrew formula file above). Older versions e.g. 0.8.2 that some of the other teammates are using are working fine too. So it’s not about a specific version that works but about a specific version that doesn’t work which, to me, seems to be 0.12.0.
w
@curved-television-6568 @broad-processor-92400 Anything that might have changed? 2.16 on the latest
pants
works fine for me, but I have an ARM mac
b
We have a mixture of Apple & Intel Macs and it was failing on both.
w
https://github.com/pantsbuild/scie-pants/compare/v0.11.0...v0.12.0 🤷 Updated pex and switched to
ureq
- not sure if there is some other TLS stuff we should be doing https://github.com/algesten/ureq
b
Sorry for the trouble. If you haven’t found these possibilities for workarounds already: • you can install a specific version of the scie-pants builder using
get-pants.sh --version 0.11.0
or similar (script from https://www.pantsbuild.org/2.21/docs/getting-started/installing-pants) • You can override the urls that scie-pants uses to find artefacts, if you have an internal artefact store https://github.com/pantsbuild/scie-pants?tab=readme-ov-file#firewall-support I’ll have to look at the specific problem in more detail later, though.
b
@broad-processor-92400 thanks for the inputs. We installed a specific version by first downloading the
.rb
file (linked in my message above) and then running
brew install <location-of-downloaded-rb-file>
. That should be ok, right? Can we have a behavior where one could install thru
brew install pants@version
? Regarding overriding URLs for
scie-pants
, that’s very useful to know. Thank you. However, the problem that we were facing was that pants was unable to download the
pex
file to bootstrap. We were able to download the same file on the same computer and network thru
requests.get()
. So, to me it looks like a pants issue and not certs or URL issue. Please correct me if that understanding is not right.
@wide-midnight-78598 thank you for the comparison link, not sure I understand it full 🫣. However, could you please confirm the Python version you tested 0.12.0 with on Apple silicon Mac?
w
Yes, I'm always on the latest versions. So, on mac, WSL for windows, and my linux box are all running pants 12 right now
b
Sorry but I asked which Python version did you test it with?
w
Oh, ha! I transposed the two. I use anywhere from 3.9 to 3.12 depending on the project
👍 1
b
However, the problem that we were facing was that pants was unable to download the
pex
file to bootstrap
Given the error message is talking about a self signed certificate and failing, I imagine it’s something about the network setup the blocks the installer from validating the security of the connection when attempting to download the
pex
file for bootstrapping. Overriding these urls may mean that you can sidestep this connection issue by letting you fully control where they come from.
I agree that it may be something particular to how scie-pants is configured for doing downloads, but we can still tweak how the downloads happen (e.g. change URLs) to side step this.
I suspect the root cause in 0.12.0 is https://github.com/pantsbuild/scie-pants/commit/89981cd87c46b898a96dbe464e1182896c9df8e2#diff-897b8ef6086542f1a230874[…]90ae73352cf399771e4ccc82dR26 (The ureq change only affects building scie-pants itself, not running it, just confirmed now) Behaviour change from
PANTS_PEX_GITHUB_RELEASE_VERSION
changing from
2.18.0.dev5
to
2.0.0.dev0
: • scie-pants 0.11.0: Pants 2.16 installed from PyPI • scie-pants 0.12.0: Pants 2.16 installed by downloading from GitHub releases So, it seems something about downloading from GitHub releases doesn't work.
The download happens via https://github.com/a-scie/ptex (https://github.com/pantsbuild/scie-pants/blob/a51ecf4af908ec9c9388b1d009c15d39f6e41f94/tools/src/scie_pants/ptex.py) Scie-pants currently uses ptex v0.7.0 (https://github.com/pantsbuild/scie-pants/blob/a51ecf4af908ec9c9388b1d009c15d39f6e41f94/package/scie-pants.toml#L11) So, that'd be where to start debugging: 1. Download ptex for your platform: https://github.com/a-scie/ptex/releases/tag/v0.7.0 2. Run
ptex <https://github.com/pantsbuild/pants/releases/download/release_2.16.0/pants.2.16.0-cp39-darwin_x86_64.pex> > /dev/null
and see what happens 3. Assuming you can reproduce, do the normal debugging things like trying newer versions, search ptex's issue tracker, looking at the code
w
• scie-pants 0.11.0: Pants 2.16 installed from PyPI
• scie-pants 0.12.0: Pants 2.16 installed by downloading from GitHub releases
Wow, good spot. I didn't see that at all.
b
All good: I reviewed that change (and made the ureq one), so I had more background for guessing what's relevant and what's not 😅
😆 1
c
For cert issues this may be relevant: https://github.com/pantsbuild/scie-pants/issues/403
👍 2
b
> Given the error message is talking about a self signed certificate and failing, I imagine it’s something about the network setup the blocks the installer from validating the security of the connection when attempting to download the
pex
file for bootstrapping. > Overriding these urls may mean that you can sidestep this connection issue by letting you fully control where they come from. Even though we were able to download the
pex
from the same URL through Python requests from the same terminal window where
pants
was failing? Just trying to understand the details. I am not aware what could be an alternate URL to download
pex
to bootstrap
b
Yeah, Python on the terminal may be reading different certificates etc, so the terminal Python is using the correct network configuration while the scie-pants one does not.
The alternative url would be ones you configure: 1. download the pants pex artifacts in question (from pants’ GitHub releases) 2. put them somewhere you control/can connect to 3. Configure those as the bootstrap urls
👍 1
b
May I ask for updates on this? Can we expect an update to resolve this? Another teammate had to downgrade from
0.12.0
to
0.11.0
today to bootstrap.
b
I don’t know of any updates other than what’s in this thread and the issue linked above. Pants is entirely volunteer driven. Are you or your teammates in a position to do any debugging and/or fixing?
b
Thank you. I’d really love to contribute but: 1. I’d need help in finishing the developer setup for Pants. I had attempted this in the past but other things took priority 😞 2. I’d prefer to do this from my personal computer and there’s no way I could reproduce the issue there since it’s not under the same corporate proxy.
b
Ah, okay. Re 1, I think this is in the scie-pants repository, which has less fiddle to get running, I think