Closed Bug 1660243 Opened 4 years ago Closed 4 years ago

Can't create python2 mach environment based on homebrew python2 so can't run tests (ValueError: unsupported hash type md5)

Categories

(Firefox Build System :: General, defect)

Unspecified
macOS
defect

Tracking

(Not tracked)

RESOLVED INVALID

People

(Reporter: Gijs, Unassigned)

References

(Blocks 1 open bug)

Details

Output for the python2 part:

Python 3 mach environment created.
ERROR:root:code for hash md5 was not found.
Traceback (most recent call last):
  File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type md5
ERROR:root:code for hash sha1 was not found.
Traceback (most recent call last):
  File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha1
ERROR:root:code for hash sha224 was not found.
Traceback (most recent call last):
  File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha224
ERROR:root:code for hash sha256 was not found.
Traceback (most recent call last):
  File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha256
ERROR:root:code for hash sha384 was not found.
Traceback (most recent call last):
  File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha384
ERROR:root:code for hash sha512 was not found.
Traceback (most recent call last):
  File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 147, in <module>
    globals()[__func_name] = __get_hash(__func_name)
  File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
    raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha512
Traceback (most recent call last):
  File "path/to/mozilla-central/mach", line 258, in <module>
    main(sys.argv[1:])
  File "path/to/mozilla-central/mach", line 250, in main
    mach = get_mach()
  File "path/to/mozilla-central/mach", line 240, in get_mach
    mach = check_and_get_mach(dir_path)
  File "path/to/mozilla-central/mach", line 196, in check_and_get_mach
    return load_mach(dir_path, mach_path)
  File "path/to/mozilla-central/mach", line 184, in load_mach
    return mach_bootstrap.bootstrap(dir_path)
  File "path/to/mozilla-central/build/mach_bootstrap.py", line 204, in bootstrap
    import mach.main
  File "path/to/mozilla-central/build/mach_bootstrap.py", line 474, in __call__
    module = self._original_import(name, globals, locals, fromlist, level)
  File "path/to/mozilla-central/python/mach/mach/main.py", line 36, in <module>
    from .sentry import register_sentry, NoopErrorReporter
  File "path/to/mozilla-central/build/mach_bootstrap.py", line 474, in __call__
    module = self._original_import(name, globals, locals, fromlist, level)
  File "path/to/mozilla-central/python/mach/mach/sentry.py", line 11, in <module>
    import sentry_sdk
  File "path/to/mozilla-central/build/mach_bootstrap.py", line 474, in __call__
    module = self._original_import(name, globals, locals, fromlist, level)
  File "path/to/mozilla-central/third_party/python/sentry-sdk/sentry_sdk/__init__.py", line 1, in <module>
    from sentry_sdk.hub import Hub, init
  File "path/to/mozilla-central/build/mach_bootstrap.py", line 474, in __call__
    module = self._original_import(name, globals, locals, fromlist, level)
  File "path/to/mozilla-central/third_party/python/sentry-sdk/sentry_sdk/hub.py", line 10, in <module>
    from sentry_sdk.client import Client
  File "path/to/mozilla-central/build/mach_bootstrap.py", line 474, in __call__
    module = self._original_import(name, globals, locals, fromlist, level)
  File "path/to/mozilla-central/third_party/python/sentry-sdk/sentry_sdk/client.py", line 17, in <module>
    from sentry_sdk.transport import make_transport
  File "path/to/mozilla-central/build/mach_bootstrap.py", line 474, in __call__
    module = self._original_import(name, globals, locals, fromlist, level)
  File "path/to/mozilla-central/third_party/python/sentry-sdk/sentry_sdk/transport.py", line 5, in <module>
    import urllib3  # type: ignore
  File "path/to/mozilla-central/build/mach_bootstrap.py", line 474, in __call__
    module = self._original_import(name, globals, locals, fromlist, level)
  File "path/to/mozilla-central/third_party/python/urllib3/src/urllib3/__init__.py", line 7, in <module>
    from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool, connection_from_url
  File "path/to/mozilla-central/build/mach_bootstrap.py", line 474, in __call__
    module = self._original_import(name, globals, locals, fromlist, level)
  File "path/to/mozilla-central/third_party/python/urllib3/src/urllib3/connectionpool.py", line 29, in <module>
    from .connection import (
  File "path/to/mozilla-central/build/mach_bootstrap.py", line 474, in __call__
    module = self._original_import(name, globals, locals, fromlist, level)
  File "path/to/mozilla-central/third_party/python/urllib3/src/urllib3/connection.py", line 41, in <module>
    from .util.ssl_ import (
  File "path/to/mozilla-central/build/mach_bootstrap.py", line 474, in __call__
    module = self._original_import(name, globals, locals, fromlist, level)
  File "path/to/mozilla-central/third_party/python/urllib3/src/urllib3/util/__init__.py", line 7, in <module>
    from .ssl_ import (
  File "path/to/mozilla-central/build/mach_bootstrap.py", line 474, in __call__
    module = self._original_import(name, globals, locals, fromlist, level)
  File "path/to/mozilla-central/third_party/python/urllib3/src/urllib3/util/ssl_.py", line 8, in <module>
    from hashlib import md5, sha1, sha256
ImportError: cannot import name md5
WARNING! Failed to create a Python 2 mach environment.
Summary: Can't create python2 mach environment so can't run tests → Can't create python2 mach environment so can't run tests (ValueError: unsupported hash type md5)

brew uninstall python@2 seems to have helped. Maybe.

Severity: S1 → S2
Summary: Can't create python2 mach environment so can't run tests (ValueError: unsupported hash type md5) → Can't create python2 mach environment based on homebrew python2 so can't run tests (ValueError: unsupported hash type md5)
Severity: S2 → S3

Since the issue seems to be entirely localized to internal Homebrew stuff, and since there are workarounds/fixes (which you've already noticed), I'm closing this.

Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.