Replies: 6 comments 2 replies
-
Amazing job, I will take it out of a drive and let you know how it works. |
Beta Was this translation helpful? Give feedback.
-
Nice! Some of these issues (path trimming and signal) can be fixed easily enough, for signals I'm happy to disable that functionality where its not supported. For the other issues I don't have any idea and don't have a Windows device to test on (nor have the time do so 😅 ) I think the true test is running the test suite on Windows as we can only say Windows is supported once we have a working CI pipeline for windows. |
Beta Was this translation helpful? Give feedback.
-
Good point, maybe I'll start with that, and perhaps the tests will find the causes of the problems for me. I don't know anything about setting up CI pipelines on GitHub though. |
Beta Was this translation helpful? Give feedback.
-
adding a windows job to |
Beta Was this translation helpful? Give feedback.
-
To be completely honest, if there's anything I enjoy less than editing YAML files which I don't understand that act as build scripts, it's running tools which I don't understand to generate said YAML files. I'd appreciate it greatly if you could handle this part. (I'm not sure if we can even do that if the job wouldn't be passing, anyway?) |
Beta Was this translation helpful? Give feedback.
-
For anyone following this issue, but not all the pull requests: I've been chipping away at the various problems (#2552, #2554, #2567, phpactor/test-utils#12, #2568, #2572, #2569, phpactor/language-server#58). I also found the cause of the loop getting stuck, which seemed like the most difficult problem – it turns out that someone had already discovered this as a bug in amphp/process some years ago, and I now submitted their patch as a pull request there: amphp/process#72 |
Beta Was this translation helpful? Give feedback.
-
After reading #1858, I decided to see what it would take to get Phpactor running on Windows, without Docker, WSL etc. as discussed in that issue. I'm happy to report that I got it working, with a few small but really ugly hacks to Phpactor and its dependencies. I'm filing this to document the underlying issues, and ask for some suggestions as for how to resolve them properly.
This is the full list of changes I have locally. I haven't tested everything, but at the very least I get completions and hover tips when using Sublime Text on Windows 10 on the https://github.com/wikimedia/mediawiki repository (tested with PHP 8.1 and 8.3).
There are four kinds of hacks here:
yield new Delayed(…)
. Otherwise, the event loop would sometimes get stuck, and the Phpactor server would stop processing any requests. This occurred with both Amp\Loop\NativeDriver and with Amp\Loop\EventDriver. I can't figure out why it happens, but it's true. I'm hoping you might have some idea. (Maybe this gets magically resolved in the future by the new AMPHP version that no longer ships its own event loop, as promised at https://amphp.org/upgrade#event-loop – I didn't try to install or even find it.)(Commenting them out presumably prevents other coroutines from running in these places, but it didn't seem to break anything for me.)
/
from file paths in several places. The paths looked like/C:
, which is invalid. Some Unix path handling must be leaking somewhere, but I didn't really try to figure out where the bad data was coming from. Apart from this, Windows paths seem to be handled well.Loop::onSignal(SIGINT, …)
. Signals are not supported on Windows. This is only used to "gracefully shut down" the server, and I'm not sure if that's even necessary, but it might be possible to implement something equivalent using sapi_windows_set_ctrl_handler().(And then you could remove the dependencies on
ext-pcntl
andext-posix
from composer.json – as far as I can tell, the only thing you're directly using from them is theSIGINT
constant, everything else is handled by libraries that already support Windows.)yield new Delayed(…)
calls?Lastly, I had the server crash like this a couple of times. I couldn't reproduce it when I tried, and restarting it made it go away.
If you have the time to offer some advice – or at least educated guesses – about what causes these problems, and outline how you'd want them to be fixed, I'd be happy to work on some proper patches, and get rid of my local hacks.
Even if you don't have the time for this, perhaps it helps someone else. :)
Beta Was this translation helpful? Give feedback.
All reactions