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

add option to NOT run fs.chmod() on destination files #1502

Closed
cr1st1p opened this issue Jan 26, 2016 · 10 comments
Closed

add option to NOT run fs.chmod() on destination files #1502

cr1st1p opened this issue Jan 26, 2016 · 10 comments
Labels

Comments

@cr1st1p
Copy link

cr1st1p commented Jan 26, 2016

I'm in the situation of having all the permission setup with 'setfacl' (for lxc containers) and I can NOT work at ALL with this setup because gulp's code always tries to run chmod, which fails miserably.

Can you please add an option where there is no chmod() call involved?
Gulp version 3.9.0

@phated
Copy link
Member

phated commented Jan 27, 2016

3.9 won't be receiving this change; we could probably do it for gulp 4.

@kcivey
Copy link

kcivey commented Jan 28, 2016

It looks like the chmod problem was fixed in 9 months ago (#1012) but still not in a released version. It's been driving me crazy too.

@callumacrae
Copy link
Member

@kcivey from the issue you linked to:

feel free to use the 4.0 stuff it's stable

npm install --save-dev gulpjs/gulp#4.0

@cr1st1p
Copy link
Author

cr1st1p commented Jan 28, 2016

For who's interested in an ugly hack, I did this, in gulpfile.js:
var fs = require('fs');
if (1) fs.chmod = function (a, b, cb) {
cb(0);
}

I haven't tested gulp v4.0 but I do wonder if it won't still crash, since I also am having default 'setfacl' settings for directories.

@phated phated added the gulp4 label Jan 29, 2016
@phated
Copy link
Member

phated commented Jan 29, 2016

Lots of fixes have either landed in vinyl-fs or are about to land in vinyl-fs (avoiding the chmod if the process uid is not the same as the file owner). If you don't want to upgrade to gulp 4, you can pull in vinyl-fs as the standalone module to have the fixes. node's module resolution might even pick it up for your gulp install if they are side-by-side.

@phated phated closed this as completed Jan 29, 2016
@cr1st1p
Copy link
Author

cr1st1p commented Jan 29, 2016

Well, I just tried using 4.0, but I get several unmet dependencies warnings.
And when I try to run it, I get all kind of missing module errors.
Can you create an actual release version of 4.0 instead of having it as a branch, and publish it on npm?

@phated
Copy link
Member

phated commented Jan 29, 2016

No, it isn't complete yet.

@phated
Copy link
Member

phated commented Jan 29, 2016

Expanding upon that ^ - there are many people using it already so your system is messed up, not gulp 4.

@cr1st1p
Copy link
Author

cr1st1p commented Jan 29, 2016

I started again from an empty package.json and added one by one the required dependencies. Still got some warnings about dependencies, but I ignored them.
It would have helped me if you would have left me a notice about an important change re: gulp 4 (gulp.series|parallel).

After doing the required changes in my gulpfile.js, guess what? I ended now with
[10:10:24] Error: EPERM: operation not permitted, futime
at Error (native)

The file is there, user can write/append into it. So, I got the same bad behaviour I was complaining, if using setfacl.

Then, I commented the call in ./node_modules/gulp/node_modules/vinyl-fs/lib/dest/writeContents/writeBuffer.js
Things worked kind of ok until I got a different message, which I guess is because of my possibly incomplete migration of gulpfile.js to gulp#4.0

Vinyl-fs version: 2.3.1

@phated
Copy link
Member

phated commented Jan 29, 2016

As stated in my original post the change/fix for not attempting chmod if the process.uid doesn't match the file uid is still in progress and hasn't landed yet. I am going to lock this thread because it is causing additional noise to something that already is being worked on over in the vinyl-fs repo.

Ref gulpjs/vinyl-fs#151

@gulpjs gulpjs locked and limited conversation to collaborators Jan 29, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants