-
-
Notifications
You must be signed in to change notification settings - Fork 156
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
Do not rely on Node.js internals #296
Conversation
@mcollina thanks! It looks like these changes devastated Windows. Any ideas? |
@phated I've just checked on a Windows box, and it's failing even on master with Node 8 and 6. It's not related (but should probably be fixed anyway in another PR). |
@mcollina not sure about that https://ci.appveyor.com/project/gulpjs/vinyl-fs/build/735 - we've had successful builds for quite some time. |
@phated these are what I am getting (more or less all of the same, ENOENT on files):
(this is node 6 on master) Maybe a dependency changed and broke things? |
Can you trigger a build on master? |
@mcollina done and still passing on Windows: https://ci.appveyor.com/project/gulpjs/vinyl-fs/build/738 |
Since version 2.3.0, readable-stream offers _final in Writable.
@phated the test suite on master fails on Windows Home Edition. I guess it's due to the permissions required to create symlinks (I stumbled upon that in the past, and it seems the case). I ended up removing FlushWriteStream and using Writable directly (since readable-stream 2.3.0 it offer |
Oh wow, so |
Yes! |
This restores compatibility with Node 9 by lifting the code from Node 8.9.4 and copying and pasting it here. This should have been the approach from the very beginning, because vinyl-fs is creating its own WriteStream that has very little in common with the one from Node core.
Unfortunately, pulling functions from a prototype and attaching them to a non-related one is a very dangerous technique: as you can imagine a function attached to a prototype relies on the state that is created by the relative constructor. These are implementation details, and they can surely change across major versions.
As a side note, this was likely broken by nodejs/node#15407 and nodejs/node#18002.
Fixes #295
The actual logic can probably be simplified, because vinyl-fs
WriteStream
implementation is different than the one in Node core.