Skip to content
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

danger local fails to run in WSL #537

Closed
samdmarshall opened this issue Mar 18, 2018 · 5 comments
Closed

danger local fails to run in WSL #537

samdmarshall opened this issue Mar 18, 2018 · 5 comments

Comments

@samdmarshall
Copy link

samdmarshall commented Mar 18, 2018

I've been trying to migrate to using Danger-JS for some of my projects, however i'm having a hard time running danger in my environment. I am running danger inside of the Windows Subsystem for Linux (WSL), and the compatibility layer there seems to be what is tripping me up in understanding what is going on. The behavior I'm seeing is identical to what is described here: microsoft/WSL#1774

internal/process/stdio.js:99
        throw new errors.Error('ERR_UNKNOWN_STDIN_TYPE');
        ^

Error [ERR_UNKNOWN_STDIN_TYPE]: Unknown stdin file type
    at process.getStdin [as stdin] (internal/process/stdio.js:99:15)
    at Object.<anonymous> (/home/demi/.nvm/versions/node/v8.0.0/lib/node_modules/danger/node_modules/get-stdin/index.js
:2:20)
    at Module._compile (module.js:569:30)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/demi/.nvm/versions/node/v8.0.0/lib/node_modules/danger/distribution/commands/danger-ru
nner.js:44:16)

The existing work-around seems to be setting a timeout on the end() call to any stdin, which I've tried to add for the instance it gets used in commands/utils/runDangerSubprocess.ts, but was unable to properly verify if that had any impact -- I ran yarn link in my checkout of danger then yarn link danger in my project directory, since my understanding is that doing that would allow me to have yarn execute the modified version of danger-js, and not the one it installed into my node_modules/; however that didn't seem to make a difference. Since I am not familiar with Typescript, or working with Node I wasn't sure what would be the correct fix or course of action here. I figured the least I could do was document this incompatibility incase others run into it.

OS Info:

Windows 10 1709 (16299.309)

Distributor ID: Ubuntu
Description:    Ubuntu 16.04.4 LTS
Release:        16.04
Codename:       xenial

Danger Version: 3.2.0
Yarn Version: 1.5.1
Node Version: v8.0.0 and v8.10.0

@samdmarshall samdmarshall changed the title Danger fails to run in WSL danger local fails to run in WSL Mar 18, 2018
@orta
Copy link
Member

orta commented Mar 20, 2018

So, I don't know too much about this also - I've been running Danger on windows boxes from close to day one via appveyor - that said, this does seem to be raising inside get-stdin which is a library we use.

Any chance you can clone it and run its tests? I think this should do it:

git clone https://github.com/sindresorhus/get-stdin.git
cd get-stdin
npm install
npm test

Some of this stack overflow issues imply that it's a NodeJS + Windows issue too, https://stackoverflow.com/questions/35820422/unknown-stdin-file-type-error-in-windows

Ergh, yeah, not too sure here

@samdmarshall
Copy link
Author

Running that says 4 tests passed, no errors as far as I can tell.

@samdmarshall
Copy link
Author

Additionally, I want to point out the distinction that this is the WSL, i'm not running danger or any of the related tooling in a windows environment; it is being run in the Linux environment. I think this is a WSL issue that will hopefully be resolved in a future update. I felt responsible to document this as not working for the time being. I have been able to run yarn danger pr ... successfully, with the exception of the problems relating to typescript that I mentioned in slack.

@samdmarshall
Copy link
Author

Closing this as it seems like this particular issue has been resolved in a recent update.

@blackxored
Copy link

Still happening for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants