Closed JoshStrobl closed 8 years ago
Clean your repository and try again:
git clean -xfd .
./scripts/npm.sh install
Not a git repo build.
What are you trying to build?
Visual Studio Code? Is there something else from you guys that I would be building?
For more information:
./scripts/npm.sh install
has been just fine up until 1.6.0.[https://github.com/Microsoft/vscode/blob/master/build/npm/preinstall.js#L29](This code) is responsible for installing gulp-watch
as a preinstall
hook to npm. Make sure it runs... and if it doesn't try to figure out why.
Any chance it has something to do with your fsevents commit that was tagged for 1.6.0, which was the last thing to change on the file?
Confirmed, your removal of the gulp-watch
line in the package.json in the above linked commit caused the build to fail. I patched it back in and I'm getting a build success now. Want a PR?
No. This code is responsible for installing gulp-watch
as a preinstall
hook. Make sure that runs when you run ./scripts/npm.sh install
.
Ultimately, npm
should not install gulp-watch
at the root of the project, but rather in build/lib/watch
. gulp-watch
depends on fsevents which is a binary module. If you install it at the top level of the repository as part of
./scripts/npm.sh install, it will be compile against Electron's node, which is likely incompatible with your globally installed node. So, when running
gulp watch` later on you'd not be able to load that module.
If your ./scripts/npm.sh install
isn't running the preinstall
hook correctly in your system, you should investigate into why that is. It seems to run for everyone else.
and if it doesn't try to figure out why. you should investigate into why that is. It seems to run for everyone else.
"Works for me" ethos? The idea in reporting an issue is to interactively debug the issue, not to tell the OP to find out themselves why the thing they've reported is broken, in your software.
it will be compile against Electron's node, which is likely incompatible with your globally installed node.
This is built in an isolated chroot, there is no global to build against. The resulting build is clean and functional.
I would... it's just that it doesn't reproduce for me, making it very hard to know what's going on. And it also happens not to reproduce in anyone else's machine. So... yeah... you'd have to figure it out. Or give me SSH access and I'll do it for you.
If you just want to work around it, you can do
cd build/lib/watch && npm install
right after ./scripts/npm.sh install
.
So... yeah... you'd have to figure it out.
And I did. Then you told me to dig through the log to check if it's running the preinstall hook, which you could've gotten from the full log I quite literally linked in the first comment.
These are reproducible builds. The log isn't going to be different, and what you get is whatever output our tooling provides as well as whatever yours does.
Already fixed downstream with a patch to revert your change to the package.json.
Sure I looked into your full log... but there's nothing there related to our preinstall
hooks.
Something is different between what your tooling does, compared to ours. Just look at our Travis builds, for example, gulp-watch
appears in the log as being installed, as part of the preinstall
hook.
How can I further help?
Actually, there is:
npm WARN lifecycle code-oss-dev@1.6.0~preinstall: cannot run in wd%s %s (wd=%s) code-oss-dev@1.6.0 node build/npm/preinstall.js /var/ypkg-root/root/vscode/build/vscode-1.6.0
npm WARN lifecycle code-oss-dev@1.6.0~postinstall: cannot run in wd %s %s (wd=%s) code-oss-dev@1.6.0 node build/npm/postinstall.js /var/ypkg-root/root/vscode/build/vscode-1.6.0
Any idea what %s %s
means?
Here are a few hints:
TryGhost/Ghost#6754 CurrentByGE/ie-angular-ref-app#1
So, does adding --unsafe-perm
to npm install
work?
Can confirm that appending --unsafe-perm
to ./scripts/npm.sh install
enables it to build correctly. Can we please get this documented please or make sure the flag is set when executing as root?
Added a note to https://github.com/Microsoft/vscode/wiki/How-to-Contribute.
Automatically adding the flag when running as root would defeat the purpose of having the flag at all, which exists exactly for this purpose: making sure users know that what they are doing is not safe.
Thanks for the documentation improvements and the help!
--unsafe-perm
is also a thing in windows btw.
This wasn't an issue prior to 1.6.0. As of 1.6.0, the follow error occurs on and thus build fails:
Full log:
For reference, the build bits (important and relevant bits here) of our package.yml are:
Other potential helpful bits: NPM version: 3.10.3 nodejs version: 6.7.0