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

mitmproxy doesn't install on OpenBSD #6378

Open
floort opened this issue Sep 23, 2023 · 12 comments
Open

mitmproxy doesn't install on OpenBSD #6378

floort opened this issue Sep 23, 2023 · 12 comments
Labels
kind/triage Unclassified issues

Comments

@floort
Copy link

floort commented Sep 23, 2023

Problem Description

Installing mitmproxy (10.0.0) doesn't work on OpenBSD 7.3 through pip because mitmproxy-rs doesn't build.

Steps to reproduce the behavior:

peek$ pip3.10 install mitmproxy
Defaulting to user installation because normal site-packages is not writeable
Collecting mitmproxy
  Obtaining dependency information for mitmproxy from https://files.pythonhosted.org/packages/7a/3a/9ec933b3c556ea26690251c3928cddce4df3688ac37344b369db7975bb17/mitmproxy-10.0.0-py3-none-any.whl.metadata
  Using cached mitmproxy-10.0.0-py3-none-any.whl.metadata (8.9 kB)
Collecting aioquic-mitmproxy<0.10,>=0.9.20 (from mitmproxy)
  Using cached aioquic_mitmproxy-0.9.20.3-py3-none-any.whl (80 kB)
Collecting asgiref<3.8,>=3.2.10 (from mitmproxy)
  Obtaining dependency information for asgiref<3.8,>=3.2.10 from https://files.pythonhosted.org/packages/9b/80/b9051a4a07ad231558fcd8ffc89232711b4e618c15cb7a392a17384bbeef/asgiref-3.7.2-py3-none-any.whl.metadata
  Using cached asgiref-3.7.2-py3-none-any.whl.metadata (9.2 kB)
Requirement already satisfied: Brotli<1.1,>=1.0 in /usr/local/lib/python3.10/site-packages (from mitmproxy) (1.0.9)
Requirement already satisfied: certifi>=2019.9.11 in ./.local/lib/python3.10/site-packages (from mitmproxy) (2023.5.7)
Requirement already satisfied: cryptography<41.1,>=38.0 in /usr/local/lib/python3.10/site-packages (from mitmproxy) (39.0.1)
Collecting flask<2.4,>=1.1.1 (from mitmproxy)
  Obtaining dependency information for flask<2.4,>=1.1.1 from https://files.pythonhosted.org/packages/fd/56/26f0be8adc2b4257df20c1c4260ddd0aa396cf8e75d90ab2f7ff99bc34f9/flask-2.3.3-py3-none-any.whl.metadata
  Using cached flask-2.3.3-py3-none-any.whl.metadata (3.6 kB)
Collecting h11<0.15,>=0.11 (from mitmproxy)
  Using cached h11-0.14.0-py3-none-any.whl (58 kB)
Collecting h2<5,>=4.1 (from mitmproxy)
  Using cached h2-4.1.0-py3-none-any.whl (57 kB)
Collecting hyperframe<7,>=6.0 (from mitmproxy)
  Using cached hyperframe-6.0.1-py3-none-any.whl (12 kB)
Collecting kaitaistruct<0.11,>=0.10 (from mitmproxy)
  Using cached kaitaistruct-0.10-py2.py3-none-any.whl (7.0 kB)
Collecting ldap3<2.10,>=2.8 (from mitmproxy)
  Using cached ldap3-2.9.1-py2.py3-none-any.whl (432 kB)
