From d5e1fa5771c9cb1a2b85ab129be182f7081ae7cb Mon Sep 17 00:00:00 2001 From: eugeneswalker <38933153+eugeneswalker@users.noreply.github.com> Date: Tue, 26 Apr 2022 19:58:28 -0700 Subject: [PATCH] =?UTF-8?q?py-cryptography@35:=20tell=20cargo=20to=20use?= =?UTF-8?q?=20cli=20git,=20not=20cargo=20internal=20git=E2=80=A6=20(#30307?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../repos/builtin/packages/py-cryptography/package.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/var/spack/repos/builtin/packages/py-cryptography/package.py b/var/spack/repos/builtin/packages/py-cryptography/package.py index 5f70eac778c..e4521cf7694 100644 --- a/var/spack/repos/builtin/packages/py-cryptography/package.py +++ b/var/spack/repos/builtin/packages/py-cryptography/package.py @@ -47,3 +47,13 @@ class PyCryptography(PythonPackage): depends_on('py-ipaddress', type=('build', 'run'), when='^python@:3.3') depends_on('openssl@:1.0', when='@:1.8.1') depends_on('openssl') + + # To fix https://github.com/spack/spack/issues/29669 + # https://community.home-assistant.io/t/error-failed-building-wheel-for-cryptography/352020/14 + # We use CLI git instead of Cargo's internal git library + # See reference: https://doc.rust-lang.org/cargo/reference/config.html#netgit-fetch-with-cli + depends_on('git', type='build', when='@35:') + + def setup_build_environment(self, env): + if self.spec.satisfies('@35:'): + env.set('CARGO_NET_GIT_FETCH_WITH_CLI', 'true')