{"action":"created","comment":{"url":"https://api.github.com/repos/sass-eyeglass/eyeglass/pulls/comments/136101902","pull_request_review_id":59593913,"id":136101902,"diff_hunk":"@@ -253,39 +254,57 @@ function canAccessModule(name, origin) {\n     return true;\n   }\n \n-  // find the nearest package for the origin\n-  var pkg = packageUtils.findNearestPackage(origin);\n+  var canAccessFrom = function canAccessFrom(origin) {\n+    // find the nearest package for the origin\n+    var pkg = packageUtils.findNearestPackage(origin);\n \n-  var cache = this.cache.access;\n-  cache[name] = cache[name] || {};\n+    var cache = this.cache.access;\n+    cache[name] = cache[name] || {};\n \n-  // check for cached result\n-  if (cache[name][pkg] !== undefined) {\n-    return cache[name][pkg];\n-  }\n+    // check for cached result\n+    if (cache[name][pkg] !== undefined) {\n+      return cache[name][pkg];\n+    }\n \n-  // find all the branches that match the origin\n-  var branches = findBranchesByPath({\n-    dependencies: this.tree\n-  }, pkg);\n+    // find all the branches that match the origin\n+    var branches = findBranchesByPath({\n+      dependencies: this.tree\n+    }, pkg);\n \n-  var canAccess = branches.some(function(branch) {\n-    // if the reference is to itself (branch.name)\n-    // OR it's an immediate dependency (branch.dependencies[name])\n-    if (branch.name === name || branch.dependencies && branch.dependencies[name]) {\n-      return true;\n-    }\n-  });\n+    var canAccess = branches.some(function(branch) {\n+      // if the reference is to itself (branch.name)\n+      // OR it's an immediate dependency (branch.dependencies[name])\n+      if (branch.name === name || branch.dependencies && branch.dependencies[name]) {\n+        return true;\n+      }\n+    });\n \n-  debug.import(\n-    \"%s can%s be imported from %s\",\n-    name,\n-    (canAccess ? \"\" : \"not\"),\n-    origin\n-  );\n+    debug.import(\n+      \"%s can%s be imported from %s\",\n+      name,\n+      (canAccess ? \"\" : \"not\"),\n+      origin\n+    );\n+\n+    // cache it for future lookups\n+    cache[name][pkg] = canAccess;\n+\n+    return canAccess;\n+  }.bind(this);\n \n-  // cache it for future lookups\n-  cache[name][pkg] = canAccess;\n+  // check if we can access from the origin...\n+  var canAccess = canAccessFrom(origin);\n+\n+  // if not...\n+  if (!canAccess) {\n+    // check for a symlink...\n+    var realOrigin = fs.realpathSync(origin);","path":"lib/modules/EyeglassModules.js","position":83,"original_position":83,"commit_id":"bbefb42e7e733a299b075f2a625a0549bdf7191b","original_commit_id":"bbefb42e7e733a299b075f2a625a0549bdf7191b","user":{"login":"stefanpenner","id":1377,"avatar_url":"https://avatars2.githubusercontent.com/u/1377?v=4","gravatar_id":"","url":"https://api.github.com/users/stefanpenner","html_url":"https://github.com/stefanpenner","followers_url":"https://api.github.com/users/stefanpenner/followers","following_url":"https://api.github.com/users/stefanpenner/following{/other_user}","gists_url":"https://api.github.com/users/stefanpenner/gists{/gist_id}","starred_url":"https://api.github.com/users/stefanpenner/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stefanpenner/subscriptions","organizations_url":"https://api.github.com/users/stefanpenner/orgs","repos_url":"https://api.github.com/users/stefanpenner/repos","events_url":"https://api.github.com/users/stefanpenner/events{/privacy}","received_events_url":"https://api.github.com/users/stefanpenner/received_events","type":"User","site_admin":false},"body":"> but I think using realpath all the time implies more testing and code changes.\r\n\r\nMakes sense.  I suspect this may be something todo, as it (from how I understand eyeglass to work) work more like the node `require`, and may lead to less surprises when symlinking. it's also possible I don't quite understand this part of eyeglass, and this doesn't make sense.","created_at":"2017-08-30T15:21:55Z","updated_at":"2017-08-30T15:21:56Z","html_url":"https://github.com/sass-eyeglass/eyeglass/pull/172#discussion_r136101902","pull_request_url":"https://api.github.com/repos/sass-eyeglass/eyeglass/pulls/172","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/sass-eyeglass/eyeglass/pulls/comments/136101902"},"html":{"href":"https://github.com/sass-eyeglass/eyeglass/pull/172#discussion_r136101902"},"pull_request":{"href":"https://api.github.com/repos/sass-eyeglass/eyeglass/pulls/172"}},"in_reply_to_id":135265056},"pull_request":{"url":"https://api.github.com/repos/sass-eyeglass/eyeglass/pulls/172","id":126883186,"html_url":"https://github.com/sass-eyeglass/eyeglass/pull/172","diff_url":"https://github.com/sass-eyeglass/eyeglass/pull/172.diff","patch_url":"https://github.com/sass-eyeglass/eyeglass/pull/172.patch","issue_url":"https://api.github.com/repos/sass-eyeglass/eyeglass/issues/172","number":172,"state":"closed","locked":false,"title":"better support for builds that use symlink","user":{"login":"eoneill","id":552715,"avatar_url":"https://avatars2.githubusercontent.com/u/552715?v=4","gravatar_id":"","url":"https://api.github.com/users/eoneill","html_url":"https://github.com/eoneill","followers_url":"https://api.github.com/users/eoneill/followers","following_url":"https://api.github.com/users/eoneill/following{/other_user}","gists_url":"https://api.github.com/users/eoneill/gists{/gist_id}","starred_url":"https://api.github.com/users/eoneill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eoneill/subscriptions","organizations_url":"https://api.github.com/users/eoneill/orgs","repos_url":"https://api.github.com/users/eoneill/repos","events_url":"https://api.github.com/users/eoneill/events{/privacy}","received_events_url":"https://api.github.com/users/eoneill/received_events","type":"User","site_admin":false},"body":"This issue was discovered while testing with broccoli 1.0. By default, broccoli will now use a global `tmp` path rather than local. This means that files get symlink'd in e.g. `/var/folders/...`\r\n\r\nWhen eyeglass attempts to do it's module `access` check, it walks up the directory tree until it finds a `package.json`. It then uses that `package.json` to determine what dependencies can be imported.\r\n\r\nWhen these files are symlink'd outside of the project workspace, eyeglass fails to find a `package.json` and thereby determines the origin scss file does not have access to the requested modules.\r\n\r\nThe fix here is to follow the symlink and check to see if the \"real\" file has access.\r\n\r\nNote that we have to test _both_ the real and symlink paths. We have to test the original symlink path because it's valid to have symlink'd files _within_ a project and they should check access permission relative to the project before following the symlink.\r\n\r\nDid not add tests because this is hard to test. Reduced test coverage thresholds a bit as such.","created_at":"2017-06-21T23:40:51Z","updated_at":"2017-08-30T15:21:56Z","closed_at":"2017-06-27T22:21:32Z","merged_at":"2017-06-27T22:21:32Z","merge_commit_sha":"3126d856fdd818d79f670de26d9b2e5d04120b68","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/sass-eyeglass/eyeglass/pulls/172/commits","review_comments_url":"https://api.github.com/repos/sass-eyeglass/eyeglass/pulls/172/comments","review_comment_url":"https://api.github.com/repos/sass-eyeglass/eyeglass/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sass-eyeglass/eyeglass/issues/172/comments","statuses_url":"https://api.github.com/repos/sass-eyeglass/eyeglass/statuses/bbefb42e7e733a299b075f2a625a0549bdf7191b","head":{"label":"eoneill:symlinkOriginAccess","ref":"symlinkOriginAccess","sha":"bbefb42e7e733a299b075f2a625a0549bdf7191b","user":{"login":"eoneill","id":552715,"avatar_url":"https://avatars2.githubusercontent.com/u/552715?v=4","gravatar_id":"","url":"https://api.github.com/users/eoneill","html_url":"https://github.com/eoneill","followers_url":"https://api.github.com/users/eoneill/followers","following_url":"https://api.github.com/users/eoneill/following{/other_user}","gists_url":"https://api.github.com/users/eoneill/gists{/gist_id}","starred_url":"https://api.github.com/users/eoneill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eoneill/subscriptions","organizations_url":"https://api.github.com/users/eoneill/orgs","repos_url":"https://api.github.com/users/eoneill/repos","events_url":"https://api.github.com/users/eoneill/events{/privacy}","received_events_url":"https://api.github.com/users/eoneill/received_events","type":"User","site_admin":false},"repo":{"id":41328361,"name":"eyeglass","full_name":"eoneill/eyeglass","owner":{"login":"eoneill","id":552715,"avatar_url":"https://avatars2.githubusercontent.com/u/552715?v=4","gravatar_id":"","url":"https://api.github.com/users/eoneill","html_url":"https://github.com/eoneill","followers_url":"https://api.github.com/users/eoneill/followers","following_url":"https://api.github.com/users/eoneill/following{/other_user}","gists_url":"https://api.github.com/users/eoneill/gists{/gist_id}","starred_url":"https://api.github.com/users/eoneill/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eoneill/subscriptions","organizations_url":"https://api.github.com/users/eoneill/orgs","repos_url":"https://api.github.com/users/eoneill/repos","events_url":"https://api.github.com/users/eoneill/events{/privacy}","received_events_url":"https://api.github.com/users/eoneill/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/eoneill/eyeglass","description":"NPM Modules for Sass","fork":true,"url":"https://api.github.com/repos/eoneill/eyeglass","forks_url":"https://api.github.com/repos/eoneill/eyeglass/forks","keys_url":"https://api.github.com/repos/eoneill/eyeglass/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eoneill/eyeglass/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eoneill/eyeglass/teams","hooks_url":"https://api.github.com/repos/eoneill/eyeglass/hooks","issue_events_url":"https://api.github.com/repos/eoneill/eyeglass/issues/events{/number}","events_url":"https://api.github.com/repos/eoneill/eyeglass/events","assignees_url":"https://api.github.com/repos/eoneill/eyeglass/assignees{/user}","branches_url":"https://api.github.com/repos/eoneill/eyeglass/branches{/branch}","tags_url":"https://api.github.com/repos/eoneill/eyeglass/tags","blobs_url":"https://api.github.com/repos/eoneill/eyeglass/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eoneill/eyeglass/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eoneill/eyeglass/git/refs{/sha}","trees_url":"https://api.github.com/repos/eoneill/eyeglass/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eoneill/eyeglass/statuses/{sha}","languages_url":"https://api.github.com/repos/eoneill/eyeglass/languages","stargazers_url":"https://api.github.com/repos/eoneill/eyeglass/stargazers","contributors_url":"https://api.github.com/repos/eoneill/eyeglass/contributors","subscribers_url":"https://api.github.com/repos/eoneill/eyeglass/subscribers","subscription_url":"https://api.github.com/repos/eoneill/eyeglass/subscription","commits_url":"https://api.github.com/repos/eoneill/eyeglass/commits{/sha}","git_commits_url":"https://api.github.com/repos/eoneill/eyeglass/git/commits{/sha}","comments_url":"https://api.github.com/repos/eoneill/eyeglass/comments{/number}","issue_comment_url":"https://api.github.com/repos/eoneill/eyeglass/issues/comments{/number}","contents_url":"https://api.github.com/repos/eoneill/eyeglass/contents/{+path}","compare_url":"https://api.github.com/repos/eoneill/eyeglass/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eoneill/eyeglass/merges","archive_url":"https://api.github.com/repos/eoneill/eyeglass/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eoneill/eyeglass/downloads","issues_url":"https://api.github.com/repos/eoneill/eyeglass/issues{/number}","pulls_url":"https://api.github.com/repos/eoneill/eyeglass/pulls{/number}","milestones_url":"https://api.github.com/repos/eoneill/eyeglass/milestones{/number}","notifications_url":"https://api.github.com/repos/eoneill/eyeglass/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eoneill/eyeglass/labels{/name}","releases_url":"https://api.github.com/repos/eoneill/eyeglass/releases{/id}","deployments_url":"https://api.github.com/repos/eoneill/eyeglass/deployments","created_at":"2015-08-24T21:39:37Z","updated_at":"2017-03-19T20:24:40Z","pushed_at":"2017-06-21T23:31:40Z","git_url":"git://github.com/eoneill/eyeglass.git","ssh_url":"git@github.com:eoneill/eyeglass.git","clone_url":"https://github.com/eoneill/eyeglass.git","svn_url":"https://github.com/eoneill/eyeglass","homepage":null,"size":705,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"sass-eyeglass:master","ref":"master","sha":"25cc1c66919937ea86029f25707aa14299bfcd91","user":{"login":"sass-eyeglass","id":10853331,"avatar_url":"https://avatars0.githubusercontent.com/u/10853331?v=4","gravatar_id":"","url":"https://api.github.com/users/sass-eyeglass","html_url":"https://github.com/sass-eyeglass","followers_url":"https://api.github.com/users/sass-eyeglass/followers","following_url":"https://api.github.com/users/sass-eyeglass/following{/other_user}","gists_url":"https://api.github.com/users/sass-eyeglass/gists{/gist_id}","starred_url":"https://api.github.com/users/sass-eyeglass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sass-eyeglass/subscriptions","organizations_url":"https://api.github.com/users/sass-eyeglass/orgs","repos_url":"https://api.github.com/users/sass-eyeglass/repos","events_url":"https://api.github.com/users/sass-eyeglass/events{/privacy}","received_events_url":"https://api.github.com/users/sass-eyeglass/received_events","type":"Organization","site_admin":false},"repo":{"id":30313796,"name":"eyeglass","full_name":"sass-eyeglass/eyeglass","owner":{"login":"sass-eyeglass","id":10853331,"avatar_url":"https://avatars0.githubusercontent.com/u/10853331?v=4","gravatar_id":"","url":"https://api.github.com/users/sass-eyeglass","html_url":"https://github.com/sass-eyeglass","followers_url":"https://api.github.com/users/sass-eyeglass/followers","following_url":"https://api.github.com/users/sass-eyeglass/following{/other_user}","gists_url":"https://api.github.com/users/sass-eyeglass/gists{/gist_id}","starred_url":"https://api.github.com/users/sass-eyeglass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sass-eyeglass/subscriptions","organizations_url":"https://api.github.com/users/sass-eyeglass/orgs","repos_url":"https://api.github.com/users/sass-eyeglass/repos","events_url":"https://api.github.com/users/sass-eyeglass/events{/privacy}","received_events_url":"https://api.github.com/users/sass-eyeglass/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/sass-eyeglass/eyeglass","description":"NPM Modules for Sass","fork":false,"url":"https://api.github.com/repos/sass-eyeglass/eyeglass","forks_url":"https://api.github.com/repos/sass-eyeglass/eyeglass/forks","keys_url":"https://api.github.com/repos/sass-eyeglass/eyeglass/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sass-eyeglass/eyeglass/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sass-eyeglass/eyeglass/teams","hooks_url":"https://api.github.com/repos/sass-eyeglass/eyeglass/hooks","issue_events_url":"https://api.github.com/repos/sass-eyeglass/eyeglass/issues/events{/number}","events_url":"https://api.github.com/repos/sass-eyeglass/eyeglass/events","assignees_url":"https://api.github.com/repos/sass-eyeglass/eyeglass/assignees{/user}","branches_url":"https://api.github.com/repos/sass-eyeglass/eyeglass/branches{/branch}","tags_url":"https://api.github.com/repos/sass-eyeglass/eyeglass/tags","blobs_url":"https://api.github.com/repos/sass-eyeglass/eyeglass/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sass-eyeglass/eyeglass/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sass-eyeglass/eyeglass/git/refs{/sha}","trees_url":"https://api.github.com/repos/sass-eyeglass/eyeglass/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sass-eyeglass/eyeglass/statuses/{sha}","languages_url":"https://api.github.com/repos/sass-eyeglass/eyeglass/languages","stargazers_url":"https://api.github.com/repos/sass-eyeglass/eyeglass/stargazers","contributors_url":"https://api.github.com/repos/sass-eyeglass/eyeglass/contributors","subscribers_url":"https://api.github.com/repos/sass-eyeglass/eyeglass/subscribers","subscription_url":"https://api.github.com/repos/sass-eyeglass/eyeglass/subscription","commits_url":"https://api.github.com/repos/sass-eyeglass/eyeglass/commits{/sha}","git_commits_url":"https://api.github.com/repos/sass-eyeglass/eyeglass/git/commits{/sha}","comments_url":"https://api.github.com/repos/sass-eyeglass/eyeglass/comments{/number}","issue_comment_url":"https://api.github.com/repos/sass-eyeglass/eyeglass/issues/comments{/number}","contents_url":"https://api.github.com/repos/sass-eyeglass/eyeglass/contents/{+path}","compare_url":"https://api.github.com/repos/sass-eyeglass/eyeglass/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sass-eyeglass/eyeglass/merges","archive_url":"https://api.github.com/repos/sass-eyeglass/eyeglass/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sass-eyeglass/eyeglass/downloads","issues_url":"https://api.github.com/repos/sass-eyeglass/eyeglass/issues{/number}","pulls_url":"https://api.github.com/repos/sass-eyeglass/eyeglass/pulls{/number}","milestones_url":"https://api.github.com/repos/sass-eyeglass/eyeglass/milestones{/number}","notifications_url":"https://api.github.com/repos/sass-eyeglass/eyeglass/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sass-eyeglass/eyeglass/labels{/name}","releases_url":"https://api.github.com/repos/sass-eyeglass/eyeglass/releases{/id}","deployments_url":"https://api.github.com/repos/sass-eyeglass/eyeglass/deployments","created_at":"2015-02-04T18:21:33Z","updated_at":"2017-08-29T21:28:28Z","pushed_at":"2017-06-27T22:21:32Z","git_url":"git://github.com/sass-eyeglass/eyeglass.git","ssh_url":"git@github.com:sass-eyeglass/eyeglass.git","clone_url":"https://github.com/sass-eyeglass/eyeglass.git","svn_url":"https://github.com/sass-eyeglass/eyeglass","homepage":null,"size":631,"stargazers_count":629,"watchers_count":629,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":34,"mirror_url":null,"open_issues_count":18,"forks":34,"open_issues":18,"watchers":629,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sass-eyeglass/eyeglass/pulls/172"},"html":{"href":"https://github.com/sass-eyeglass/eyeglass/pull/172"},"issue":{"href":"https://api.github.com/repos/sass-eyeglass/eyeglass/issues/172"},"comments":{"href":"https://api.github.com/repos/sass-eyeglass/eyeglass/issues/172/comments"},"review_comments":{"href":"https://api.github.com/repos/sass-eyeglass/eyeglass/pulls/172/comments"},"review_comment":{"href":"https://api.github.com/repos/sass-eyeglass/eyeglass/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sass-eyeglass/eyeglass/pulls/172/commits"},"statuses":{"href":"https://api.github.com/repos/sass-eyeglass/eyeglass/statuses/bbefb42e7e733a299b075f2a625a0549bdf7191b"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"stefanpenner"}}