Collecting mitmproxy-rs<0.3,>=0.2.0b1 (from mitmproxy)
  Using cached mitmproxy_rs-0.2.2.tar.gz (854 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting msgpack<1.1.0,>=1.0.0 (from mitmproxy)
  Using cached msgpack-1.0.6-cp310-cp310-openbsd_7_3_amd64.whl
Collecting passlib<1.8,>=1.6.5 (from mitmproxy)
  Using cached passlib-1.7.4-py2.py3-none-any.whl (525 kB)
Collecting protobuf<5,>=3.14 (from mitmproxy)
  Obtaining dependency information for protobuf<5,>=3.14 from https://files.pythonhosted.org/packages/fa/8a/e9c6b48b8f4651df1b1a9d46fe94a74ed99881141b4660aa855a798c7c53/protobuf-4.24.3-py3-none-any.whl.metadata
  Using cached protobuf-4.24.3-py3-none-any.whl.metadata (540 bytes)
Requirement already satisfied: pyOpenSSL<23.3,>=22.1 in ./.local/lib/python3.10/site-packages (from mitmproxy) (23.2.0)
Collecting pyparsing<3.2,>=2.4.2 (from mitmproxy)
  Obtaining dependency information for pyparsing<3.2,>=2.4.2 from https://files.pythonhosted.org/packages/39/92/8486ede85fcc088f1b3dba4ce92dd29d126fd96b0008ea213167940a2475/pyparsing-3.1.1-py3-none-any.whl.metadata
  Using cached pyparsing-3.1.1-py3-none-any.whl.metadata (5.1 kB)
Collecting pyperclip<1.9,>=1.6.0 (from mitmproxy)
  Using cached pyperclip-1.8.2-py3-none-any.whl
Collecting ruamel.yaml<0.18,>=0.16 (from mitmproxy)
  Obtaining dependency information for ruamel.yaml<0.18,>=0.16 from https://files.pythonhosted.org/packages/d9/0e/2a05efa11ea33513fbdf4a2e2576fe94fd8fa5ad226dbb9c660886390974/ruamel.yaml-0.17.32-py3-none-any.whl.metadata
  Using cached ruamel.yaml-0.17.32-py3-none-any.whl.metadata (17 kB)
Collecting sortedcontainers<2.5,>=2.3 (from mitmproxy)
  Using cached sortedcontainers-2.4.0-py2.py3-none-any.whl (29 kB)
Collecting tornado<7,>=6.2 (from mitmproxy)
  Using cached tornado-6.3.3-cp38-abi3-openbsd_7_3_amd64.whl
Collecting urwid-mitmproxy<2.2,>=2.1.1 (from mitmproxy)
  Using cached urwid_mitmproxy-2.1.2.1-cp310-cp310-openbsd_7_3_amd64.whl
Collecting wsproto<1.3,>=1.0 (from mitmproxy)
  Using cached wsproto-1.2.0-py3-none-any.whl (24 kB)
Collecting publicsuffix2<3,>=2.20190812 (from mitmproxy)
  Using cached publicsuffix2-2.20191221-py2.py3-none-any.whl (89 kB)
Collecting zstandard<0.22,>=0.11 (from mitmproxy)
  Using cached zstandard-0.21.0-cp310-cp310-openbsd_7_3_amd64.whl
Collecting typing-extensions<4.6,>=4.3 (from mitmproxy)
  Using cached typing_extensions-4.5.0-py3-none-any.whl (27 kB)
Collecting pylsqpack<0.4.0,>=0.3.3 (from aioquic-mitmproxy<0.10,>=0.9.20->mitmproxy)
  Using cached pylsqpack-0.3.17-cp310-cp310-openbsd_7_3_amd64.whl
Requirement already satisfied: cffi>=1.12 in /usr/local/lib/python3.10/site-packages (from cryptography<41.1,>=38.0->mitmproxy) (1.15.1)
Collecting Werkzeug>=2.3.7 (from flask<2.4,>=1.1.1->mitmproxy)
  Obtaining dependency information for Werkzeug>=2.3.7 from https://files.pythonhosted.org/packages/9b/59/a7c32e3d8d0e546a206e0552a2c04444544f15c1da4a01df8938d20c6ffc/werkzeug-2.3.7-py3-none-any.whl.metadata
  Using cached werkzeug-2.3.7-py3-none-any.whl.metadata (4.1 kB)
Collecting Jinja2>=3.1.2 (from flask<2.4,>=1.1.1->mitmproxy)
  Using cached Jinja2-3.1.2-py3-none-any.whl (133 kB)
Collecting itsdangerous>=2.1.2 (from flask<2.4,>=1.1.1->mitmproxy)
  Using cached itsdangerous-2.1.2-py3-none-any.whl (15 kB)
Requirement already satisfied: click>=8.1.3 in ./.local/lib/python3.10/site-packages (from flask<2.4,>=1.1.1->mitmproxy) (8.1.4)
Collecting blinker>=1.6.2 (from flask<2.4,>=1.1.1->mitmproxy)
  Using cached blinker-1.6.2-py3-none-any.whl (13 kB)
Collecting hpack<5,>=4.0 (from h2<5,>=4.1->mitmproxy)
  Using cached hpack-4.0.0-py3-none-any.whl (32 kB)
Collecting pyasn1>=0.4.6 (from ldap3<2.10,>=2.8->mitmproxy)
  Using cached pyasn1-0.5.0-py2.py3-none-any.whl (83 kB)
Collecting ruamel.yaml.clib>=0.2.7 (from ruamel.yaml<0.18,>=0.16->mitmproxy)
  Using cached ruamel.yaml.clib-0.2.7-cp310-cp310-openbsd_7_3_amd64.whl
Requirement already satisfied: pycparser in /usr/local/lib/python3.10/site-packages (from cffi>=1.12->cryptography<41.1,>=38.0->mitmproxy) (2.21)
Collecting MarkupSafe>=2.0 (from Jinja2>=3.1.2->flask<2.4,>=1.1.1->mitmproxy)
  Using cached MarkupSafe-2.1.3-cp310-cp310-openbsd_7_3_amd64.whl
Using cached mitmproxy-10.0.0-py3-none-any.whl (1.6 MB)
Using cached asgiref-3.7.2-py3-none-any.whl (24 kB)
Using cached flask-2.3.3-py3-none-any.whl (96 kB)
Using cached protobuf-4.24.3-py3-none-any.whl (175 kB)
Using cached pyparsing-3.1.1-py3-none-any.whl (103 kB)
Using cached ruamel.yaml-0.17.32-py3-none-any.whl (112 kB)
Using cached werkzeug-2.3.7-py3-none-any.whl (242 kB)
Building wheels for collected packages: mitmproxy-rs
  Building wheel for mitmproxy-rs (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for mitmproxy-rs (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [184 lines of output]
      Running `maturin pep517 build-wheel -i /usr/local/bin/python3.10 --compatibility off`
      🍹 Building a mixed python/rust project
      🔗 Found pyo3 bindings with abi3 support for Python ≥ 3.10
      🐍 Not using a specific python interpreter
         Compiling autocfg v1.1.0
         Compiling proc-macro2 v1.0.66
         Compiling unicode-ident v1.0.11
         Compiling cfg-if v1.0.0
         Compiling libc v0.2.147
         Compiling scopeguard v1.2.0
         Compiling typenum v1.16.0
         Compiling version_check v0.9.4
         Compiling quote v1.0.31
         Compiling getrandom v0.2.10
         Compiling generic-array v0.14.7
         Compiling syn v2.0.26
         Compiling syn v1.0.109
         Compiling lock_api v0.4.10
         Compiling simd-adler32 v0.3.5
         Compiling rand_core v0.6.4
         Compiling target-lexicon v0.12.10
         Compiling semver v1.0.18
         Compiling memchr v2.5.0
         Compiling crossbeam-utils v0.8.16
         Compiling cc v1.0.79
         Compiling adler v1.0.2
         Compiling miniz_oxide v0.7.1
         Compiling crypto-common v0.1.6
         Compiling memoffset v0.9.0
         Compiling futures-core v0.3.28
         Compiling pyo3-build-config v0.18.3
         Compiling rustc_version v0.4.0
         Compiling crossbeam-epoch v0.9.15
         Compiling subtle v2.5.0
         Compiling either v1.8.1
         Compiling anyhow v1.0.72
         Compiling num_cpus v1.16.0
         Compiling futures-sink v0.3.28
         Compiling smallvec v1.11.0
         Compiling once_cell v1.18.0
         Compiling itertools v0.10.5
         Compiling pin-project-lite v0.2.10
         Compiling io-lifetimes v1.0.11
         Compiling parking_lot_core v0.9.8
         Compiling rayon-core v1.11.0
         Compiling platforms v3.0.2
         Compiling zeroize_derive v1.4.2
         Compiling crossbeam-deque v0.8.3
         Compiling crossbeam-channel v0.5.8
         Compiling backtrace v0.3.68
         Compiling indexmap v1.9.3
         Compiling gimli v0.27.3
         Compiling zeroize v1.6.0
         Compiling cpufeatures v0.2.9
         Compiling crc32fast v1.3.2
         Compiling rustix v0.37.23
         Compiling prost-derive v0.11.9
         Compiling pyo3-ffi v0.18.3
         Compiling errno v0.3.1
         Compiling object v0.31.1
         Compiling addr2line v0.20.0
         Compiling spin v0.9.8
         Compiling tempfile v3.6.0
         Compiling num-traits v0.2.15
         Compiling slab v0.4.8
         Compiling bitflags v1.3.2
         Compiling regex-syntax v0.7.4
         Compiling prettyplease v0.1.25
         Compiling bytes v1.4.0
         Compiling futures-task v0.3.28
         Compiling hashbrown v0.12.3
         Compiling rustc-demangle v0.1.23
         Compiling futures-channel v0.3.28
         Compiling regex-automata v0.3.3
         Compiling prost v0.11.9
         Compiling curve25519-dalek v4.0.0-rc.3
         Compiling parking_lot v0.12.1
         Compiling pin-project-internal v1.1.2
         Compiling inout v0.1.3
         Compiling block-buffer v0.10.4
         Compiling memoffset v0.8.0
         Compiling num-integer v0.1.45
         Compiling fastrand v1.9.0
         Compiling byteorder v1.4.3
         Compiling fixedbitset v0.4.2
         Compiling futures-util v0.3.28
         Compiling petgraph v0.6.3
         Compiling rayon v1.7.0
         Compiling pin-project v1.1.2
         Compiling digest v0.10.7
         Compiling cipher v0.4.4
         Compiling flate2 v1.0.26
         Compiling regex v1.9.1
         Compiling prost-types v0.11.9
         Compiling futures-macro v0.3.28
         Compiling curve25519-dalek-derive v0.1.0
         Compiling pyo3 v0.18.3
         Compiling which v4.4.0
         Compiling universal-hash v0.5.1
         Compiling heapless v0.7.16
         Compiling ring v0.16.20
         Compiling pyo3-macros-backend v0.18.3
         Compiling nanorand v0.7.0
         Compiling num-rational v0.4.1
         Compiling tokio v1.29.1
         Compiling log v0.4.19
         Compiling heck v0.4.1
         Compiling protoc-bin-vendored-linux-aarch_64 v3.0.0
         Compiling protoc-bin-vendored-win32 v3.0.0
         Compiling weezl v0.1.7
         Compiling protoc-bin-vendored-linux-x86_32 v3.0.0
         Compiling protoc-bin-vendored-linux-x86_64 v3.0.0
         Compiling opaque-debug v0.3.0
         Compiling lazy_static v1.4.0
         Compiling futures-io v0.3.28
         Compiling pin-utils v0.1.0
         Compiling protoc-bin-vendored-macos-x86_64 v3.0.0
         Compiling multimap v0.8.3
         Compiling protoc-bin-vendored-linux-ppcle_64 v3.0.0
         Compiling protoc-bin-vendored v3.0.0
         Compiling prost-build v0.11.9
         Compiling poly1305 v0.8.0
         Compiling flume v0.10.14
         Compiling pyo3-macros v0.18.3
         Compiling jpeg-decoder v0.3.0
         Compiling chacha20 v0.9.1
         Compiling hash32 v0.2.1
         Compiling tracing-core v0.1.31
         Compiling tokio-macros v2.1.0
         Compiling tracing-attributes v0.1.26
         Compiling aead v0.5.2
         Compiling fdeflate v0.3.0
         Compiling zune-inflate v0.2.54
         Compiling mio v0.8.8
         Compiling socket2 v0.4.9
         Compiling bit_field v0.10.2
         Compiling stable_deref_trait v1.2.0
         Compiling indoc v1.0.9
         Compiling half v2.2.1
         Compiling color_quant v1.1.0
         Compiling bytemuck v1.13.1
         Compiling ip_network_table-deps-treebitmap v0.5.0
         Compiling ip_network v0.4.1
         Compiling async-trait v0.1.71
         Compiling unindent v0.1.11
         Compiling untrusted v0.7.1
         Compiling spin v0.5.2
         Compiling smoltcp v0.10.0
         Compiling lebe v0.5.2
         Compiling exr v1.7.0
         Compiling ip_network_table v0.2.0
         Compiling qoi v0.4.1
         Compiling gif v0.12.0
         Compiling tracing v0.1.37
         Compiling png v0.17.9
         Compiling chacha20poly1305 v0.10.1
         Compiling tiff v0.8.1
         Compiling futures-executor v0.3.28
         Compiling x25519-dalek v2.0.0-rc.3
         Compiling mitmproxy v0.2.2 (/tmp/pip-install-4pg1xk6b/mitmproxy-rs_623666e421a44090991e6dfd98033f03/local_dependencies/mitmproxy)
         Compiling blake2 v0.10.6
         Compiling hmac v0.12.1
         Compiling managed v0.8.0
         Compiling base64 v0.13.1
         Compiling hex v0.4.3
         Compiling untrusted v0.9.0
      error: failed to run custom build command for `mitmproxy v0.2.2 (/tmp/pip-install-4pg1xk6b/mitmproxy-rs_623666e421a44090991e6dfd98033f03/local_dependencies/mitmproxy)`

      Caused by:
        process didn't exit successfully: `/tmp/pip-install-4pg1xk6b/mitmproxy-rs_623666e421a44090991e6dfd98033f03/target/release/build/mitmproxy-75b8ff35a79a5eef/build-script-build` (exit status: 101)
        --- stderr
        thread 'main' panicked at 'Could not find `protoc` installation and this build crate cannot proceed without
            this knowledge. If `protoc` is installed and this crate had trouble finding
            it, you can set the `PROTOC` environment variable with the specific path to your
            installed `protoc` binary.You can download it from https://github.com/protocolbuffers/protobuf/releases or from your package manager.

        For more information: https://docs.rs/prost-build/#sourcing-protoc
        ', /home/floort/.cargo/registry/src/github.com-1ecc6299db9ec823/prost-build-0.11.9/src/lib.rs:1457:10
        note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
      warning: build failed, waiting for other jobs to finish...
      💥 maturin failed
        Caused by: Failed to build a native library through cargo
        Caused by: Cargo build finished with "exit status: 101": `PYTHON_SYS_EXECUTABLE="/usr/local/bin/python3.10" "cargo" "rustc" "--release" "--manifest-path" "/tmp/pip-install-4pg1xk6b/mitmproxy-rs_623666e421a44090991e6dfd98033f03/Cargo.toml" "--message-format" "json" "--lib"`
      Error: command ['maturin', 'pep517', 'build-wheel', '-i', '/usr/local/bin/python3.10', '--compatibility', 'off'] returned non-zero exit status 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for mitmproxy-rs
Failed to build mitmproxy-rs
ERROR: Could not build wheels for mitmproxy-rs, which is required to install pyproject.toml-based projects

System Information

peek$ pip3.10 --version
pip 23.2.1 from /home/floort/.local/lib/python3.10/site-packages/pip (python 3.10)
peek$ uname -prs
OpenBSD 7.3 amd64
@floort floort added the kind/triage Unclassified issues label Sep 23, 2023
@mhils
Copy link
Member

mhils commented Sep 23, 2023

See the stderr message in your output - you need to provide PROTOC. :)

@floort
Copy link
Author

floort commented Sep 23, 2023

Thank you. I only noticed now that I somehow got a different error message before. I now get the same one as before after installing protoc.

peek$ pip3.10 install mitmproxy
Defaulting to user installation because normal site-packages is not writeable
Collecting mitmproxy
  Obtaining dependency information for mitmproxy from https://files.pythonhosted.org/packages/7a/3a/9ec933b3c556ea26690251c3928cddce4df3688ac37344b369db7975bb17/mitmproxy-10.0.0-py3-none-any.whl.metadata
  Using cached mitmproxy-10.0.0-py3-none-any.whl.metadata (8.9 kB)
Collecting aioquic-mitmproxy<0.10,>=0.9.20 (from mitmproxy)
  Using cached aioquic_mitmproxy-0.9.20.3-py3-none-any.whl (80 kB)
Collecting asgiref<3.8,>=3.2.10 (from mitmproxy)
  Obtaining dependency information for asgiref<3.8,>=3.2.10 from https://files.pythonhosted.org/packages/9b/80/b9051a4a07ad231558fcd8ffc89232711b4e618c15cb7a392a17384bbeef/asgiref-3.7.2-py3-none-any.whl.metadata
  Using cached asgiref-3.7.2-py3-none-any.whl.metadata (9.2 kB)
Requirement already satisfied: Brotli<1.1,>=1.0 in /usr/local/lib/python3.10/site-packages (from mitmproxy) (1.0.9)
Requirement already satisfied: certifi>=2019.9.11 in ./.local/lib/python3.10/site-packages (from mitmproxy) (2023.5.7)
Requirement already satisfied: cryptography<41.1,>=38.0 in /usr/local/lib/python3.10/site-packages (from mitmproxy) (39.0.1)
Collecting flask<2.4,>=1.1.1 (from mitmproxy)
  Obtaining dependency information for flask<2.4,>=1.1.1 from https://files.pythonhosted.org/packages/fd/56/26f0be8adc2b4257df20c1c4260ddd0aa396cf8e75d90ab2f7ff99bc34f9/flask-2.3.3-py3-none-any.whl.metadata
  Using cached flask-2.3.3-py3-none-any.whl.metadata (3.6 kB)
Collecting h11<0.15,>=0.11 (from mitmproxy)
  Using cached h11-0.14.0-py3-none-any.whl (58 kB)
Collecting h2<5,>=4.1 (from mitmproxy)
  Using cached h2-4.1.0-py3-none-any.whl (57 kB)
Collecting hyperframe<7,>=6.0 (from mitmproxy)
  Using cached hyperframe-6.0.1-py3-none-any.whl (12 kB)
Collecting kaitaistruct<0.11,>=0.10 (from mitmproxy)
  Using cached kaitaistruct-0.10-py2.py3-none-any.whl (7.0 kB)
Collecting ldap3<2.10,>=2.8 (from mitmproxy)
  Using cached ldap3-2.9.1-py2.py3-none-any.whl (432 kB)
Collecting mitmproxy-rs<0.3,>=0.2.0b1 (from mitmproxy)
  Using cached mitmproxy_rs-0.2.2.tar.gz (854 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting msgpack<1.1.0,>=1.0.0 (from mitmproxy)
  Using cached msgpack-1.0.6-cp310-cp310-openbsd_7_3_amd64.whl
Collecting passlib<1.8,>=1.6.5 (from mitmproxy)
  Using cached passlib-1.7.4-py2.py3-none-any.whl (525 kB)
Collecting protobuf<5,>=3.14 (from mitmproxy)
  Obtaining dependency information for protobuf<5,>=3.14 from https://files.pythonhosted.org/packages/fa/8a/e9c6b48b8f4651df1b1a9d46fe94a74ed99881141b4660aa855a798c7c53/protobuf-4.24.3-py3-none-any.whl.metadata
  Using cached protobuf-4.24.3-py3-none-any.whl.metadata (540 bytes)
Requirement already satisfied: pyOpenSSL<23.3,>=22.1 in ./.local/lib/python3.10/site-packages (from mitmproxy) (23.2.0)
Collecting pyparsing<3.2,>=2.4.2 (from mitmproxy)
  Obtaining dependency information for pyparsing<3.2,>=2.4.2 from https://files.pythonhosted.org/packages/39/92/8486ede85fcc088f1b3dba4ce92dd29d126fd96b0008ea213167940a2475/pyparsing-3.1.1-py3-none-any.whl.metadata
  Using cached pyparsing-3.1.1-py3-none-any.whl.metadata (5.1 kB)
Collecting pyperclip<1.9,>=1.6.0 (from mitmproxy)
  Using cached pyperclip-1.8.2-py3-none-any.whl
Collecting ruamel.yaml<0.18,>=0.16 (from mitmproxy)
  Obtaining dependency information for ruamel.yaml<0.18,>=0.16 from https://files.pythonhosted.org/packages/d9/0e/2a05efa11ea33513fbdf4a2e2576fe94fd8fa5ad226dbb9c660886390974/ruamel.yaml-0.17.32-py3-none-any.whl.metadata
  Using cached ruamel.yaml-0.17.32-py3-none-any.whl.metadata (17 kB)
Collecting sortedcontainers<2.5,>=2.3 (from mitmproxy)
  Using cached sortedcontainers-2.4.0-py2.py3-none-any.whl (29 kB)
Collecting tornado<7,>=6.2 (from mitmproxy)
  Using cached tornado-6.3.3-cp38-abi3-openbsd_7_3_amd64.whl
Collecting urwid-mitmproxy<2.2,>=2.1.1 (from mitmproxy)
  Using cached urwid_mitmproxy-2.1.2.1-cp310-cp310-openbsd_7_3_amd64.whl
Collecting wsproto<1.3,>=1.0 (from mitmproxy)
  Using cached wsproto-1.2.0-py3-none-any.whl (24 kB)
Collecting publicsuffix2<3,>=2.20190812 (from mitmproxy)
  Using cached publicsuffix2-2.20191221-py2.py3-none-any.whl (89 kB)
Collecting zstandard<0.22,>=0.11 (from mitmproxy)
  Using cached zstandard-0.21.0-cp310-cp310-openbsd_7_3_amd64.whl
Collecting typing-extensions<4.6,>=4.3 (from mitmproxy)
  Using cached typing_extensions-4.5.0-py3-none-any.whl (27 kB)
Collecting pylsqpack<0.4.0,>=0.3.3 (from aioquic-mitmproxy<0.10,>=0.9.20->mitmproxy)
  Using cached pylsqpack-0.3.17-cp310-cp310-openbsd_7_3_amd64.whl
Requirement already satisfied: cffi>=1.12 in /usr/local/lib/python3.10/site-packages (from cryptography<41.1,>=38.0->mitmproxy) (1.15.1)
Collecting Werkzeug>=2.3.7 (from flask<2.4,>=1.1.1->mitmproxy)
  Obtaining dependency information for Werkzeug>=2.3.7 from https://files.pythonhosted.org/packages/9b/59/a7c32e3d8d0e546a206e0552a2c04444544f15c1da4a01df8938d20c6ffc/werkzeug-2.3.7-py3-none-any.whl.metadata
  Using cached werkzeug-2.3.7-py3-none-any.whl.metadata (4.1 kB)
Collecting Jinja2>=3.1.2 (from flask<2.4,>=1.1.1->mitmproxy)
  Using cached Jinja2-3.1.2-py3-none-any.whl (133 kB)
Collecting itsdangerous>=2.1.2 (from flask<2.4,>=1.1.1->mitmproxy)
  Using cached itsdangerous-2.1.2-py3-none-any.whl (15 kB)
Requirement already satisfied: click>=8.1.3 in ./.local/lib/python3.10/site-packages (from flask<2.4,>=1.1.1->mitmproxy) (8.1.4)
Collecting blinker>=1.6.2 (from flask<2.4,>=1.1.1->mitmproxy)
  Using cached blinker-1.6.2-py3-none-any.whl (13 kB)
Collecting hpack<5,>=4.0 (from h2<5,>=4.1->mitmproxy)
  Using cached hpack-4.0.0-py3-none-any.whl (32 kB)
Collecting pyasn1>=0.4.6 (from ldap3<2.10,>=2.8->mitmproxy)
  Using cached pyasn1-0.5.0-py2.py3-none-any.whl (83 kB)
Collecting ruamel.yaml.clib>=0.2.7 (from ruamel.yaml<0.18,>=0.16->mitmproxy)
  Using cached ruamel.yaml.clib-0.2.7-cp310-cp310-openbsd_7_3_amd64.whl
Requirement already satisfied: pycparser in /usr/local/lib/python3.10/site-packages (from cffi>=1.12->cryptography<41.1,>=38.0->mitmproxy) (2.21)
Collecting MarkupSafe>=2.0 (from Jinja2>=3.1.2->flask<2.4,>=1.1.1->mitmproxy)
  Using cached MarkupSafe-2.1.3-cp310-cp310-openbsd_7_3_amd64.whl
Using cached mitmproxy-10.0.0-py3-none-any.whl (1.6 MB)
Using cached asgiref-3.7.2-py3-none-any.whl (24 kB)
Using cached flask-2.3.3-py3-none-any.whl (96 kB)
Using cached protobuf-4.24.3-py3-none-any.whl (175 kB)
Using cached pyparsing-3.1.1-py3-none-any.whl (103 kB)
Using cached ruamel.yaml-0.17.32-py3-none-any.whl (112 kB)
Using cached werkzeug-2.3.7-py3-none-any.whl (242 kB)
Building wheels for collected packages: mitmproxy-rs
  Building wheel for mitmproxy-rs (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for mitmproxy-rs (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [303 lines of output]
      Running `maturin pep517 build-wheel -i /usr/local/bin/python3.10 --compatibility off`
      🍹 Building a mixed python/rust project
      🔗 Found pyo3 bindings with abi3 support for Python ≥ 3.10
      🐍 Not using a specific python interpreter
         Compiling autocfg v1.1.0
         Compiling proc-macro2 v1.0.66
         Compiling unicode-ident v1.0.11
         Compiling cfg-if v1.0.0
         Compiling libc v0.2.147
         Compiling scopeguard v1.2.0
         Compiling version_check v0.9.4
         Compiling typenum v1.16.0
         Compiling getrandom v0.2.10
         Compiling generic-array v0.14.7
         Compiling quote v1.0.31
         Compiling syn v1.0.109
         Compiling syn v2.0.26
         Compiling lock_api v0.4.10
         Compiling simd-adler32 v0.3.5
         Compiling rand_core v0.6.4
         Compiling target-lexicon v0.12.10
         Compiling semver v1.0.18
         Compiling adler v1.0.2
         Compiling cc v1.0.79
         Compiling crossbeam-utils v0.8.16
         Compiling memchr v2.5.0
         Compiling miniz_oxide v0.7.1
         Compiling crypto-common v0.1.6
         Compiling memoffset v0.9.0
         Compiling futures-core v0.3.28
         Compiling rustc_version v0.4.0
         Compiling pyo3-build-config v0.18.3
         Compiling crossbeam-epoch v0.9.15
         Compiling anyhow v1.0.72
         Compiling either v1.8.1
         Compiling subtle v2.5.0
         Compiling num_cpus v1.16.0
         Compiling smallvec v1.11.0
         Compiling futures-sink v0.3.28
         Compiling once_cell v1.18.0
         Compiling itertools v0.10.5
         Compiling parking_lot_core v0.9.8
         Compiling zeroize_derive v1.4.2
         Compiling io-lifetimes v1.0.11
         Compiling rayon-core v1.11.0
         Compiling platforms v3.0.2
         Compiling pin-project-lite v0.2.10
         Compiling crossbeam-deque v0.8.3
         Compiling crossbeam-channel v0.5.8
         Compiling zeroize v1.6.0
         Compiling backtrace v0.3.68
         Compiling indexmap v1.9.3
         Compiling crc32fast v1.3.2
         Compiling gimli v0.27.3
         Compiling rustix v0.37.23
         Compiling cpufeatures v0.2.9
         Compiling prost-derive v0.11.9
         Compiling pyo3-ffi v0.18.3
         Compiling errno v0.3.1
         Compiling object v0.31.1
         Compiling addr2line v0.20.0
         Compiling spin v0.9.8
         Compiling num-traits v0.2.15
         Compiling tempfile v3.6.0
         Compiling slab v0.4.8
         Compiling bytes v1.4.0
         Compiling prettyplease v0.1.25
         Compiling rustc-demangle v0.1.23
         Compiling regex-syntax v0.7.4
         Compiling bitflags v1.3.2
         Compiling hashbrown v0.12.3
         Compiling futures-channel v0.3.28
         Compiling futures-task v0.3.28
         Compiling regex-automata v0.3.3
         Compiling prost v0.11.9
         Compiling curve25519-dalek v4.0.0-rc.3
         Compiling parking_lot v0.12.1
         Compiling pin-project-internal v1.1.2
         Compiling block-buffer v0.10.4
         Compiling inout v0.1.3
         Compiling num-integer v0.1.45
         Compiling memoffset v0.8.0
         Compiling futures-util v0.3.28
         Compiling fixedbitset v0.4.2
         Compiling byteorder v1.4.3
         Compiling fastrand v1.9.0
         Compiling petgraph v0.6.3
         Compiling pin-project v1.1.2
         Compiling rayon v1.7.0
         Compiling cipher v0.4.4
         Compiling digest v0.10.7
         Compiling flate2 v1.0.26
         Compiling prost-types v0.11.9
         Compiling regex v1.9.1
         Compiling pyo3 v0.18.3
         Compiling curve25519-dalek-derive v0.1.0
         Compiling futures-macro v0.3.28
         Compiling which v4.4.0
         Compiling universal-hash v0.5.1
         Compiling heapless v0.7.16
         Compiling pyo3-macros-backend v0.18.3
         Compiling ring v0.16.20
         Compiling nanorand v0.7.0
         Compiling num-rational v0.4.1
         Compiling tokio v1.29.1
         Compiling pin-utils v0.1.0
         Compiling opaque-debug v0.3.0
         Compiling lazy_static v1.4.0
         Compiling protoc-bin-vendored-linux-ppcle_64 v3.0.0
         Compiling protoc-bin-vendored-win32 v3.0.0
         Compiling heck v0.4.1
         Compiling protoc-bin-vendored-linux-aarch_64 v3.0.0
         Compiling protoc-bin-vendored-linux-x86_32 v3.0.0
         Compiling multimap v0.8.3
         Compiling log v0.4.19
         Compiling weezl v0.1.7
         Compiling futures-io v0.3.28
         Compiling protoc-bin-vendored-linux-x86_64 v3.0.0
         Compiling protoc-bin-vendored-macos-x86_64 v3.0.0
         Compiling protoc-bin-vendored v3.0.0
         Compiling prost-build v0.11.9
         Compiling poly1305 v0.8.0
         Compiling flume v0.10.14
         Compiling pyo3-macros v0.18.3
         Compiling jpeg-decoder v0.3.0
         Compiling chacha20 v0.9.1
         Compiling hash32 v0.2.1
         Compiling tracing-core v0.1.31
         Compiling tokio-macros v2.1.0
         Compiling tracing-attributes v0.1.26
         Compiling aead v0.5.2
         Compiling fdeflate v0.3.0
         Compiling zune-inflate v0.2.54
         Compiling socket2 v0.4.9
         Compiling mio v0.8.8
         Compiling ip_network v0.4.1
         Compiling unindent v0.1.11
         Compiling bytemuck v1.13.1
         Compiling smoltcp v0.10.0
         Compiling half v2.2.1
         Compiling async-trait v0.1.71
         Compiling lebe v0.5.2
         Compiling untrusted v0.7.1
         Compiling stable_deref_trait v1.2.0
         Compiling spin v0.5.2
         Compiling ip_network_table-deps-treebitmap v0.5.0
         Compiling color_quant v1.1.0
         Compiling indoc v1.0.9
         Compiling bit_field v0.10.2
         Compiling exr v1.7.0
         Compiling ip_network_table v0.2.0
         Compiling gif v0.12.0
         Compiling qoi v0.4.1
         Compiling tracing v0.1.37
         Compiling png v0.17.9
         Compiling chacha20poly1305 v0.10.1
         Compiling tiff v0.8.1
         Compiling futures-executor v0.3.28
         Compiling x25519-dalek v2.0.0-rc.3
         Compiling mitmproxy v0.2.2 (/tmp/pip-install-3hsunsob/mitmproxy-rs_617044cbb859458a82eceb856b9c3982/local_dependencies/mitmproxy)
         Compiling hmac v0.12.1
         Compiling blake2 v0.10.6
         Compiling untrusted v0.9.0
         Compiling hex v0.4.3
         Compiling base64 v0.13.1
         Compiling managed v0.8.0
         Compiling boringtun v0.5.3
         Compiling futures v0.3.28
         Compiling image v0.24.6
      error: could not compile `boringtun` due to 14 previous errors
      warning: build failed, waiting for other jobs to finish...
      💥 maturin failed
        Caused by: Failed to build a native library through cargo
        Caused by: Cargo build finished with "exit status: 101": `PYTHON_SYS_EXECUTABLE="/usr/local/bin/python3.10" "cargo" "rustc" "--release" "--manifest-path" "/tmp/pip-install-3hsunsob/mitmproxy-rs_617044cbb859458a82eceb856b9c3982/Cargo.toml" "--message-format" "json" "--lib"`
      error[E0432]: unresolved import `poll`
        --> /home/floort/.cargo/registry/src/github.com-1ecc6299db9ec823/boringtun-0.5.3/src/device/mod.rs:47:5
         |
      47 | use poll::{EventPoll, EventRef, WaitResult};
         |     ^^^^ use of undeclared crate or module `poll`


      error[E0432]: unresolved imports `tun`, `crate::device::errno_str`, `super::errno`, `super::errno_str`
        --> /home/floort/.cargo/registry/src/github.com-1ecc6299db9ec823/boringtun-0.5.3/src/device/mod.rs:48:5
         |
      48 | use tun::{errno, errno_str, TunSocket};
         |     ^^^ use of undeclared crate or module `tun`
         |
        ::: /home/floort/.cargo/registry/src/github.com-1ecc6299db9ec823/boringtun-0.5.3/src/device/drop_privileges.rs:4:5
         |
      4  | use crate::device::errno_str;
         |     ^^^^^^^^^^^^^^^^^^^^^^^^
         |
        ::: /home/floort/.cargo/registry/src/github.com-1ecc6299db9ec823/boringtun-0.5.3/src/device/udp_unix.rs:4:13
         |
      4  | use super::{errno, errno_str, Error};
         |             ^^^^^  ^^^^^^^^^


      error[E0308]: mismatched types
         --> /home/floort/.cargo/registry/src/github.com-1ecc6299db9ec823/boringtun-0.5.3/src/device/api.rs:67:57
          |
      67  |                         "set=1" => api_set(&mut reader, d),
          |                                    -------              ^ types differ in mutability
          |                                    |
          |                                    arguments to this function are incorrect
          |
          = note: expected mutable reference `&mut LockReadGuard<'_, Device>`
                             found reference `&Device`
      note: function defined here
         --> /home/floort/.cargo/registry/src/github.com-1ecc6299db9ec823/boringtun-0.5.3/src/device/api.rs:202:4
          |
      202 | fn api_set(reader: &mut BufReader<&UnixStream>, d: &mut LockReadGuard<Device>) -> i32 {
          |    ^^^^^^^                                      -----------------------------


      error[E0308]: mismatched types
         --> /home/floort/.cargo/registry/src/github.com-1ecc6299db9ec823/boringtun-0.5.3/src/device/api.rs:97:57
          |
      97  |                         "set=1" => api_set(&mut reader, d),
          |                                    -------              ^ types differ in mutability
          |                                    |
          |                                    arguments to this function are incorrect
          |
          = note: expected mutable reference `&mut LockReadGuard<'_, Device>`
                             found reference `&Device`
      note: function defined here
         --> /home/floort/.cargo/registry/src/github.com-1ecc6299db9ec823/boringtun-0.5.3/src/device/api.rs:202:4
          |
      202 | fn api_set(reader: &mut BufReader<&UnixStream>, d: &mut LockReadGuard<Device>) -> i32 {
          |    ^^^^^^^                                      -----------------------------


      error[E0599]: no method named `set_fwmark` found for struct `Arc<UDPSocket>` in the current scope
         --> /home/floort/.cargo/registry/src/github.com-1ecc6299db9ec823/boringtun-0.5.3/src/device/peer.rs:130:22
          |
      130 |             udp_conn.set_fwmark(fwmark)?;
          |                      ^^^^^^^^^^ method not found in `Arc<UDPSocket>`


      error[E0063]: missing field `sin_len` in initializer of `libc::sockaddr_in`
        --> /home/floort/.cargo/registry/src/github.com-1ecc6299db9ec823/boringtun-0.5.3/src/device/udp_unix.rs:18:20
         |
      18 |         let addr = sockaddr_in {
         |                    ^^^^^^^^^^^ missing `sin_len`


      error[E0063]: missing field `sin_len` in initializer of `libc::sockaddr_in`
        --> /home/floort/.cargo/registry/src/github.com-1ecc6299db9ec823/boringtun-0.5.3/src/device/udp_unix.rs:58:20
         |
      58 |         let addr = sockaddr_in {
         |                    ^^^^^^^^^^^ missing `sin_len`


      error[E0063]: missing field `sin_len` in initializer of `libc::sockaddr_in`
         --> /home/floort/.cargo/registry/src/github.com-1ecc6299db9ec823/boringtun-0.5.3/src/device/udp_unix.rs:102:20
          |
      102 |         let addr = sockaddr_in {
          |                    ^^^^^^^^^^^ missing `sin_len`


      error[E0063]: missing field `sin_len` in initializer of `libc::sockaddr_in`
         --> /home/floort/.cargo/registry/src/github.com-1ecc6299db9ec823/boringtun-0.5.3/src/device/udp_unix.rs:181:24
          |
      181 |         let mut addr = sockaddr_in {
          |                        ^^^^^^^^^^^ missing `sin_len`


      error[E0599]: no method named `wait` found for struct `Arc<_>` in the current scope
         --> /home/floort/.cargo/registry/src/github.com-1ecc6299db9ec823/boringtun-0.5.3/src/device/mod.rs:234:29
          |
      234 |                 match queue.wait() {
          |                             ^^^^ method not found in `Arc<_>`


      error[E0599]: no method named `set_fwmark` found for reference `&Arc<UDPSocket>` in the current scope
         --> /home/floort/.cargo/registry/src/github.com-1ecc6299db9ec823/boringtun-0.5.3/src/device/mod.rs:491:18
          |
      491 |             sock.set_fwmark(mark)?;
          |                  ^^^^^^^^^^ method not found in `&Arc<UDPSocket>`


      error[E0599]: no method named `set_fwmark` found for reference `&Arc<UDPSocket>` in the current scope
         --> /home/floort/.cargo/registry/src/github.com-1ecc6299db9ec823/boringtun-0.5.3/src/device/mod.rs:495:18
          |
      495 |             sock.set_fwmark(mark)?;
          |                  ^^^^^^^^^^ method not found in `&Arc<UDPSocket>`


      error[E0599]: no method named `set_fwmark` found for reference `&Arc<UDPSocket>` in the current scope
         --> /home/floort/.cargo/registry/src/github.com-1ecc6299db9ec823/boringtun-0.5.3/src/device/mod.rs:501:22
          |
      501 |                 sock.set_fwmark(mark)?
          |                      ^^^^^^^^^^ method not found in `&Arc<UDPSocket>`


      error: aborting due to 13 previous errors


      Some errors have detailed explanations: E0063, E0308, E0432, E0599.

      For more information about an error, try `rustc --explain E0063`.

      Error: command ['maturin', 'pep517', 'build-wheel', '-i', '/usr/local/bin/python3.10', '--compatibility', 'off'] returned non-zero exit status 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for mitmproxy-rs
Failed to build mitmproxy-rs
ERROR: Could not build wheels for mitmproxy-rs, which is required to install pyproject.toml-based projects

@mhils
Copy link
Member

mhils commented Sep 24, 2023

Thanks for the quick turnaround. I'm afraid you're running into cloudflare/boringtun#82 here. That's a bit of a tricky problem for us unfortunately.

  1. We could make mitmproxy run without mitmproxy_rs, and then mark our dependency on mitmproxy_rs with a != openbsd platform marker (assuming such a thing exists). I'm happy to accept a patch for that, but it's nothing I'm actively pursuing.
  2. Alternatively, the obvious solution would be to fix up boringtun. To be frank I have no idea how much work that would take. We don't use their I/O parts, which seem to be failing here. 🤷

@floort
Copy link
Author

floort commented Sep 24, 2023

I see an aditional option:
Mark mitmproxy and/or mitmproxy_rs as only supporting win32, Linux and macOS and removing any reference to operating systems like OpenBSD from the docs. I'll submit a pull request for this option.

@mhils
Copy link
Member

mhils commented Sep 24, 2023

Looking a bit closer: boringtun does actually have device as a separate module (https://github.com/cloudflare/boringtun/blob/e1d6360d6ab4529fc942a078e4c54df107abe2ba/boringtun/src/lib.rs#L8-L9), so this should actually work again with the next mitmproxy release. Would you mind testing whether pip install mitmproxy-rs==0.3.5 works for you?

@floort
Copy link
Author

floort commented Sep 24, 2023

That might fix it when rust 1.72.0 is available in the next OpenBSD release. I will test and report back.

@mhils
Copy link
Member

mhils commented Sep 24, 2023

What Rust version is OpenBSD on right now? :)

@floort
Copy link
Author

floort commented Sep 24, 2023

That's version 1.68.0 for OpenBSD 7.3.

@mhils
Copy link
Member

mhils commented Sep 24, 2023

Thanks. I just shipped mitmproxy 10.1 with a MSRV of 1.70, looking forward to the next OpenBSD update! :)

@floort
Copy link
Author

floort commented Sep 24, 2023

Thanks. At least that build issue seems to be resolved. Tested on OpenBSD pre-release snapshots there is still an issue with the clock type in https://github.com/cloudflare/boringtun/blob/master/boringtun/src/sleepyinstant/unix.rs that I will report upstream.

@mhils
Copy link
Member

mhils commented Sep 24, 2023

Thanks! 🍰 If we can get a PR for boringtun that makes it work with OpenBSD, I'd be happy to point mitmproxy-rs to use that. That kind of patching is super easy with Rust fortunately.

@iamleot
Copy link

iamleot commented Jan 7, 2024

@floort what kind of issue? Is that due possibly use/reference of CLOCK_BOOTTIME?

I think something like cloudflare/boringtun#386 should do the trick if that's the case!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/triage Unclassified issues
Projects
None yet
Development

No branches or pull requests

3 participants