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

Adding gulp methods for targeting arm systems #10923

Merged
merged 1 commit into from Aug 29, 2016

Conversation

Projects
None yet
6 participants
@sleepyfoxen
Copy link
Contributor

sleepyfoxen commented Aug 24, 2016

This pull request adds gulp methods for building and packaging VSCode on ARM-based linux systems.

@msftclas

This comment has been minimized.

Copy link

msftclas commented Aug 24, 2016

Hi @aptgetmoo, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!

This seems like a small (but important) contribution, so no Contribution License Agreement is required at this point. Real humans will now evaluate your PR.

TTYL, MSBOT;

@Tyriar

This comment has been minimized.

Copy link
Member

Tyriar commented Aug 25, 2016

@aptgetmoo you've tested this and it works as expected?

@mong87suk

This comment has been minimized.

Copy link

mong87suk commented Aug 26, 2016

Hello @joaomoreno,
Thank you for your support.
I changed build/gulpfile.vscode.linux.js . Could you tell me what know what I do next?
reference : Adding gulp methods for targeting arm systems
Should I rebuild vscode like AppVeyor build succeeded?

Best regards,
Felinus Jeong

@sleepyfoxen

This comment has been minimized.

Copy link
Contributor

sleepyfoxen commented Aug 26, 2016

@mong87suk You can run VSCode on a RPi with:

./scripts/npm.sh install --arch=armhf
./scripts/code.sh

Making sure that you have node v6 and npm v3.8.9 installed, or the build will fail.
Since ARM methods are already in the gulpfiles for doing these 'fast-builds', the build produced by this will be pretty stable, and is fairly well-known.

@Tyriar
On testing:
I'm using a RPi3 to run VSCode. It runs, but is quite buggy (for example, I'm having the classic 'error while tokenizing input') -- so not really stable, and not as stable as the fast/development build.
Also, sadly a RPi cannot run the 'full build' / packaging tasks -- it can run the 'fast build', but it OOMs on the optimize-vscode task. However, arm-targetted .deb / binaries can be built from other systems, and that's what I'm currently testing with.
See #6442 for more discussion on that.

I appreciate that you don't want to actively support ARM, however since the gulpfiles are already pretty undocumented, I don't think having these methods would really imply that you have support for the architecture (and, for what it's worth, there are already references in other gulpfiles to the architecture).

Sorry for the late reply, and I do understand if you want to close this due to the onslaught of people with support requests for ARM if you pull this - however I think that it would certainly be a step in the right direction, and I hope you'll consider this in the future if now's not the time.

@Tyriar

This comment has been minimized.

Copy link
Member

Tyriar commented Aug 26, 2016

@aptgetmoo I'm all for merging this in due to the community convenience factor. I'm curious though, can you run the package task on a development machine and then move the package to your RPi3? Our rpm and 32-bit builds are actually all done on a 64-bit Ubuntu machine.

@sleepyfoxen

This comment has been minimized.

Copy link
Contributor

sleepyfoxen commented Aug 26, 2016

@Tyriar I also built my .deb on a amd64 Ubuntu machine – it does work, but as mentioned is quite buggy. I think after more people start to build for arm, these bugs will get ironed out and arm binaries could be provided from your build machine which would be an ideal scenario. As it stands though, it's much more stable just running ./scripts/code.sh.

@mong87suk

This comment has been minimized.

Copy link

mong87suk commented Aug 28, 2016

Hello @aptgetmoo
Thank you for your support.
I've done fast-builds on RPi3.
it finished, although the build error happend.
After fast-builds, I've run VS code but the error still happened.
I hope the errors can be fixed.

Best regards,
Felinus Jeong

I've don fast-builds as follow configuration.
pi@KERNEL_BZ:/Development/vscode/scripts $ node -v
v6.4.0
pi@KERNEL_BZ:
/Development/vscode/scripts $ npm -v
3.10.3

fast-builds error
CXX(target) Release/obj.target/CreateMutex/src/main.o
../src/main.cc:2:21: fatal error: windows.h: No such file or directory
#include <windows.h>
^
compilation terminated.
CreateMutex.target.mk:89: recipe for target 'Release/obj.target/CreateMutex/src/main.o' failed
make: *** [Release/obj.target/CreateMutex/src/main.o] Error 1
make: Leaving directory '/home/pi/Development/vscode/node_modules/windows-mutex/build'
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:191:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)
gyp ERR! System Linux 4.4.13-v7+
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/pi/Development/vscode/node_modules/windows-mutex
gyp ERR! node -v v6.4.0
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok


VS code error

pi@KERNEL_BZ:~/Development/vscode/scripts $ ./code.sh
[3067:0828/121948:ERROR:browser_main_loop.cc(217)] Running without the SUID sandbox! See https://chromium.googlesource.com/chromium/src/+/master/docs/linux_suid_sandbox_development.md for more information on developing with the sandbox on.

@sleepyfoxen

This comment has been minimized.

Copy link
Contributor

