Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Out of Memory error when building cryptography wheel on armv7 and armv6 #6673

Closed
shawly opened this issue Dec 3, 2021 · 9 comments
Closed

Comments

@shawly
Copy link

shawly commented Dec 3, 2021

I'm trying to compile my Docker image for crafty-web, but it always fails with an Out of Memory error when it tries to build the armv6 and armv7 version.

This image was building fine just a few weeks ago, but now it doesn't anymore. I thought the out of memory issues is related to the Github runners not having enough memory but when I tried to build it with my own self-hosted runner (with 32GB of memory available) it still exits with the same error.

Pip is upgraded before the build to the latest version.

amd64, i386, arm64 and ppcle builds still work fine.

https://github.com/shawly/docker-crafty-web/runs/4412086826?check_suite_focus=true#step:8:2553

#19 925.7   Building wheel for cryptography (pyproject.toml): finished with status 'error'
#19 925.7   ERROR: Command errored out with exit status 1:
#19 925.7    command: /usr/local/bin/python /usr/local/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /tmp/tmp1o9o4a5f
#19 925.7        cwd: /tmp/pip-wheel-pcsa_4f0/cryptography_f1ecce2413b145448545311a2315547d
#19 925.7   Complete output (215 lines):
#19 925.7   running bdist_wheel
#19 925.7   running build
#19 925.7   running build_py
#19 925.7   creating build
#19 925.7   creating build/lib.linux-armv7l-3.10
#19 925.7   creating build/lib.linux-armv7l-3.10/cryptography
#19 925.7   copying src/cryptography/__about__.py -> build/lib.linux-armv7l-3.10/cryptography
#19 925.7   copying src/cryptography/__init__.py -> build/lib.linux-armv7l-3.10/cryptography
#19 925.7   copying src/cryptography/exceptions.py -> build/lib.linux-armv7l-3.10/cryptography
#19 925.7   copying src/cryptography/fernet.py -> build/lib.linux-armv7l-3.10/cryptography
#19 925.7   copying src/cryptography/utils.py -> build/lib.linux-armv7l-3.10/cryptography
#19 925.7   creating build/lib.linux-armv7l-3.10/cryptography/hazmat
#19 925.7   copying src/cryptography/hazmat/__init__.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat
#19 925.7   copying src/cryptography/hazmat/_oid.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat
#19 925.7   creating build/lib.linux-armv7l-3.10/cryptography/x509
#19 925.7   copying src/cryptography/x509/__init__.py -> build/lib.linux-armv7l-3.10/cryptography/x509
#19 925.7   copying src/cryptography/x509/base.py -> build/lib.linux-armv7l-3.10/cryptography/x509
#19 925.7   copying src/cryptography/x509/certificate_transparency.py -> build/lib.linux-armv7l-3.10/cryptography/x509
#19 925.7   copying src/cryptography/x509/extensions.py -> build/lib.linux-armv7l-3.10/cryptography/x509
#19 925.7   copying src/cryptography/x509/general_name.py -> build/lib.linux-armv7l-3.10/cryptography/x509
#19 925.7   copying src/cryptography/x509/name.py -> build/lib.linux-armv7l-3.10/cryptography/x509
#19 925.7   copying src/cryptography/x509/ocsp.py -> build/lib.linux-armv7l-3.10/cryptography/x509
#19 925.7   copying src/cryptography/x509/oid.py -> build/lib.linux-armv7l-3.10/cryptography/x509
#19 925.7   creating build/lib.linux-armv7l-3.10/cryptography/hazmat/backends
#19 925.7   copying src/cryptography/hazmat/backends/__init__.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/backends
#19 925.7   copying src/cryptography/hazmat/backends/interfaces.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/backends
#19 925.7   creating build/lib.linux-armv7l-3.10/cryptography/hazmat/bindings
#19 925.7   copying src/cryptography/hazmat/bindings/__init__.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/bindings
#19 925.7   creating build/lib.linux-armv7l-3.10/cryptography/hazmat/primitives
#19 925.7   copying src/cryptography/hazmat/primitives/__init__.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/primitives
#19 925.7   copying src/cryptography/hazmat/primitives/_asymmetric.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/primitives
#19 925.7   copying src/cryptography/hazmat/primitives/_cipheralgorithm.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/primitives
#19 925.7   copying src/cryptography/hazmat/primitives/_serialization.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/primitives
#19 925.7   copying src/cryptography/hazmat/primitives/cmac.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/primitives
#19 925.7   copying src/cryptography/hazmat/primitives/constant_time.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/primitives
#19 925.7   copying src/cryptography/hazmat/primitives/hashes.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/primitives
#19 925.7   copying src/cryptography/hazmat/primitives/hmac.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/primitives
#19 925.7   copying src/cryptography/hazmat/primitives/keywrap.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/primitives
#19 925.7   copying src/cryptography/hazmat/primitives/padding.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/primitives
#19 925.7   copying src/cryptography/hazmat/primitives/poly1305.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/primitives
#19 925.7   creating build/lib.linux-armv7l-3.10/cryptography/hazmat/backends/openssl
#19 925.7   copying src/cryptography/hazmat/backends/openssl/__init__.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/backends/openssl
#19 925.7   copying src/cryptography/hazmat/backends/openssl/aead.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/backends/openssl
#19 925.7   copying src/cryptography/hazmat/backends/openssl/backend.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/backends/openssl
#19 925.7   copying src/cryptography/hazmat/backends/openssl/ciphers.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/backends/openssl
#19 925.7   copying src/cryptography/hazmat/backends/openssl/cmac.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/backends/openssl
#19 925.7   copying src/cryptography/hazmat/backends/openssl/decode_asn1.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/backends/openssl
#19 925.7   copying src/cryptography/hazmat/backends/openssl/dh.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/backends/openssl
#19 925.7   copying src/cryptography/hazmat/backends/openssl/dsa.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/backends/openssl
#19 925.7   copying src/cryptography/hazmat/backends/openssl/ec.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/backends/openssl
#19 925.7   copying src/cryptography/hazmat/backends/openssl/ed25519.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/backends/openssl
#19 925.7   copying src/cryptography/hazmat/backends/openssl/ed448.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/backends/openssl
#19 925.7   copying src/cryptography/hazmat/backends/openssl/encode_asn1.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/backends/openssl
#19 925.7   copying src/cryptography/hazmat/backends/openssl/hashes.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/backends/openssl
#19 925.7   copying src/cryptography/hazmat/backends/openssl/hmac.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/backends/openssl
#19 925.7   copying src/cryptography/hazmat/backends/openssl/poly1305.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/backends/openssl
#19 925.7   copying src/cryptography/hazmat/backends/openssl/rsa.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/backends/openssl
#19 925.7   copying src/cryptography/hazmat/backends/openssl/utils.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/backends/openssl
#19 925.7   copying src/cryptography/hazmat/backends/openssl/x25519.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/backends/openssl
#19 925.7   copying src/cryptography/hazmat/backends/openssl/x448.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/backends/openssl
#19 925.7   copying src/cryptography/hazmat/backends/openssl/x509.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/backends/openssl
#19 925.7   creating build/lib.linux-armv7l-3.10/cryptography/hazmat/bindings/openssl
#19 925.7   copying src/cryptography/hazmat/bindings/openssl/__init__.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/bindings/openssl
#19 925.7   copying src/cryptography/hazmat/bindings/openssl/_conditional.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/bindings/openssl
#19 925.7   copying src/cryptography/hazmat/bindings/openssl/binding.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/bindings/openssl
#19 925.7   creating build/lib.linux-armv7l-3.10/cryptography/hazmat/primitives/asymmetric
#19 925.7   copying src/cryptography/hazmat/primitives/asymmetric/__init__.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/primitives/asymmetric
#19 925.7   copying src/cryptography/hazmat/primitives/asymmetric/dh.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/primitives/asymmetric
#19 925.7   copying src/cryptography/hazmat/primitives/asymmetric/dsa.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/primitives/asymmetric
#19 925.7   copying src/cryptography/hazmat/primitives/asymmetric/ec.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/primitives/asymmetric
#19 925.7   copying src/cryptography/hazmat/primitives/asymmetric/ed25519.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/primitives/asymmetric
#19 925.7   copying src/cryptography/hazmat/primitives/asymmetric/ed448.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/primitives/asymmetric
#19 925.7   copying src/cryptography/hazmat/primitives/asymmetric/padding.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/primitives/asymmetric
#19 925.7   copying src/cryptography/hazmat/primitives/asymmetric/rsa.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/primitives/asymmetric
#19 925.7   copying src/cryptography/hazmat/primitives/asymmetric/types.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/primitives/asymmetric
#19 925.7   copying src/cryptography/hazmat/primitives/asymmetric/utils.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/primitives/asymmetric
#19 925.7   copying src/cryptography/hazmat/primitives/asymmetric/x25519.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/primitives/asymmetric
#19 925.7   copying src/cryptography/hazmat/primitives/asymmetric/x448.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/primitives/asymmetric
#19 925.7   creating build/lib.linux-armv7l-3.10/cryptography/hazmat/primitives/ciphers
#19 925.7   copying src/cryptography/hazmat/primitives/ciphers/__init__.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/primitives/ciphers
#19 925.7   copying src/cryptography/hazmat/primitives/ciphers/aead.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/primitives/ciphers
#19 925.7   copying src/cryptography/hazmat/primitives/ciphers/algorithms.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/primitives/ciphers
#19 925.7   copying src/cryptography/hazmat/primitives/ciphers/base.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/primitives/ciphers
#19 925.7   copying src/cryptography/hazmat/primitives/ciphers/modes.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/primitives/ciphers
#19 925.7   creating build/lib.linux-armv7l-3.10/cryptography/hazmat/primitives/kdf
#19 925.7   copying src/cryptography/hazmat/primitives/kdf/__init__.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/primitives/kdf
#19 925.7   copying src/cryptography/hazmat/primitives/kdf/concatkdf.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/primitives/kdf
#19 925.7   copying src/cryptography/hazmat/primitives/kdf/hkdf.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/primitives/kdf
#19 925.7   copying src/cryptography/hazmat/primitives/kdf/kbkdf.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/primitives/kdf
#19 925.7   copying src/cryptography/hazmat/primitives/kdf/pbkdf2.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/primitives/kdf
#19 925.7   copying src/cryptography/hazmat/primitives/kdf/scrypt.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/primitives/kdf
#19 925.7   copying src/cryptography/hazmat/primitives/kdf/x963kdf.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/primitives/kdf
#19 925.7   creating build/lib.linux-armv7l-3.10/cryptography/hazmat/primitives/serialization
#19 925.7   copying src/cryptography/hazmat/primitives/serialization/__init__.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/primitives/serialization
#19 925.7   copying src/cryptography/hazmat/primitives/serialization/base.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/primitives/serialization
#19 925.7   copying src/cryptography/hazmat/primitives/serialization/pkcs12.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/primitives/serialization
#19 925.7   copying src/cryptography/hazmat/primitives/serialization/pkcs7.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/primitives/serialization
#19 925.7   copying src/cryptography/hazmat/primitives/serialization/ssh.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/primitives/serialization
#19 925.7   creating build/lib.linux-armv7l-3.10/cryptography/hazmat/primitives/twofactor
#19 925.7   copying src/cryptography/hazmat/primitives/twofactor/__init__.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/primitives/twofactor
#19 925.7   copying src/cryptography/hazmat/primitives/twofactor/hotp.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/primitives/twofactor
#19 925.7   copying src/cryptography/hazmat/primitives/twofactor/totp.py -> build/lib.linux-armv7l-3.10/cryptography/hazmat/primitives/twofactor
#19 925.7   running egg_info
#19 925.7   writing src/cryptography.egg-info/PKG-INFO
#19 925.7   writing dependency_links to src/cryptography.egg-info/dependency_links.txt
#19 925.7   writing requirements to src/cryptography.egg-info/requires.txt
#19 925.7   writing top-level names to src/cryptography.egg-info/top_level.txt
#19 925.7   reading manifest file 'src/cryptography.egg-info/SOURCES.txt'
#19 925.7   reading manifest template 'MANIFEST.in'
#19 925.7   no previously-included directories found matching 'docs/_build'
#19 925.7   warning: no previously-included files found matching 'vectors'
#19 925.7   warning: no previously-included files matching '*' found under directory 'vectors'
#19 925.7   warning: no previously-included files matching '*' found under directory '.github'
#19 925.7   warning: no previously-included files found matching 'release.py'
#19 925.7   warning: no previously-included files found matching '.coveragerc'
#19 925.7   warning: no previously-included files found matching 'codecov.yml'
#19 925.7   warning: no previously-included files found matching '.readthedocs.yml'
#19 925.7   warning: no previously-included files found matching 'dev-requirements.txt'
#19 925.7   warning: no previously-included files found matching 'tox.ini'
#19 925.7   warning: no previously-included files found matching 'mypy.ini'
#19 925.7   warning: no previously-included files matching '*' found under directory '.zuul.d'
#19 925.7   warning: no previously-included files matching '*' found under directory '.zuul.playbooks'
#19 925.7   adding license file 'LICENSE'
#19 925.7   adding license file 'LICENSE.APACHE'
#19 925.7   adding license file 'LICENSE.BSD'
#19 925.7   adding license file 'LICENSE.PSF'
#19 925.7   writing manifest file 'src/cryptography.egg-info/SOURCES.txt'
#19 925.7   copying src/cryptography/py.typed -> build/lib.linux-armv7l-3.10/cryptography
#19 925.7   creating build/lib.linux-armv7l-3.10/cryptography/hazmat/bindings/_rust
#19 925.7   copying src/cryptography/hazmat/bindings/_rust/__init__.pyi -> build/lib.linux-armv7l-3.10/cryptography/hazmat/bindings/_rust
#19 925.7   copying src/cryptography/hazmat/bindings/_rust/asn1.pyi -> build/lib.linux-armv7l-3.10/cryptography/hazmat/bindings/_rust
#19 925.7   copying src/cryptography/hazmat/bindings/_rust/ocsp.pyi -> build/lib.linux-armv7l-3.10/cryptography/hazmat/bindings/_rust
#19 925.7   copying src/cryptography/hazmat/bindings/_rust/x509.pyi -> build/lib.linux-armv7l-3.10/cryptography/hazmat/bindings/_rust
#19 925.7   running build_ext
#19 925.7   running build_rust
#19 925.7       Updating crates.io index
#19 925.7   warning: spurious network error (2 tries remaining): failed to mmap. Could not write data: Out of memory; class=Os (2)
#19 925.7   warning: spurious network error (1 tries remaining): failed to mmap. Could not write data: Out of memory; class=Os (2)
#19 925.7   error: failed to get `asn1` as a dependency of package `cryptography-rust v0.1.0 (/tmp/pip-wheel-pcsa_4f0/cryptography_f1ecce2413b145448545311a2315547d/src/rust)`
#19 925.7   
#19 925.7   Caused by:
#19 925.7     failed to fetch `https://github.com/rust-lang/crates.io-index`
#19 925.7   
#19 925.7   Caused by:
#19 925.7     failed to mmap. Could not write data: Out of memory; class=Os (2)
#19 925.7   
#19 925.7       =============================DEBUG ASSISTANCE=============================
#19 925.7       If you are seeing a compilation error please try the following steps to
#19 925.7       successfully install cryptography:
#19 925.7       1) Upgrade to the latest pip and try again. This will fix errors for most
#19 925.7          users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
#19 925.7       2) Read https://cryptography.io/en/latest/installation/ for specific
#19 925.7          instructions for your platform.
#19 925.7       3) Check our frequently asked questions for more information:
#19 925.7          https://cryptography.io/en/latest/faq/
#19 925.7       4) Ensure you have a recent Rust toolchain installed:
#19 925.7          https://cryptography.io/en/latest/installation/#rust
#19 925.7   
#19 925.7       Python: 3.10.0
#19 925.7       platform: Linux-5.10.28-Unraid-armv7l-with
#19 925.7       pip: n/a
#19 925.7       setuptools: 59.4.0
#19 925.7       setuptools_rust: 1.1.1
#19 925.7       =============================DEBUG ASSISTANCE=============================
#19 925.7   
#19 925.7   Traceback (most recent call last):
#19 925.7     File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
#19 925.7       main()
#19 925.7     File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
#19 925.7       json_out['return_val'] = hook(**hook_input['kwargs'])
#19 925.7     File "/usr/local/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 261, in build_wheel
#19 925.7       return _build_backend().build_wheel(wheel_directory, config_settings,
#19 925.7     File "/tmp/pip-build-env-2bgwhy_a/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 230, in build_wheel
#19 925.7       return self._build_with_temp_dir(['bdist_wheel'], '.whl',
#19 925.7     File "/tmp/pip-build-env-2bgwhy_a/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 215, in _build_with_temp_dir
#19 925.7       self.run_setup()
#19 925.7     File "/tmp/pip-build-env-2bgwhy_a/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 158, in run_setup
#19 925.7       exec(compile(code, __file__, 'exec'), locals())
#19 925.7     File "setup.py", line 39, in <module>
#19 925.7       setup(
#19 925.7     File "/tmp/pip-build-env-2bgwhy_a/overlay/lib/python3.10/site-packages/setuptools/__init__.py", line 153, in setup
#19 925.7       return distutils.core.setup(**attrs)
#19 925.7     File "/usr/local/lib/python3.10/distutils/core.py", line 148, in setup
#19 925.7       dist.run_commands()
#19 925.7     File "/usr/local/lib/python3.10/distutils/dist.py", line 966, in run_commands
#19 925.7       self.run_command(cmd)
#19 925.7     File "/usr/local/lib/python3.10/distutils/dist.py", line 985, in run_command
#19 925.7       cmd_obj.run()
#19 925.7     File "/tmp/pip-build-env-2bgwhy_a/overlay/lib/python3.10/site-packages/wheel/bdist_wheel.py", line 299, in run
#19 925.7       self.run_command('build')
#19 925.7     File "/usr/local/lib/python3.10/distutils/cmd.py", line 313, in run_command
#19 925.7       self.distribution.run_command(command)
#19 925.7     File "/usr/local/lib/python3.10/distutils/dist.py", line 985, in run_command
#19 925.7       cmd_obj.run()
#19 925.7     File "/usr/local/lib/python3.10/distutils/command/build.py", line 135, in run
#19 925.7       self.run_command(cmd_name)
#19 925.7     File "/usr/local/lib/python3.10/distutils/cmd.py", line 313, in run_command
#19 925.7       self.distribution.run_command(command)
#19 925.7     File "/usr/local/lib/python3.10/distutils/dist.py", line 985, in run_command
#19 925.7       cmd_obj.run()
#19 925.7     File "/tmp/pip-build-env-2bgwhy_a/overlay/lib/python3.10/site-packages/setuptools_rust/setuptools_ext.py", line 132, in run
#19 925.7       build_rust.run()
#19 925.7     File "/tmp/pip-build-env-2bgwhy_a/overlay/lib/python3.10/site-packages/setuptools_rust/command.py", line 80, in run
#19 925.7       self.run_for_extension(ext)
#19 925.7     File "/tmp/pip-build-env-2bgwhy_a/overlay/lib/python3.10/site-packages/setuptools_rust/build.py", line 108, in run_for_extension
#19 925.7       dylib_paths = self.build_extension(ext, self.target)
#19 925.7     File "/tmp/pip-build-env-2bgwhy_a/overlay/lib/python3.10/site-packages/setuptools_rust/build.py", line 139, in build_extension
#19 925.7       target_dir = _base_cargo_target_dir(ext)
#19 925.7     File "/tmp/pip-build-env-2bgwhy_a/overlay/lib/python3.10/site-packages/setuptools_rust/build.py", line 681, in _base_cargo_target_dir
#19 925.7       metadata = json.loads(check_output(metadata_command))
#19 925.7     File "/usr/local/lib/python3.10/subprocess.py", line 420, in check_output
#19 925.7       return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
#19 925.7     File "/usr/local/lib/python3.10/subprocess.py", line 524, in run
#19 925.7       raise CalledProcessError(retcode, process.args,
#19 925.7   subprocess.CalledProcessError: Command '['cargo', 'metadata', '--manifest-path', 'src/rust/Cargo.toml', '--format-version', '1']' returned non-zero exit status 101.
#19 925.7   ----------------------------------------
#19 925.7   ERROR: Failed building wheel for cryptography
#19 925.7 Successfully built argon2-cffi peewee psutil pyftpdlib PyYAML termcolor tornado cffi
#19 925.7 Failed to build cryptography
@reaperhulk
Copy link
Member

