-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Enable build on IBM i PASE (variant of AIX) #1415
Conversation
UIhm... adding support for a brand new exotic platform. I like it. =) return PyErr_SetString(PyExc_NotImplementedError, "not implemented on IBM PASE"); I'm not sure how to proceed with this. What are the main blockers for implementing those functions on IBM PASE? Of course that would be much more desirable, even though I know it's not gonna be a piece of cake... |
The lack of libperfstat on IBM i, combined with a lack of I'll go ahead with the |
Added the |
Could you paste the output of |
Sure. The
|
Mmm... tests don't run and this is weird:
Looks related to a change I made in 5.5.1. I suspect we'd get the same error on plain AIX (and unfortunately I don't have an AIX to test against). |
Actually that's not weird (I misread the exception), but still it seems tests didn't run. |
Yeah, I blindly figured it has something to do with the complete braindeadedness of basic functions. Didn't read much into it |
Wouldn't it be better to "ifdef out" the entire functions, their exports from the C extension, and their interface from the main psutil file, like we do for other functions - e.g. |
@wiggin15 while I'm at it I wanted to update doc describing platform support. Do you know what AIX versions do we support exactly? |
The oldest version I could test was 6.1 TL 8. It should work on this version and later. |
@wiggin15 , that would be a good way to go about it also. I can work on that (I'll need a couple days to get to it). Thanks! |
Refactored based on @wiggin15's suggestion (makes a lot more sense!). Thanks! |
Can we take a look at |
(...in a txt file if you can) |
... but now
|
Yes, with the def _not_supported(*args, **kw):
raise NotImplementedError("not supported on this platform")
if hasattr(cext, 'disk_io_counters'):
disk_io_counters = cext.disk_io_counters
else:
disk_io_counters = _not_supported |
In an effort to get Now, however, stuck here when I run
This is probably a simple case where we need to disable those tests (probably in |
It's OK if tests are failing with |
Works for me. When I get close to AIX equivalence, we can discuss the test suite more sensibly. |
At this point, I think I've done what I can do without serious rip-up of the existing AIX path. I"m ready for this to land when you are. Many things don't work, but an install of In a future PR, I will split IBM i into its own source files for both the native and python side, because:
... but I would love for this interim version to go live in the meantime. |
Please attach the test output. |
|
For the APIs which fail at import time you can do this for now: IPASE = os.uname().sysname == 'OS400'
if IPASE:
def disk_io_counters(*args, **kw):
return {}
else:
disk_io_counters = cext.disk_io_counters
Generally speaking, this is not what I have in mind. Other than merely being able to |
@giampaolo, that's fair enough. Other than system-wide CPU and memory metrics, are there any other specific things you would want implemented before accepting the new platform support? I'll work on those. In the meantime, I'll start from scratch, pulling IBM i into its own modules for both the Python and C code. It probably makes sense to close this PR until I have something more fully-baked. |
I would say you can exclude the most difficult ones for now, which are likely gonna be:
As for where to put the C code: I think it will be more clear once you'll start adding stuff, but if you feel the need to split then do it in a Also: can this be considered an AIX platform the same way FreeBSD OpenBSD NetBSD are "BSD"? |
Quite often, we treat IBM i as an AIX variant. In fact, Python self-identifies as "AIX" as you can see. That is because IBM i runs an AIX runtime on top of an IBM i kernel. Often we say we're AIX and address some minor differences. For I'm 100% fine either way, just want you to understand that we're only about 30% similar to AIX. Thanks for your patience and assistance! It's going to be rocking once this is all working! |
For now keep Also what is Feel free to use |
In this commit, I am enabling this important package to build on IBM i. For now, this means a simple "no op" for several of the operations that IBM i PASE does not support.
In the future, me or my team will fill in the missing capability. With this PR, I intend to allow
pip install
of psutil to succeed (resulting applications may still work if errors are handled elegantly). That'll be much better than failed installs!