{"action":"created","issue":{"url":"https://api.github.com/repos/meteor/meteor/issues/4023","labels_url":"https://api.github.com/repos/meteor/meteor/issues/4023/labels{/name}","comments_url":"https://api.github.com/repos/meteor/meteor/issues/4023/comments","events_url":"https://api.github.com/repos/meteor/meteor/issues/4023/events","html_url":"https://github.com/meteor/meteor/issues/4023","id":64294917,"number":4023,"title":"error when updating meteor from dev-bundle (tools/watch.js)","user":{"login":"TomFreudenberg","id":410087,"avatar_url":"https://avatars.githubusercontent.com/u/410087?v=3","gravatar_id":"","url":"https://api.github.com/users/TomFreudenberg","html_url":"https://github.com/TomFreudenberg","followers_url":"https://api.github.com/users/TomFreudenberg/followers","following_url":"https://api.github.com/users/TomFreudenberg/following{/other_user}","gists_url":"https://api.github.com/users/TomFreudenberg/gists{/gist_id}","starred_url":"https://api.github.com/users/TomFreudenberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TomFreudenberg/subscriptions","organizations_url":"https://api.github.com/users/TomFreudenberg/orgs","repos_url":"https://api.github.com/users/TomFreudenberg/repos","events_url":"https://api.github.com/users/TomFreudenberg/events{/privacy}","received_events_url":"https://api.github.com/users/TomFreudenberg/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-03-25T15:12:18Z","updated_at":"2015-03-27T10:53:26Z","closed_at":"2015-03-26T23:26:58Z","body":"YOU MAY IGNORE THIS COMMENT AND START OVER WITH MY SECOND COMMENT.\r\n\r\n---\r\n\r\nHi,\r\n\r\nI am working on meteor universal fork to run meteor on yet unsupported architectures. At least all works fine but this when running meteor from a checkout and want to install a dev-bundle. It must be said, that the non-core packages should be linked to `packages` so that e.g. `npm-bcrypt` can be used:\r\n\r\n```\r\n  cd <your checkout path>\r\n  ln -s packages/non-core/npm-bcrypt packages\r\n```\r\n\r\nSteps to reproduce error:\r\n\r\n```\r\n  cd <your checkout path>\r\n  # clearing .meteor\r\n  rm -rf .meteor\r\n  # drop previous dev-bundle\r\n  rm -rf dev_bundle\r\n  # get meteor --version to install new dev_bundle and check environment\r\n  meteor --version\r\n```\r\n\r\nAfter some time follwing error occurs:\r\n\r\n<pre>\r\n/usr/local/lib/meteor/dev_bundle/lib/node_modules/fibers/future.js:278\r\n                                                throw(ex);\r\n                                                      ^\r\nError: ELOOP, stat '/usr/local/lib/meteor/packages/npm-bcrypt'\r\n    at Object.Future.wait (/usr/local/lib/meteor/dev_bundle/lib/node_modules/fibers/future.js:398:15)\r\n    at Object.wrapper [as stat] (/usr/local/lib/meteor/tools/files.js:1330:24)\r\n    at /usr/local/lib/meteor/tools/watch.js:265:25\r\n    at Array.forEach (native)\r\n    ...\r\n</pre>\r\n\r\nThe problem is based inside `tools/watch.js` method `readDirectory()`.\r\n\r\n**`var stats = files.stat(files.pathJoin(options.absPath, entry));`**\r\n\r\n```javascript\r\nvar readDirectory = function (options) {\r\n  // Read the directory.\r\n  try {\r\n    var contents = files.readdir(options.absPath);\r\n  } catch (e) {\r\n    // If the path is not a directory, return null; let other errors through.\r\n    if (e && (e.code === 'ENOENT' || e.code === 'ENOTDIR'))\r\n      return null;\r\n    throw e;\r\n  }\r\n\r\n  // Add slashes to the end of directories.\r\n  var contentsWithSlashes = [];\r\n  _.each(contents, function (entry) {\r\n    try {\r\n      // We do stat instead of lstat here, so that we treat symlinks to\r\n      // directories just like directories themselves.\r\n      // XXX Does the treatment of symlinks make sense?\r\n      var stats = files.stat(files.pathJoin(options.absPath, entry));\r\n    } catch (e) {\r\n      if (e && (e.code === 'ENOENT')) {\r\n        // Disappeared after the readdir (or a dangling symlink)? Eh,\r\n        // pretend it was never there in the first place.\r\n        return;\r\n      }\r\n      throw e;\r\n    }\r\n    if (stats.isDirectory())\r\n      entry += '/';\r\n    contentsWithSlashes.push(entry);\r\n  });\r\n```\r\n\r\nFunny thing: this is also documented in your own (MDG) comment\r\n\r\n> // XXX Does the treatment of symlinks make sense?\r\n\r\nFrom my point of view and in case of this error: NO, makes no sense ;-)\r\n\r\nBut coming back to be serious, this error would not be raised if using `files.lstat`.\r\n\r\nQuestion: What conditions has to be that `files.stat` is the right call ?\r\n \r\nCould you change it to `files.lstat()` ?\r\n\r\nThanks for feedback."},"comment":{"url":"https://api.github.com/repos/meteor/meteor/issues/comments/86900001","html_url":"https://github.com/meteor/meteor/issues/4023#issuecomment-86900001","issue_url":"https://api.github.com/repos/meteor/meteor/issues/4023","id":86900001,"user":{"login":"TomFreudenberg","id":410087,"avatar_url":"https://avatars.githubusercontent.com/u/410087?v=3","gravatar_id":"","url":"https://api.github.com/users/TomFreudenberg","html_url":"https://github.com/TomFreudenberg","followers_url":"https://api.github.com/users/TomFreudenberg/followers","following_url":"https://api.github.com/users/TomFreudenberg/following{/other_user}","gists_url":"https://api.github.com/users/TomFreudenberg/gists{/gist_id}","starred_url":"https://api.github.com/users/TomFreudenberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TomFreudenberg/subscriptions","organizations_url":"https://api.github.com/users/TomFreudenberg/orgs","repos_url":"https://api.github.com/users/TomFreudenberg/repos","events_url":"https://api.github.com/users/TomFreudenberg/events{/privacy}","received_events_url":"https://api.github.com/users/TomFreudenberg/received_events","type":"User","site_admin":false},"created_at":"2015-03-27T10:53:26Z","updated_at":"2015-03-27T10:53:26Z","body":"Hi David ( @glasser )\r\n\r\nsetting the export var `$PACKAGE_DIRS` works as expected.\r\n\r\nI really can't understand why you decide to move this 4 packages into `packages/non-core` when running from checkout but put them directly into `packages` folder when running your installer. Also I am wondering why there is the package `npm-node-aes-gcm` missing completly when using the installer.\r\n\r\nWhy do make that difference to the packages? There are no technical issue in using them also in the checkout environment.\r\n\r\nThanks in advance for some clarification\r\nTom"}}