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

fix(node): Node 10 support #5769

Merged
merged 21 commits into from May 23, 2018
Merged

fix(node): Node 10 support #5769

merged 21 commits into from May 23, 2018

Conversation

imsnif
Copy link
Member

@imsnif imsnif commented May 1, 2018

Summary

  1. Added node 10 to CircleCI
  2. Fixed a test that was using the net.createServer method. This was having issues, likely because of this: stream: 'end' is no longer emitted after 'error' nodejs/node#20334 - it now uses a "normal" http server instead, serving the same purpose.
  3. Changed the readFirstAvailableStream method in util/fs.js. I'm guessing this is related to the same issue as 2, but there have been quite some changes in 10 that might be causing this - so it's just a guess. Since this piece of code could be clearer and more conceise anyway, I opted to just change it. Now instead of relying on the stream error event to check if a file exists, it just explicitly checks it before starting the stream.
  4. Upgraded upath from 1.0.2 to 1.0.5 which supports node 10 (found through its engines field when installing).
  5. Upgraded Jest
  6. Fixed a bug regarding replacing symlinks to non-existent targets on Windows
  7. Removed a redundant test
  8. Fixed two test cases that were failing frequently on macOS builds

fixes #5761
fixes #5477

Test plan

CI should be green (including and especially the new node10 job!)

@imsnif imsnif requested a review from BYK May 1, 2018 14:07
@buildsize
Copy link

buildsize bot commented May 1, 2018

File name Previous Size New Size Change
yarn-[version].noarch.rpm 917.66 KB 917.39 KB -272 bytes (0%)
yarn-[version].js 3.97 MB 3.97 MB -529 bytes (0%)
yarn-legacy-[version].js 4.13 MB 4.13 MB -711 bytes (0%)
yarn-v[version].tar.gz 922.68 KB 922.48 KB -202 bytes (0%)
yarn_[version]all.deb 681.48 KB 681.15 KB -340 bytes (0%)

@BYK BYK self-assigned this May 1, 2018
@arcanis
Copy link
Member

arcanis commented May 2, 2018

We should remove ref and anything that require it from the tests - it's a native dependency, so it's no surprise it breaks for some versions of Node :/

@leosco
Copy link

leosco commented May 3, 2018

@imsnif have you updated Yarn's usage of Buffer() to Buffer.from() instead? Since upgrading to Node v10, every yarn command I run causes this warning to be printed:

(node:14277) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.

Unless there's a problematic edge case I'm not aware of, you could probably do a quick find/replace and include that commit in this PR 😄

@BYK
Copy link
Member

BYK commented May 3, 2018

@leosco this was already done.

@mattpilott
Copy link

When will this move to a release?

@BYK
Copy link
Member

BYK commented May 4, 2018

@matt3224 once we figure out the issue with Windows builds, we'll merge this PR and release a new version.

@kachkaev
Copy link

kachkaev commented May 8, 2018

@BYK any news? 🙏

@arcanis
Copy link
Member

arcanis commented May 8, 2018

replace the symlink when it changes, when using the link: protocol is still failing on Windows. If someone on this platform can give us a hand, it would be super helpful :)

@theandrewlane
Copy link
Contributor

@BYK @aracarie - Can we clear the AppVeyor build cache and rerun this build? 🤞🙏

I don't have a Windows machine, otherwise I would help!

@BYK
Copy link
Member

BYK commented May 22, 2018

Good news everyone! I've traced the issue down to a change in how fs.realpath works on Windows with symlinks pointing to non-existent targets. I'm working on a fix and will also likely to report this to the Node community if it wasn't reported already.

Copy link
Contributor

@rally25rs rally25rs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a couple minor comments, but overall looks good.

Ran tests locally on OSX node v8 and v10. Ran yarn cache clear && yarn install against the most complex project I have available (>1,000 total packages get installed, and includes some github urls and resolutions) and it worked.

@@ -1,2 +0,0 @@
# this file will be generated
index.js
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was there a reason to stop ignoring this file? I assume git won't see any changes between test runs, just seemed unrelated to the node10 changes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. This file was dynamically written right before two test runs which I believe was responsible for the test failures on macOS. See 5392392 for the full change related to this.

});
});

test.concurrent('should install if symlink source does not exist', async (): Promise<void> => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was this test removed as part of a behavior change? From the package.json in this test's fixture, it's hard to tell what was actually being tested...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh nevermind, I see this was part of a commit "remove redundant test"

@rally25rs
Copy link
Contributor

fyi, I added a couple "fixes" references to the original PR text so we can get a couple node10 specific issues closed out when this merges.

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