Thursday, October 05, 2023

Re: Building/Installing octodns and octodns-azure on OpenBSD 7.3

On 2023/10/05 14:46, Russell Sutherland wrote:
> In attempting to install octodns and octodns-azure from PyPi, I run into some issues with octodns-azure as it is asking for the cryptography package, version 41.x.y
>
> This works normally as expected:
>
> $ pip install octodns
>
> However when performing:
>
> $ pip install octodns-azure
>
> I first was prompted to make sure rust was installed, which I performed.
> Then afterwards, after a long time compiling code the error message(s) are:
>
>
> <output>
>
> error: failed to run custom build command for `cryptography-cffi v0.1.0 (/tmp/pip-install-qyp1zwp3/cryptography_cab14d66a54442209297c1df6c926001/src/rust/cryptography-cffi)`
>
> Caused by:
> process didn't exit successfully: `/tmp/pip-install-qyp1zwp3/cryptography_cab14d66a54442209297c1df6c926001/src/rust/target/release/build/cryptography-cffi-c1471cf641a055d0/build-script-build` (exit status: 101)
> --- stdout
> cargo:rerun-if-env-changed=PYO3_PYTHON
> cargo:rerun-if-changed=../../_cffi_src/
> cargo:rerun-if-changed=../../cryptography/__about__.py
> cargo:rustc-cfg=python_implementation="CPython"
>
> --- stderr
> thread 'main' panicked at 'unable to find openssl include path', cryptography-cffi/build.rs:56:49
> note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
> warning: build failed, waiting for other jobs to finish...
>
> =============================DEBUG ASSISTANCE=============================
> If you are seeing a compilation error please try the following steps to
> successfully install cryptography:
> 1) Upgrade to the latest pip and try again. This will fix errors for most
> users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
> 2) Read https://cryptography.io/en/latest/installation/ for specific
> instructions for your platform.
> 3) Check our frequently asked questions for more information:
> https://cryptography.io/en/latest/faq/
> 4) Ensure you have a recent Rust toolchain installed:
> https://cryptography.io/en/latest/installation/#rust
>
> Python: 3.10.13
> platform: OpenBSD-7.3-amd64-64bit-ELF
> pip: n/a
> setuptools: 68.2.2
> setuptools_rust: 1.7.0
> rustc: 1.68.0 (2c8cc3432 2023-03-06) (built from a source tarball)
> =============================DEBUG ASSISTANCE=============================
>
> error: `cargo rustc --lib --message-format=json-render-diagnostics --manifest-path src/rust/Cargo.toml --release -v --features pyo3/extension-module --crate-type cdylib --` failed with code 101
> [end of output]
>
> note: This error originates from a subprocess, and is likely not a problem with pip.
> ERROR: Failed building wheel for cryptography
> Failed to build cryptography
> ERROR: Could not build wheels for cryptography, which is required to install pyproject.toml-based projects
>
> </output>
>
> The current py3-cryptography package is version 39.01, and as well takes quite a while to install using pkg_add.
>
> Do you have any ideas on how I would get octodns-azure to install on OpenBSD 7.3?

I would and try to install as many dependencies via pkg_add as you can
first. Looking at the list of deps, I think at least these would be
worth doing -

py3-yaml
py3-dnspython
py3-urllib3
py3-requests-oauthlib
py3-idna
py3-cryptography

Then create a venv, set to use system packages where possible and
try installing:

$ python3 -m venv --system-site-packages octodns
$ cd octodns
$ bin/pip install octodns
$ bin/pip install octodns-azure

If that isn't enough, look at what it's trying to install when it fails
and see if that's available as a system package (pkglocate can help
if you're not sure of the package name - try "pkglocate $modulename |
grep ^py3-") and if so, pkg_add it and try again with pip.

If this still doesn't help, your best option is probably to update to
a snapshot (which at this point is *very* close to what will be 7.4)
where cryptography 41 is available in packages - though when I tried
on a recent snapshot it didn't list anything which actually wanted 41.x
as the only version restrictions on cryptography where >=2.5.

No comments:

Post a Comment