sleepyfoxen commented Aug 28, 2016

@mong87suk heya, could you read the guide for how to build VSCode - I don't mean to sound confrontational but it says that you need to run an older version of npm than 3.9.0 -- but you are running 3.10.

You can downgrade your npm to the correct version with npm install -g npm@3.8.9. Your error is caused by a bug in newer versions of npm with regard to optional dependencies. This error is expected on Linux.

@mong87suk

This comment has been minimized.

Copy link

mong87suk commented Aug 28, 2016

Hello @aptgetmoo
Thank for your support.
I've downgraded my npm to 3.8.9
but same error happened while building VS code.
I think this error happened because of window.h. right?
Could you check my error message again?

Best regards,
Felinus Jeong

windows-mutex@0.2.0 install /home/pi/Development/vscode/node_modules/windows-mutex
node-gyp rebuild

make: Entering directory '/home/pi/Development/vscode/node_modules/windows-mutex/build'
CXX(target) Release/obj.target/CreateMutex/src/main.o
../src/main.cc:2:21: fatal error: windows.h: No such file or directory
#include <windows.h>

compilation terminated.
CreateMutex.target.mk:89: recipe for target 'Release/obj.target/CreateMutex/src/main.o' failed
make: *** [Release/obj.target/CreateMutex/src/main.o] Error 1
make: Leaving directory '/home/pi/Development/vscode/node_modules/windows-mutex/build'
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:191:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12)
gyp ERR! System Linux 4.4.13-v7+
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/pi/Development/vscode/node_modules/windows-mutex
gyp ERR! node -v v6.4.0
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok

@sleepyfoxen

This comment has been minimized.

Copy link
Contributor

sleepyfoxen commented Aug 28, 2016

@mong87suk
Yes, the optional dependency windows.h will fail on Linux. If you are running npm@3.8.9, the build will continue without this dependency.
Please double check that you are running the older npm with npm --version

@hxlnt

This comment has been minimized.

Copy link
Member

hxlnt commented Aug 28, 2016

FWIW, I used @aptgetmoo's vscode branch to successfully run VS Code on a non-RPi ARM7 Linux machine a few days ago. Just had to install one additional missing dependency (libnss3-dev). Thanks! 🎊

@mong87suk

This comment has been minimized.

Copy link

mong87suk commented Aug 28, 2016

Hello @aptgetmoo @hxlnt
Thank you for your support.
I checked the version of npm. The version is 3.8.9
While building VS code, The error happened but the build wasn't closed.
it' the right result?
While building VS code, the error message appeared but build continued.
if it's the wrong result. Should I download VS code again and build it?

@sleepyfoxen

This comment has been minimized.

Copy link
Contributor

sleepyfoxen commented Aug 28, 2016

@mong87suk this is the expected behaviour.

@mong87suk

This comment has been minimized.

Copy link

mong87suk commented Aug 28, 2016

Hello @aptgetmoo
Thank you for your support.
When I run VS code, below error happen.

VS code error

pi@KERNEL_BZ:~/Development/vscode/scripts $ ./code.sh
[3067:0828/121948:ERROR:browser_main_loop.cc(217)] Running without the SUID sandbox! See https://chromium.googlesource.com/chromium/src/+/master/docs/linux_suid_sandbox_development.md for more information on developing with the sandbox on.

I've tried this way to fix the error : Linux SUID Sandbox Development
But The error still happen.
Could you explain why this error hasn't been fixed?

I've run following line to fix the error.
pi@KERNEL_BZ:/usr/lib/chromium-browser $ ls
chrome-sandbox
pi@KERNEL_BZ:sudo mkdir /usr/local/sbin/chrome-devel-sandbox
pi@KERNEL_BZ:cp chrome-sandbox /usr/local/sbin/chrome-devel-sandbox
pi@KERNEL_BZ:sudo chown root:root /usr/local/sbin/chrome-devel-sandox
pi@KERNEL_BZ:shdo chmod 4775 /usr/local/sbin/chrome-devel-sandbox

Put this line in may ~/.bashrc
export CHMOE_DEVEL_SANDBOX=/usr/local/sbin/chrome-devel-sandbox

@Tyriar

This comment has been minimized.

Copy link
Member

Tyriar commented Aug 29, 2016

@mong87suk Yes optional dependencies will fail on various operating systems but because they're optional that is fine. Instead of looking for individual errors you should be looking at whether the command itself failed and exited with a non-0 exit code, you can check this by running echo $?

You can safely ignore this error:

[3067:0828/121948:ERROR:browser_main_loop.cc(217)] Running without the SUID sandbox! See https://chromium.googlesource.com/chromium/src/+/master/docs/linux_suid_sandbox_development.md for more information on developing with the sandbox on.

@aptgetmoo thanks for the PR/support, I'll go ahead and merge it. Please follow up if you have issues with the arm packaging 👍

@Tyriar Tyriar merged commit 6f4b088 into Microsoft:master Aug 29, 2016

1 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build could not complete due to an error
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment