-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
avoid call to stdin on Windows #1000
Conversation
As seen in other repos (namely https://github.com/evantahler/actionhero/pull/360) IISNode has no notion of stdin, so accessing stdin in base-reporter throws an exception.
Hmm, I wonder why the reporter even needs stdin? I wonder if it could lazily grab stdin as needed rather than touching it in the constructor.
This is an awesome idea! 😄 |
I've uploaded the extension where the behaviour is visible to the Visual Studio Gallery; code for the extension is at https://github.com/MiguelAlho/YarnTaskRunner |
@MiguelAlho can you rebase please. |
@Daniel15 @bestander I've been unable to get this working correctly - or better yet - unable to make the tests pass. There are a pair of tests that timeout, which might be an indication that some point is waiting for input. Unfortunately, i haven't learned enough yet to actually debug it, and integrating it with broken tests is undesirable. All I was trying to do here is "stub" an stdin implementation, in a Null-Object pattern approach. The implementation though is for some reason incorrect. Also, I made a bad mistake of working on Master on my fork so the commit history is all mixed up. Would it make sense to close this and reopen based on a clean master and a feature branch? |
@MiguelAlho yeah, go ahead, let's close and open a new one. |
Hi, @bestander Is there a new PR with a fix to the reported problem? |
@nelsonmorais I never got back to reimplementing the "fix". Basically, every attempt I made to fix it on the codebase made tests fail, (mostly failures with reporters) and I never figured out how to get around them. I'm a bit limited in developing with node, so I blocked. Unfortunately I never got the time to go back to it. Maybe it's easier with the most recent versions, or maybe the same failures will appear - i haven't tried yet. The only thing I tried to do was create a substitute for stdin when on windows: ` const Readable = require('stream').Readable; //StandinStdin serves as a stub for stdin, to be used _read(size: number) {
|
Hi @MiguelAlho, Thanks for the quick response. |
@Daniel15 I'm joining this thread a bit late, but this issue is still preventing the Visual Studio extension from working. You questioned why |
@scottaddie thanks for taking care of this! |
@MiguelAlho Thank you for all the time you spent on this. That definitely expedited the process for me. Now to wait for an official Yarn release to test this out. |
@MiguelAlho @Daniel15 Thank you both for your effort. |
Summary
As seen in other repos (namely https://github.com/evantahler/actionhero/pull/360) IISNode has no notion of stdin, so accessing ´stdin` in base-reporter throws an exception.
While developing an extension for Visual Studio's Task Runner Explorer component, that would allow devs to call yarn commands (and maybe run scripts) from this window. This is similar to existing extensions for other task-enabled engines like gulp, grunt, and npm. These tasks can also be binded to some of the IDEs events such as "project open". This is great for my current use case - when a yarn enabled project is open, run
yarn install
automatically.Unfortunately, when executing yarn through the extension (which is really calling
cmd.exe /C yarn install
) the following error appears:Hacking around a bit and using the info in the link above, the repose to the command returns the desired output:
Test plan
A clean clone did not produce a valid code run (I checked on discord and the info available was that some tests where not running.
With visual studio installed, the extension I created can be installed and used to test the change.
I don't have experience with testing in node, so I , unfortunately, have no idea where to start, especially for something system / platform specific...