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

Possible TTY fix? #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Possible TTY fix? #19

wants to merge 1 commit into from

Conversation

jtenner
Copy link

@jtenner jtenner commented Jul 16, 2019

Fixes #18

I think this might do it. When I go into node_modules and make this change, I can quickly write to stdout like this.

Only problem is that I can't run the tests from windows because I get a couple of errors.

> wasi@0.0.6 test C:\Users\jtenner\Desktop\projects\node-wasi
> node test/run.js

cant_dotdot
'rm' is not recognized as an internal or external command,
operable program or batch file.
'rm' is not recognized as an internal or external command,
operable program or batch file.
The system cannot find the path specified.
fs.js:126
    throw err;
    ^

Error: ENOENT: no such file or directory, open 'C:\Users\jtenner\Desktop\projects\node-wasi\test\out/cant_dotdot.wasm'
    at Object.openSync (fs.js:447:3)
    at Object.readFileSync (fs.js:349:35)
    at Object.<anonymous> (C:\Users\jtenner\Desktop\projects\node-wasi\test\runner.js:8:16)
    at Module._compile (internal/modules/cjs/loader.js:776:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:643:32)
    at Function.Module._load (internal/modules/cjs/loader.js:556:12)
    at Function.Module.runMain (internal/modules/cjs/loader.js:839:10)
    at internal/main/run_main_module.js:17:11 {
  errno: -4058,
  syscall: 'open',
  code: 'ENOENT',
  path: 'C:\\Users\\jtenner\\Desktop\\projects\\node-wasi\\test\\out/cant_dotdot.wasm'
}
assert.js:89
  throw new AssertionError(obj);
  ^

AssertionError [ERR_ASSERTION]: Expected values to be strictly equal:

1 !== 0

    at C:\Users\jtenner\Desktop\projects\node-wasi\test\run.js:75:12
    at Array.forEach (<anonymous>)
    at Object.<anonymous> (C:\Users\jtenner\Desktop\projects\node-wasi\test\run.js:52:7)
    at Module._compile (internal/modules/cjs/loader.js:776:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:643:32)
    at Function.Module._load (internal/modules/cjs/loader.js:556:12)
    at Function.Module.runMain (internal/modules/cjs/loader.js:839:10)
    at internal/main/run_main_module.js:17:11 {
  generatedMessage: true,
  code: 'ERR_ASSERTION',
  actual: 1,
  expected: 0,
  operator: 'strictEqual'
}
npm ERR! Test failed.  See above for more details.

Do think this will work? Or should there be something else?

How can I get testing working?

Thanks for your help.

@jtenner
Copy link
Author

jtenner commented Jul 22, 2019

Any news? I would really love to test tty output and input soon!

@devsnek
Copy link
Owner

devsnek commented Jul 22, 2019

Sorry this slipped off my radar. I have no idea if this fixes the problem. I'm not sure that the changes except for line 515 need to be there.

@jtenner
Copy link
Author

jtenner commented Jul 22, 2019

Yeah don't get me wrong. I'd love to help out. Are you a part of the assemblyscript slack server? I'm happy to help submit the work needed to fix this problem. I just need guidance and help.

@devsnek
Copy link
Owner

devsnek commented Jul 22, 2019

i think it would probably be better to change this to store process.stdout, process.stderr, etc., internally for stdio instead of using their FDs.

@jtenner
Copy link
Author

jtenner commented Jul 22, 2019

Makes sense. I'll revisit this soon.

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

Successfully merging this pull request may close these issues.

Error: EISDIR: illegal operation on a directory, fstat
2 participants