Zulip Chat Archive

Stream: general

Topic: I broke something...


view this post on Zulip Bhavik Mehta (May 12 2020 at 13:36):

I've managed to somehow break my lean setup. I did a mathlib pull, then made a branch and edited a bit. Then I restarted lean in vscode and now I get this:

$ leanpkg build
dyld: Library not loaded: /usr/local/opt/gmp/lib/libgmp.10.dylib
  Referenced from: /Users/bmehta/.elan/toolchains/leanprover-community-lean-3.11.0/bin/lean
  Reason: Incompatible library version: lean requires version 15.0.0 or later, but libgmp.10.dylib provides version 14.0.0
Abort trap: 6

What did I do wrong and how do I fix it?

view this post on Zulip Gabriel Ebner (May 12 2020 at 13:37):

I think you need to install a newer version of gmp.

view this post on Zulip Gabriel Ebner (May 12 2020 at 13:37):

Maybe brew upgrade gmp (I don't have a mac)?

view this post on Zulip Gabriel Ebner (May 12 2020 at 13:38):

This probably related to the new CI setup we're using. The binaries are now built on macos 10.15, and the VM probably has a newer version installed than we had on travis.

view this post on Zulip Bhavik Mehta (May 12 2020 at 13:41):

That seems to have fixed it, thanks!

view this post on Zulip Bhavik Mehta (May 12 2020 at 13:54):

Yikes something else has gone wrong too now...

$ leanproject get-mathlib-cache
Traceback (most recent call last):
  File "/Users/bmehta/.pyenv/versions/usual/bin/leanproject", line 5, in <module>
    from mathlibtools.leanproject import safe_cli
  File "/Users/bmehta/.pyenv/versions/3.6.2/envs/usual/lib/python3.6/site-packages/mathlibtools/leanproject.py", line 9, in <module>
    import paramiko # type: ignore
  File "/Users/bmehta/.pyenv/versions/3.6.2/envs/usual/lib/python3.6/site-packages/paramiko/__init__.py", line 22, in <module>
    from paramiko.transport import SecurityOptions, Transport
  File "/Users/bmehta/.pyenv/versions/3.6.2/envs/usual/lib/python3.6/site-packages/paramiko/transport.py", line 129, in <module>
    class Transport(threading.Thread, ClosingContextManager):
  File "/Users/bmehta/.pyenv/versions/3.6.2/envs/usual/lib/python3.6/site-packages/paramiko/transport.py", line 190, in Transport
    if KexCurve25519.is_available():
  File "/Users/bmehta/.pyenv/versions/3.6.2/envs/usual/lib/python3.6/site-packages/paramiko/kex_curve25519.py", line 30, in is_available
    X25519PrivateKey.generate()
  File "/Users/bmehta/.pyenv/versions/3.6.2/envs/usual/lib/python3.6/site-packages/cryptography/hazmat/primitives/asymmetric/x25519.py", line 38, in generate
    from cryptography.hazmat.backends.openssl.backend import backend
  File "/Users/bmehta/.pyenv/versions/3.6.2/envs/usual/lib/python3.6/site-packages/cryptography/hazmat/backends/openssl/__init__.py", line 7, in <module>
    from cryptography.hazmat.backends.openssl.backend import backend
  File "/Users/bmehta/.pyenv/versions/3.6.2/envs/usual/lib/python3.6/site-packages/cryptography/hazmat/backends/openssl/backend.py", line 75, in <module>
    from cryptography.hazmat.bindings.openssl import binding
  File "/Users/bmehta/.pyenv/versions/3.6.2/envs/usual/lib/python3.6/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 195, in <module>
    Binding.init_static_locks()
  File "/Users/bmehta/.pyenv/versions/3.6.2/envs/usual/lib/python3.6/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 142, in init_static_locks
    __import__("_ssl")
ImportError: dlopen(/Users/bmehta/.pyenv/versions/3.6.2/lib/python3.6/lib-dynload/_ssl.cpython-36m-darwin.so, 2): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
  Referenced from: /Users/bmehta/.pyenv/versions/3.6.2/lib/python3.6/lib-dynload/_ssl.cpython-36m-darwin.so
  Reason: image not found

view this post on Zulip Bhavik Mehta (May 12 2020 at 13:55):

This was in the master branch of mathlib

view this post on Zulip Kevin Buzzard (May 12 2020 at 14:28):

Did you try updating leanproject? It went to 0.0.6 just the other day. But this doesn't look like it has anything to do with it...

view this post on Zulip Bhavik Mehta (May 12 2020 at 14:29):

Seems like my pip is broken too :(

view this post on Zulip Patrick Massot (May 12 2020 at 14:59):

Yes, your python is broken. To be honest, this SSL stuff is a wonderful tool to detect broken systems.

view this post on Zulip Patrick Massot (May 12 2020 at 15:02):

But now I'm really confused because https://github.com/leanprover-community/mathlib-tools/blob/master/mathlibtools/leanproject.py#L8-L16 is meant exactly for this purpose.

view this post on Zulip Patrick Massot (May 12 2020 at 15:03):

Could you run leanproject --version and tell us the answer?

view this post on Zulip Bhavik Mehta (May 12 2020 at 16:46):

What's confusing is that everything worked fine before I did a mathlib pull, and I haven't touched python otherwise

view this post on Zulip Bhavik Mehta (May 12 2020 at 16:47):

$ leanproject --version
Traceback (most recent call last):
  File "/Users/bmehta/.pyenv/versions/usual/bin/leanproject", line 5, in <module>
    from mathlibtools.leanproject import safe_cli
  File "/Users/bmehta/.pyenv/versions/3.6.2/envs/usual/lib/python3.6/site-packages/mathlibtools/leanproject.py", line 9, in <module>
    import paramiko # type: ignore
  File "/Users/bmehta/.pyenv/versions/3.6.2/envs/usual/lib/python3.6/site-packages/paramiko/__init__.py", line 22, in <module>
    from paramiko.transport import SecurityOptions, Transport
  File "/Users/bmehta/.pyenv/versions/3.6.2/envs/usual/lib/python3.6/site-packages/paramiko/transport.py", line 129, in <module>
    class Transport(threading.Thread, ClosingContextManager):
  File "/Users/bmehta/.pyenv/versions/3.6.2/envs/usual/lib/python3.6/site-packages/paramiko/transport.py", line 190, in Transport
    if KexCurve25519.is_available():
  File "/Users/bmehta/.pyenv/versions/3.6.2/envs/usual/lib/python3.6/site-packages/paramiko/kex_curve25519.py", line 30, in is_available
    X25519PrivateKey.generate()
  File "/Users/bmehta/.pyenv/versions/3.6.2/envs/usual/lib/python3.6/site-packages/cryptography/hazmat/primitives/asymmetric/x25519.py", line 38, in generate
    from cryptography.hazmat.backends.openssl.backend import backend
  File "/Users/bmehta/.pyenv/versions/3.6.2/envs/usual/lib/python3.6/site-packages/cryptography/hazmat/backends/openssl/__init__.py", line 7, in <module>
    from cryptography.hazmat.backends.openssl.backend import backend
  File "/Users/bmehta/.pyenv/versions/3.6.2/envs/usual/lib/python3.6/site-packages/cryptography/hazmat/backends/openssl/backend.py", line 75, in <module>
    from cryptography.hazmat.bindings.openssl import binding
  File "/Users/bmehta/.pyenv/versions/3.6.2/envs/usual/lib/python3.6/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 195, in <module>
    Binding.init_static_locks()
  File "/Users/bmehta/.pyenv/versions/3.6.2/envs/usual/lib/python3.6/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 142, in init_static_locks
    __import__("_ssl")
ImportError: dlopen(/Users/bmehta/.pyenv/versions/3.6.2/lib/python3.6/lib-dynload/_ssl.cpython-36m-darwin.so, 2): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
  Referenced from: /Users/bmehta/.pyenv/versions/3.6.2/lib/python3.6/lib-dynload/_ssl.cpython-36m-darwin.so
  Reason: image not found

view this post on Zulip Bhavik Mehta (May 12 2020 at 16:47):

My python environment was working well beforehand, and after that pull everything broke (including tmux, somehow)

view this post on Zulip Gabriel Ebner (May 12 2020 at 16:56):

Maybe the brew upgrade gmp changed something?

view this post on Zulip Bhavik Mehta (May 12 2020 at 16:58):

Yeah I think that's what it is too... I've got tmux working at least

view this post on Zulip Bhavik Mehta (May 12 2020 at 16:59):

Trying to fix my pyenv and pip now

view this post on Zulip Patrick Massot (May 12 2020 at 17:29):

Ah of course you can't run leanprover --version if the imports are broken. Could you check whether /Users/bmehta/.pyenv/versions/3.6.2/envs/usual/lib/python3.6/site-packages/mathlibtools/leanproject.py looks like what is on GitHub?

view this post on Zulip Bhavik Mehta (May 12 2020 at 18:11):

It looks similar but not the same, I have

import sys
import os
import subprocess
from pathlib import Path
from datetime import datetime
from typing import Tuple, Optional

from git.exc import GitCommandError # type: ignore
import paramiko # type: ignore
from paramiko.ssh_exception import AuthenticationException, SSHException # type: ignore

Instead of lines 1-17

view this post on Zulip Bhavik Mehta (May 12 2020 at 18:11):

I think this is a problem with my pip rather than mathlibtools though!

view this post on Zulip Bhavik Mehta (May 12 2020 at 18:31):

It seems like I'm having this problem: https://github.com/kelaberetiv/TagUI/issues/86. It doesn't seem to be related to lean or mathlibtools so I'll stop asking about it here

view this post on Zulip Bhavik Mehta (May 12 2020 at 18:43):

Sorted! Thanks all for help

view this post on Zulip Bhavik Mehta (May 12 2020 at 18:44):

Gabriel Ebner said:

Maybe the brew upgrade gmp changed something?

I think this was the problem, brew upgrade updates everything which brew installed, which bungled a bunch of stuff I had... brew update is what it should have been!

view this post on Zulip Reid Barton (May 12 2020 at 18:45):

Classic

view this post on Zulip Patrick Massot (May 12 2020 at 19:08):

Ok, at least it clears the mystery of why leanproject's defense didn't trigger: you're running an outdated leanproject

view this post on Zulip Patrick Massot (May 12 2020 at 19:09):

Note those are lame defenses: it simply gives up on using SSH in hostile territory

view this post on Zulip Bhavik Mehta (May 12 2020 at 19:09):

Yeah I hadn't updated mathlibtools in a little bit of time

view this post on Zulip Bhavik Mehta (Jul 22 2020 at 14:07):

I've somehow got this error again!

view this post on Zulip Bhavik Mehta (Jul 22 2020 at 14:31):

To fix it I had to uninstall openssl via brew (forcing it to ignore dependencies), and reinstall an older version

view this post on Zulip Bhavik Mehta (Jul 22 2020 at 14:31):

Not pleasant :(

view this post on Zulip Bhavik Mehta (Jul 24 2020 at 14:46):

Alright this is causing issues again. I'm fairly sure it's not an issue with my python now, since the error message (virtually the same as above) is about the imports, but when I try to run any of those imports from a python shell there's no errors

view this post on Zulip Bhavik Mehta (Jul 24 2020 at 14:46):

I'll just go back to using leanpkg I think

view this post on Zulip Patrick Massot (Jul 24 2020 at 15:17):

There is hope. @Matt Earnshaw is trying to help getting rid of the Paramiko dependency.


Last updated: May 13 2021 at 21:12 UTC