Skip to content

Update node-haste and replace fast-path with node-haste's version to fix Windows compatibility - #6260

Closed
janicduplessis wants to merge 1 commit into
react:masterfrom
janicduplessis:fix-windows
Closed

Update node-haste and replace fast-path with node-haste's version to fix Windows compatibility#6260
janicduplessis wants to merge 1 commit into
react:masterfrom
janicduplessis:fix-windows

Conversation

@janicduplessis

Copy link
Copy Markdown
Contributor

This is the last bits needed to fix Windows compatibility on master, most of the work was done in node-haste.

Test plan
Run npm test
Run the packager using Windows and Mac

cc @cpojer@davidaurelio

@facebook-github-bot

Copy link
Copy Markdown
Contributor

By analyzing the blame information on this pull request, we identified @cpojer, @davidaurelio and @martinbigio to be potential reviewers.

@facebook-github-botfacebook-github-bot added GH Review: review-needed CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. labels Mar 3, 2016
@janicduplessisjanicduplessis changed the title Update node-haste and replace fast-path with node-haste's verrsion to fix Windows compatibilityUpdate node-haste and replace fast-path with node-haste's version to fix Windows compatibilityMar 3, 2016
@davidaurelio

Copy link
Copy Markdown
Contributor

@facebook-github-bot shipit

@facebook-github-bot

Copy link
Copy Markdown
Contributor

Thanks for importing. If you are an FB employee go to Phabricator to review.

@davidaurelio

Copy link
Copy Markdown
Contributor

@janicduplessis will have to take care of the node_modules updates internally first. Will look into it in a few. Maybe we could even get Travis back to green this morning before merging this

@davidaurelio

Copy link
Copy Markdown
Contributor

