walles / px

ps, top and pstree for human beings
MIT License
249 stars 9 forks source link

Breaks on FreeBSD #95

Open yggdr opened 2 years ago

yggdr commented 2 years ago

This seems to be Linux/Mac-only at the moment :(

yggdrasil@midgard ~ master $ pipx install --python python3.9 pxpx
  installed package pxpx 1.6.0, Python 3.9.6
  These apps are now globally available
    - ptop
    - px
done! ✨ 🌟 ✨
yggdrasil@midgard ~ master $ ptop

---

Problems detected, please send this text to one of:
* https://github.com/walles/px/issues/new
* johan.walles@gmail.com

px version: 1.6.0

Python version: 3.9.6 (default, Jul 11 2021, 21:31:05)
[GCC 10.3.0]

Platform info: FreeBSD-13.0-RELEASE-p4-amd64-64bit-ELF

2021-12-23 13:49:34CET ERROR    Uncaught Exception
Traceback (most recent call last):
  File "/usr/home/yggdrasil/.local/pipx/venvs/pxpx/lib/python3.9/site-packages/px/px.py", line 99, in main
    _main(argv)
  File "/usr/home/yggdrasil/.local/pipx/venvs/pxpx/lib/python3.9/site-packages/px/px.py", line 220, in _main
    from . import px_top
  File "/usr/home/yggdrasil/.local/pipx/venvs/pxpx/lib/python3.9/site-packages/px/px_top.py", line 14, in <module>
    from . import px_poller
  File "/usr/home/yggdrasil/.local/pipx/venvs/pxpx/lib/python3.9/site-packages/px/px_poller.py", line 5, in <module>
    from . import px_load
  File "/usr/home/yggdrasil/.local/pipx/venvs/pxpx/lib/python3.9/site-packages/px/px_load.py", line 20, in <module>
    physical, logical = px_cpuinfo.get_core_count()
  File "/usr/home/yggdrasil/.local/pipx/venvs/pxpx/lib/python3.9/site-packages/px/px_cpuinfo.py", line 35, in get_core_count
    raise IOError("Unable to get cores info " + platform_s)
OSError: Unable to get cores info uname_result(system='FreeBSD', node='midgard', release='13.0-RELEASE-p4', version='FreeBSD 13.0-RELEASE-p4 #0: Tue Aug 24 07:33:27 UTC 2021     root@amd64-builder.daemonology.net:/usr/obj/usr/src/amd64.amd64/sys/GENERIC', machine='amd64') Python 3.9.6 (default, Jul 11 2021, 21:31:05)
[GCC 10.3.0]

yggdrasil@midgard ~ master $ px

---

Problems detected, please send this text to one of:
* https://github.com/walles/px/issues/new
* johan.walles@gmail.com

px version: 1.6.0

Python version: 3.9.6 (default, Jul 11 2021, 21:31:05)
[GCC 10.3.0]

Platform info: FreeBSD-13.0-RELEASE-p4-amd64-64bit-ELF

2021-12-23 13:52:22CET ERROR    Uncaught Exception
Traceback (most recent call last):
  File "/usr/home/yggdrasil/.local/pipx/venvs/pxpx/lib/python3.9/site-packages/px/px.py", line 99, in main
    _main(argv)
  File "/usr/home/yggdrasil/.local/pipx/venvs/pxpx/lib/python3.9/site-packages/px/px.py", line 243, in _main
    procs = list(filter(lambda p: p.match(search), px_process.get_all()))
  File "/usr/home/yggdrasil/.local/pipx/venvs/pxpx/lib/python3.9/site-packages/px/px_process.py", line 476, in get_all
    process = ps_line_to_process(ps_line.decode("utf-8"), now)
  File "/usr/home/yggdrasil/.local/pipx/venvs/pxpx/lib/python3.9/site-packages/px/px_process.py", line 357, in ps_line_to_process
    raise Exception("Failed to match ps line <%r>" % ps_line)
Exception: Failed to match ps line <',ppid=,rss=,lstart=,uid=,pcpu=,time=,%mem=,command=\n'>
walles commented 2 years ago

I see two levels of FreeBSD support.

To actually claim support for FreeBSD I'd need to have CI on FreeBSD, suggestions welcome.

But to just get it working for now, a PR from an interested FreeBSD user would be enough.

Make sure tox.sh passes before submitting!