This appears to be failing when trying to fetch the crates.io index before any compilation actually happens. Have you tried reducing this to see if you can replicate simply by cloning a rust repo and running cargo build on it? e.g. git clone https://github.com/alex/rust-asn1 && cd rust-asn1 && cargo build should hypothetically fail based on the error shown.

@reaperhulk
Copy link
Member

reaperhulk commented Dec 3, 2021

Some comments on rust-lang/cargo#6513 may be relevant as well. (Edit: it is not, Alex has the right link)

@alex
Copy link
Member

alex commented Dec 3, 2021

I do not think that issue is relevant, however this one is: rust-lang/cargo#2808

@reaperhulk
Copy link
Member

Ha, I literally had 2808 open but copied the link from the one I decided wasn't relevant. Sigh.

@shawly
Copy link
Author

shawly commented Dec 4, 2021

I do not think that issue is relevant, however this one is: rust-lang/cargo#2808

I'm not quite sure how relevant this one is, the error doesn't say anything about Out of Memory in the issues you linked and like I said, the last build which was a month ago worked fine. Back then it used cryptography-35.0.0.
It also only happens on armv6 and v7 for some reason.

https://github.com/shawly/docker-crafty-web/runs/4106266429?check_suite_focus=true#step:8:2701

@alex
Copy link
Member

alex commented Dec 4, 2021 via email

@messense
Copy link

messense commented Dec 4, 2021

Here is my workaround for the same issue I met before PyO3/maturin#490 (comment)

cd ~/.cargo/registry/index
git clone --bare https://github.com/rust-lang/crates.io-index.git github.com-1285ae84e5963aae

@shawly
Copy link
Author

shawly commented Dec 4, 2021

@messense the build is running for an hour now, previously it failed after around 20 minutes, so I think this is working, thanks a lot!

@reaperhulk
Copy link
Member

Glad that workaround helped, although it'd be nice to file a bug somewhere for this. Is this a cargo bug? libgit2 on armhf? qemu issue? Something else? 😞 I'll close this for now since it's definitely not our issue, but others will run into this until the underlying problem is isolated and resolved.

JonasAlfredsson added a commit to JonasAlfredsson/docker-nginx-certbot that referenced this issue Dec 13, 2021
Some strange issue make so that this arch fails to build on Alpine.
To not hinder the 3.0.0 release we drop this arch, and hopefully
we can reintroduce it in the future.

More info here: pyca/cryptography#6673
and here: rust-lang/cargo#2808
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

4 participants