This has internal errors. no idea whether it’s flakiness or really broken :-(

@janicduplessis

Copy link
Copy Markdown
ContributorAuthor

Hmm the tests on circleci fails with this

Error: Cannot find module 'node-haste/lib/fastpath'
at Function.Module._resolveFilename (module.js:339:15)
at Function.Module._load (module.js:290:25)

Looks like the node-haste version doesn't get updated properly.

@janicduplessis

Copy link
Copy Markdown
ContributorAuthor

Also the UIExplorer app is broken since a few commits, the tests on travis seems to fail because of that. If you have any internal tests that depend on that is may be why it fails.

@davidaurelio

Copy link
Copy Markdown
Contributor

The UIExplorer have been reverted in the meantime afaik. @bestander is having a look at this now

@bestander

Copy link
Copy Markdown
Contributor

@janicduplessis I would appreciate if you rebase.
CI should be stable-ish now

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@janicduplessis updated the pull request.

@bestander

Copy link
Copy Markdown
Contributor

JS does not look good in tests

@janicduplessis

Copy link
Copy Markdown
ContributorAuthor

I can confirm that it stills install node-haste@2.4 even if I changed the package.json. Is that caused by npm shrinkwrap? I'm not sure how that works as I've never used it before.

├─┬ node-haste@2.4.0 │ ├── graceful-fs@4.1.3 │ ├─┬ sane@1.3.3 │ │ ├─┬ exec-sh@0.2.0 │ │ │ └── merge@1.2.0 

From the npm install logs.

@ide

ide commented Mar 3, 2016

Copy link
Copy Markdown
Contributor

@janicduplessis package.json is completely ignored when shrinkwrap is present.

@facebook-github-bot

Copy link
Copy Markdown
Contributor

@janicduplessis updated the pull request.

@janicduplessis

Copy link
Copy Markdown
ContributorAuthor

Aww, e2e test on iOS fails with

 [Info] Collecting info for testables... (4131 ms)
run-test EndToEndTestTests.xctest (iphonesimulator9.2, iPhone 4s, application-test)
[Info] Installed 'org.reactjs.native.example.EndToEndTest'. (18420 ms)
[Info] Launching test host and running tests ... (0 ms)
-[EndToEndTestTests testRendersWelcomeScreen][3:20:55 AM] <START> request:/index.ios.bundle?platform=ios&dev=true
[3:20:55 AM] <START> find dependencies
Error: Unable to find file with path: /private/tmp/react-native-uiz3Ujzd/EndToEndTest/ios/index.ios.js
at Fastfs.readFile (/private/tmp/react-native-uiz3Ujzd/EndToEndTest/node_modules/react-native/node_modules/node-haste/lib/fastfs.js:141:15)
at /private/tmp/react-native-uiz3Ujzd/EndToEndTest/node_modules/react-native/node_modules/node-haste/lib/Module.js:165:49
at Cache.get (/private/tmp/react-native-uiz3Ujzd/EndToEndTest/node_modules/react-native/node_modules/node-haste/lib/Cache/index.js:64:103)
at Module.read (/private/tmp/react-native-uiz3Ujzd/EndToEndTest/node_modules/react-native/node_modules/node-haste/lib/Module.js:164:26)
at Module.getDependencies (/private/tmp/react-native-uiz3Ujzd/EndToEndTest/node_modules/react-native/node_modules/node-haste/lib/Module.js:120:19)
at /private/tmp/react-native-uiz3Ujzd/EndToEndTest/node_modules/react-native/node_modules/node-haste/lib/DependencyGraph/ResolutionRequest.js:29:17
at /private/tmp/react-native-uiz3Ujzd/EndToEndTest/node_modules/react-native/node_modules/node-haste/node_modules/throat/index.js:11:22
at new Promise (/private/tmp/react-native-uiz3Ujzd/EndToEndTest/node_modules/react-native/node_modules/core-js/modules/es6.promise.js:197:7)
at run (/private/tmp/react-native-uiz3Ujzd/EndToEndTest/node_modules/react-native/node_modules/node-haste/node_modules/throat/index.js:10:22)
at /private/tmp/react-native-uiz3Ujzd/EndToEndTest/node_modules/react-native/node_modules/node-haste/node_modules/throat/index.js:39:16

@janicduplessis

Copy link
Copy Markdown
ContributorAuthor

Ok the issue seems to happen because of a regression in node-haste 2.5.0 it tries to find the index of a new app in /Users/janic/Developer/TestApp/node_modules/react-native/packager/index.ios.js when it is in /Users/janic/Developer/TestApp/index.ios.js.

@janicduplessis

Copy link
Copy Markdown
ContributorAuthor

Ok I was able to track down the bug to this change in node-haste, I'll check what is up with that.

facebookarchive/node-haste@9673f86#diff-1fdf421c05c1140f6d71444ea2b27638L198

@janicduplessis

Copy link
Copy Markdown
ContributorAuthor

Also I'm not sure if I updated the npm-shrinkwrap.json file properly the diff seems a bit too huge :)

I did that using npm 2.14

rm -rf node_modules
npm install
npm install --save node-haste@2.5.0
npm uninstall --save fast-path
npm shrinkwrap

Not running npm shrinkwrap at the end didn't update the shrinkwrap file.

@mkonicek

Copy link
Copy Markdown
Contributor

@janicduplessis I'm just merging #6346 which updates to a newer version. Should this PR be rebased or closed (not sure about the change in packager/react-packager/index.js)?

@janicduplessis

Copy link
Copy Markdown
ContributorAuthor

I'm pretty sure the change in packager/react-packager/index.js is still needed. I'll rebase and test once #6346 is merged.

@skevy

skevy commented Mar 8, 2016

Copy link
Copy Markdown
Contributor

I think you're right @janicduplessis. Thanks for looking into this :)

@janicduplessisjanicduplessis mentioned this pull request Mar 8, 2016
7 tasks
@facebook-github-bot

Copy link
Copy Markdown
Contributor

@janicduplessis updated the pull request.

@davidaurelio

Copy link
Copy Markdown
Contributor

@facebook-github-bot shipit

@facebook-github-bot

Copy link
Copy Markdown
Contributor

Thanks for importing. If you are an FB employee go to Phabricator to review.

@ghostghost closed this in fd816b1Mar 11, 2016
@davidaurelio

Copy link
Copy Markdown
Contributor

@bestander@mkonicek you might want to cherry pick this for the release. It makes windows compat better

@janicduplessis
janicduplessis deleted the fix-windows branch March 14, 2016 03:04
bestander pushed a commit that referenced this pull request Mar 15, 2016
…fix Windows compatibility
Summary:This is the last bits needed to fix Windows compatibility on master, most of the work was done in node-haste.
**Test plan**
Run npm test
Run the packager using Windows and Mac
cc cpojer davidaurelio
Closes#6260
Reviewed By: dmmiller, bestander
Differential Revision: D3005397
Pulled By: davidaurelio
fb-gh-sync-id: e16847808ebfa8b234315b2093dba204c9c1e869
shipit-source-id: e16847808ebfa8b234315b2093dba204c9c1e869
cpojer pushed a commit to react/metro that referenced this pull request Jan 26, 2017
…fix Windows compatibility
Summary:This is the last bits needed to fix Windows compatibility on master, most of the work was done in node-haste.
**Test plan**
Run npm test
Run the packager using Windows and Mac
cc cpojer davidaurelio
Closesreact/react-native#6260
Reviewed By: dmmiller, bestander
Differential Revision: D3005397
Pulled By: davidaurelio
fb-gh-sync-id: e16847808ebfa8b234315b2093dba204c9c1e869
shipit-source-id: e16847808ebfa8b234315b2093dba204c9c1e869
This pull request was closed.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA SignedThis label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@janicduplessis@facebook-github-bot@davidaurelio@bestander@ide@mkonicek@skevy