-
-
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
Cygwin Support #82
Comments
From [email protected] on March 19, 2010 18:21:45
|
From [email protected] on May 12, 2010 09:29:40
|
From g.rodola on June 19, 2010 11:14:39
Status: WontFix |
Would you accept a patch to add Cygwin support? |
I must admit I've never used it and don't know much about it. What would it take to add support? What benefits would it bring exactly (e.g. why would you want to use psutil from cygwin)? |
I know a decent amount about it--have spent some time (more than I would like to admit) in its internals.
From my initial experiments, the easiest way to add support would be to explicitly add it as a platform. It's too different either from Linux, or plain Windows, to try to shoehorn support for it into either the existing Windows or Linux platform-specific modules. However, it would reuse a decent amount of code from both, which might result in (a hopefully small) amount of refactoring. Fortunately not a lot of new code would need to be written. Most methods from the Linux module work--those that don't can be made to work with existing code from the Windows module. It's just a matter of pulling the right bits in from the right places. Additionally, a configuration would have to be added to the AppVeyor builds that includes Cygwin. I haven't tried using Cygwin in AppVeyor yet, but it's something I'm working on.
The same benefits psutil has on any other platform :) Ok, to be less glib, my primary motivation is work on SageMath (e.g. https://trac.sagemath.org/ticket/21598). I'm working on getting Sage working on Windows, which for some time at least will continue to require Cygwin. Sage is in the process of switching to psutil for all process-inspection related functionality (a move I strongly supported!) However, I did not realize cygwin support was missing, so that permanently breaks my Cygwin builds. That said, I think Cygwin is still a useful platform to support in general, if I add a support module for it I'm willing to maintain it. |
Thanks for the info. OK, if you want to go for it you have my blessing. Do you have any idea about where you might start already? Can I help you in any way?
That is encouraging as there are a lot of platforms to test and keep under control already. Adding cygwin to appveyor CI (assuming it's possible) would be great in this sense. |
@giampaolo Thanks for your blessing--that alone is a big help; knowing that if I can get this working to your satisfaction I won't have to maintain a fork forever is encouraging. Will let you know if I have any questions. As far as setup goes, this doesn't require much beyond what's already there for Linux, though it will be necessary to document what packages are needed in Cygwin. Beyond that I just made a virtualenv and ran |
Just to update, I'm actually nearly done a prototype Cygwin port of psutil. Been working for it off and on over the last several months. The only hold up right now is I'm trying to get the tests to pass on AppVeyor. Stay tuned... |
@embray that sounds cool; I would be very interested in seeing cygwin support for psutil. Are there some functionalities you weren't able to implement? How "beta" is this? Let me know if I can help in any way. |
@giampaolo All the tests pass on Python 2 and 3 (except on AppVeyor where I am still having some problems, especially with Python 3, for some reason). There are a couple bits of functionality that don't/can't work. Most notably, reading the environment of arbitrary processes doesn't work (or at least didn't, which actually led me to submit a patch, now accepted, to Cygwin to support |
I'll try to have a PR up before long. |
...so what file will contain the implementation? _pswindows.py or _pslinux.py? Are you working in a public accessible branch I can look at? |
@giampaolo Regarding Cygwin, only Python 2.7 and 3.4 are available anyway (Cygwin support on Python 3 has not been maintained well, which is something I'm also working to fix). There is a new |
Cool, thanks for clarifying. |
FYI ... current cygwin says:
Is this enough to treat Cygwin as a pseudo-standard port? |
@embray I did look through that -- it was depressing. :) Thanks! |
Hi. Thanks @embray for your work. I'm also quite interested in this, I divide my work environment between plain linux and my workstation also running windows. Question: I did notice you sent patches to cygwin, which is great ! How much more of your port is actually working around limitations of Cygwin, instead of trying to integrate better with Windows when possible ? Briefly looking at the patches seems you're trying to do fully windows compatible psutil running on cygwin. I would expect the cygwin psutil to just be aware of the cygwin environemnt as if it was a linux port. Thank you again. |
@joaoe I haven't worked on it in a while but I haven't dropped it entirely--I'm still working on some refactoring effort. I'm also working on moving some code out to a separate As to your question, I think the port is trying to use as much as possible from the POSIX-compliant interfaces in Cygwin. But it should not be said that Cygwin is a "Linux port". While Cygwin does adapt some features and inspiration from Linux (such as some of the layout of For my port, there are parts that go directly through Windows since those features aren't available in Cygwin. This is particularly true in the case of enumerating network interfaces. An alternative would be to simply disable those features of psutil on Cygwin, and I'm not totally opposed to that either. But my experience so far has been that it's worth keeping those features until and unless it's possible to port those features to Cygwin (something I would like to do, for example, is fill out more of |
So does this just need refactoring? Is it complete in terms of features? |
I'm not sure--I think there have been features added to psutil since I first started on my port that now aren't supported. But that could be handled separately if necessary--i.e. simply document those features as unsupported on Cygwin for now, and add support if/when there's time or enough demand. I'm thinking in particular of sensors. I also need to get the AppVeyor build for Cygwin working. I was trouble with a few tests IIRC. |
There's no reason to deny the install. It doesn't have to work properly and can throw an exception when used but installation should be allowed. This would allow its use with Ansible. My local system is Windows and I'm managing remote Linux nodes with Ansible. Ansible copies the module on the target node for execution, which means it should work properly. |
@embray this is still relevant. If you have time, please, contribute. |
I need to use psutil on cygwin, im waiting since 2014 im getting mad at you, last person i got mad with, died. |
Would also love this. The aws cli is horrifically slow on all platforms, including cygwin, and sadly, aws is behind much of the internet now, including my little corner of development. It turns out there's a nifty little python script that will use the python libs to access aws services much more quickly than one can from the command line, but (you guessed it) it requires psutil: https://github.com/janakaud/aws-cli-repl/blob/master/awsr |
For continuous integration, might GitHub Actions replace Appveyor? |
@embray can we just enable use for the cygwin platform so we can encounter errors as they happen on the machine, rather than during install? I'm blocked from installing tools due to this |
@lufinkey - if I remember correctly, giampaolo banned embray |
Oh, but why a ban?
…On Tue, Dec 14, 2021, 10:40 AM Samuel Lelièvre ***@***.***> wrote:
@lufinkey <https://github.com/lufinkey> - if I remember correctly,
giampaolo banned embray
from contributing to this repo. Besides, the SageMath project's
dependency on psutil, which was likely a significant factor in
embray's motivation to port psutil to Cygwin, was eliminated.
So someone else might have to take over on Cygwin support.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#82 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB3VGUMQP6DZFOR3B2JIN23UQ5QPLANCNFSM4APXBEYA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
This issue is preventing me from installing JupyterLab (Python3) on Cygwin. I really hope it's not because of some personal feud here..? That sort of thing makes open source look bad. |
Me too, I came here when I cannot install JupyterLab on Cygwin. |
@giampaolo could we have an update on what's blocking these changes? |
@lufinkey the old PR mentioned in this ticket was a PoC and largely incomplete. It was never merged. As of today there is no progress on this ticket. |
This issure prevent me from install Jupyter Notebook to use the octave kernel |
From [email protected] on March 20, 2010 02:17:54
Original issue: http://code.google.com/p/psutil/issues/detail?id=82
The text was updated successfully, but these errors were encountered: