|
50 | 50 | , zlib
|
51 | 51 | , zstd
|
52 | 52 |
|
| 53 | +# Dependencies of overridden Python dependencies, hopefully we can remove these soon. |
| 54 | +, rustPlatform |
| 55 | + |
53 | 56 | # Optional Dependencies
|
54 | 57 | , curl ? null
|
55 | 58 | , expat ? null
|
|
166 | 169 |
|
167 | 170 | # Watch out for python <> boost compatibility
|
168 | 171 | python = python310.override {
|
169 |
| - packageOverrides = self: super: { |
| 172 | + packageOverrides = self: super: let cryptographyOverrideVersion = "40.0.1"; in { |
| 173 | + # Ceph does not support `cryptography` > 40 yet: |
| 174 | + # * https://github.com/NixOS/nixpkgs/pull/281858#issuecomment-1899358602 |
| 175 | + # * Upstream issue: https://tracker.ceph.com/issues/63529 |
| 176 | + # > Python Sub-Interpreter Model Used by ceph-mgr Incompatible With Python Modules Based on PyO3 |
| 177 | + # |
| 178 | + # We pin the older `cryptography` 40 here; |
| 179 | + # this also forces us to pin an older `pyopenssl` because the current one |
| 180 | + # is not compatible with older `cryptography`, see: |
| 181 | + # https://github.com/pyca/pyopenssl/blob/d9752e44127ba36041b045417af8a0bf16ec4f1e/CHANGELOG.rst#2320-2023-05-30 |
| 182 | + cryptography = super.cryptography.overridePythonAttrs (old: rec { |
| 183 | + version = cryptographyOverrideVersion; |
| 184 | + |
| 185 | + src = fetchPypi { |
| 186 | + inherit (old) pname; |
| 187 | + version = cryptographyOverrideVersion; |
| 188 | + hash = "sha256-KAPy+LHpX2FEGZJsfm9V2CivxhTKXtYVQ4d65mjMNHI="; |
| 189 | + }; |
| 190 | + |
| 191 | + cargoDeps = rustPlatform.fetchCargoTarball { |
| 192 | + inherit src; |
| 193 | + sourceRoot = let cargoRoot = "src/rust"; in "${old.pname}-${cryptographyOverrideVersion}/${cargoRoot}"; |
| 194 | + name = "${old.pname}-${cryptographyOverrideVersion}"; |
| 195 | + hash = "sha256-gFfDTc2QWBWHBCycVH1dYlCsWQMVcRZfOBIau+njtDU="; |
| 196 | + }; |
| 197 | + |
| 198 | + patches = (old.patches or []) ++ [ |
| 199 | + # Fix https://nvd.nist.gov/vuln/detail/CVE-2023-49083 which has no upstream backport. |
| 200 | + # See https://github.com/pyca/cryptography/commit/f09c261ca10a31fe41b1262306db7f8f1da0e48a#diff-f5134bf8f3cf0a5cc8601df55e50697acc866c603a38caff98802bd8e17976c5R1893 |
| 201 | + ./python-cryptography-Cherry-pick-fix-for-CVE-2023-49083-on-cryptography-40.patch |
| 202 | + ]; |
| 203 | + |
| 204 | + # Tests would require overriding `cryptography-vectors`, which is not currently |
| 205 | + # possible/desired, see: https://github.com/NixOS/nixpkgs/pull/281858#pullrequestreview-1841421866 |
| 206 | + doCheck = false; |
| 207 | + }); |
| 208 | + |
| 209 | + # This is the most recent version of `pyopenssl` that's still compatible with `cryptography` 40. |
| 210 | + # See https://github.com/NixOS/nixpkgs/pull/281858#issuecomment-1899358602 |
| 211 | + pyopenssl = super.pyopenssl.overridePythonAttrs (old: rec { |
| 212 | + version = "23.1.1"; |
| 213 | + src = fetchPypi { |
| 214 | + pname = "pyOpenSSL"; |
| 215 | + inherit version; |
| 216 | + hash = "sha256-hBSYub7GFiOxtsR+u8AjZ8B9YODhlfGXkIF/EMyNsLc="; |
| 217 | + }; |
| 218 | + }); |
| 219 | + |
| 220 | + # Ceph does not support `kubernetes` >= 19, see: |
| 221 | + # https://github.com/NixOS/nixpkgs/pull/281858#issuecomment-1900324090 |
| 222 | + kubernetes = super.kubernetes.overridePythonAttrs (old: rec { |
| 223 | + version = "18.20.0"; |
| 224 | + src = fetchFromGitHub { |
| 225 | + owner = "kubernetes-client"; |
| 226 | + repo = "python"; |
| 227 | + rev = "v${version}"; |
| 228 | + sha256 = "1sawp62j7h0yksmg9jlv4ik9b9i1a1w9syywc9mv8x89wibf5ql1"; |
| 229 | + fetchSubmodules = true; |
| 230 | + }; |
| 231 | + }); |
| 232 | + |
170 | 233 | };
|
171 | 234 | };
|
172 | 235 |
|
|
0 commit comments