-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Gulp no longer follows symlinks past the first level #792
Comments
@wesleycho I'm not confident that it has to do with that change. node-glob is ultimately what walks the fs and emits stuff, this change just makes sure that when we get results from the glob module that we collect stats on links too |
Noticing a similar non following of symlinks when using gulp.dest() to write to a symlinked directory. The files doesn't end up written there. Same task works fine when the directory is not symlinked. |
Is this still happening after an npm update? glob just fixed some bugs |
Yup, just updated global gulp and local to the project I saw it in - still occurring. |
@contra: FWIW, lstat in graceful-fs is coming straight from the Node.js Asynchronous lstat(2). The callback gets two arguments (err, stats) where stats is a fs.Stats object. lstat() is identical to stat(), except that if path is a symbolic link, then the link itself is stat-ed, not the file that it refers to. This appears to be the cause of the issue to me, since it is the link that is stat'ed and not the files anymore, so gulp.src cannot read the actual contents of the symlinked files. |
@wesleycho I think that was done for a reason - people wanted to take a folder of symlinks and move them somewhere else, which I is the correct behavior IMO. There is no way to support both of these cases, one will have to be behind an option. |
Well, this problem affects all of our build processes with development at my company since we cannot symlink component libraries and do a build for development since none of our files are present in the stream. It's a legitimate use case I believe. Someone here is willing to open PRs in vinyl-fs & here to add a config option if that's the solution that is most desired. |
@wesleycho I think an option to src that says if it should read symlinks or not would work best. Default should be not to read symlinks |
Looks like you were right - the problem is in node-glob: https://github.com/isaacs/node-glob/blob/master/glob.js#L532-L534 . There even already is a reported issue for this. I'll look at subbing a patch there, and then subbing a patch here for hooking into this option when it makes sense. |
@wesleycho let me know if you are busy I can take one of the request if you want |
@wesleycho AFAIK the options to src should get passed straight through to glob-stream which passes them straight through to glob. Let me know if that isn't the case and I'll take a PR for adding the new option. Even if it is passed through and already functional, we should still add some info to the docs with that option |
Running into this problem as well. Any updates regarding passing options to src()? |
Shortcut to node-glob PR -> isaacs/node-glob#148 |
Will like this feature as well. |
isaacs/node-glob#148 has been closed by a different commit by @isaacs - is this solved? |
Note that the glob symlink followin behavior is opt-in, so you need to pass |
@isaacs Ah thanks, I need to add that then |
I have noticed a regression in Gulp where when using gulp.src, if a directory that is matched is symlinked, it will no longer try to follow nested folders of that directory. This is due to this change in vinyl-fs.
The text was updated successfully, but these errors were encountered: