-
Notifications
You must be signed in to change notification settings - Fork 6.3k
ARM building support #1074
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
ARM building support #1074
Conversation
This is the same PR but with some fixes for v2. Co-Authored-by: nwtnsqrd <noreply@github.com> Signed-off-by: Ayane Satomi <chinodesuuu@gmail.com>
this will replace my previous ARM PRs Signed-off-by: Ayane Satomi <sr229@coder.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very cool. 🎉
Signed-off-by: Ayane Satomi <sr229@coder.com>
Signed-off-by: Ayane Satomi <sr229@coder.com>
Signed-off-by: Ayane Satomi <sr229@coder.com>
Signed-off-by: Ayane Satomi <sr229@coder.com>
Signed-off-by: Ayane Satomi <sr229@coder.com>
Signed-off-by: Ayane Satomi <sr229@coder.com>
Signed-off-by: Ayane Satomi <sr229@coder.com>
Signed-off-by: Ayane Satomi <sr229@coder.com>
SpinningK
commented
Oct 30, 2019
I want to turn my Android phone to a server and code on my ipad. I check this PR every day👻
mirsella
commented
Oct 30, 2019
me too @SpinningK, my rpi4. you can 1) activate notification when a new release is uploaded, and 2) you can also activate notification for all new message on this particular thread. hope it helps
Might need to trial out ARM builds first in my LKGR repo first before merging this so if anyone's interested I'll be releasing builds there first.
Akarys42
commented
Nov 5, 2019
Hi, I hope this will be merged soon! @sr229 you said we can download build in your LKGR repo in the meantime, but I can't find it. Do you have any link please?
Hi, I hope this will be merged soon! @sr229 you said we can download build in your LKGR repo in the meantime, but I can't find it. Do you have any link please?
Right here chief. It'll take a while to run ARM builds though since we haven't built nbin to do package builds yet.
SpinningK
commented
Nov 12, 2019
Any progress?
The Alpine Arm build failed because the environment is missing the libsecret-dev package... I'm in the process if trying to manually build this branch now.
deftdawg
commented
Nov 20, 2019
On Android I can make it as far as yarn watch in the build instructions, but then gulp kills itself after exceeding the system file watch limits ENOSPC. Trying to yarn start it without having completed the compile also fails...
Is there another way to get it to compile without watching all the files for changes (I assume that's what yarn watch is doing)?
Unfortunately, there's no easy way to override the fs.inotify.max_user_watches value on a non-rooted Android device.
In any case, I'll try to build a Pi as well, if I get a chance. 😞
@deftdawg You might have better luck with the build instructions (https://github.com/cdr/code-server#build) instead of the development instructions. You won't need yarn watch if you're just building.
deftdawg
commented
Nov 22, 2019
@code-asher, I gave those instructions a try... modifying package.json to point at @sr229 's nbin package, but unfortunately, it fails to find nbin and I'm too much of a node noob to understand why.
These are my steps
git clone https://github.com/cdr/code-server.git cd code-server git checkout sr229/travis-arm sed -ie 's=@coder/nbin": "^1.2.2=@coder/nbin": "github:sr229/nbin#sr229/travis-arm=' package.json yarn build "1.39.2" "deftdawg-android-1.39.2"
And this is how yarn dies:
yarn run v1.16.0
$ yarn && yarn runner build 1.39.2 deftdawg-android-1.39.2
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@1.2.9: The platform "linux" is incompatible with this module.
info "fsevents@1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > @coder/logger@1.1.8" has unmet peer dependency "@google-cloud/logging@^4.5.2".
warning "@coder/nbin > @coder/logger@1.1.11" has unmet peer dependency "@google-cloud/logging@^4.5.2".
[4/4] Building fresh packages...
success Saved lockfile.
$ cd ./scripts && node --max-old-space-size=32384 -r ts-node/register ./build.ts build 1.39.2 deftdawg-android-1.39.2
Error: Cannot find module '@coder/nbin'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (/source/code-server/scripts/build.ts:1:1)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Module.m._compile (/source/code-server/node_modules/ts-node/src/index.ts:493:23)
at Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Object.require.extensions.(anonymous function) [as .ts] (/source/code-server/node_modules/ts-node/src/index.ts:496:12)
at Module.load (internal/modules/cjs/loader.js:653:32)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
@deftdawg interesting, it just states that it is missing a dependancy, try installing that dependancy and try again?
deftdawg
commented
Nov 26, 2019
@deftdawg interesting, it just states that it is missing a dependancy, try installing that dependancy and try again?
@Merith-TK yeah cool, like how?
I tried this:
npm install "github:sr229/nbin#sr229/travis-arm" --loglevel verbose
which installed after 64minutes on my phone, same error (both with and without -g global option).
I added:
"@google-cloud/logging": "^4.5.2",
to packages.json's devDependencies and that made the warning about cloud logging go away, but still can't find nbin
I tried adding
"@coder/nbin": "github:sr229/nbin#sr229/travis-arm",
to both dependencies and devDependencies in scripts/packages.json, however that had no effect.
Feel like this should be a very easy thing to solve, but I don't really know node very well and my google searches haven't turned up anything helpful... just stuff like rm -rf node_modules which I have already tried.
There isn't much change in my ARM branch so don't point it there, I'll be working on a experimental distribution format for a bit for ARM since compiling it for the architecture requires a custom gcc toolchain.
Not a pleasant experience but I'll get around it soon.
@deftdawg yeah I'd recommend just building from master and not modifying anything. You should be able to just do something similar to this:
git clone https://github.com/cdr/code-server.git
cd code-server
yarn build "1.39.2" "android"
node ./build/code-server*/out/vs/server/main.js
So basically you'll just run the compiled JavaScript files with node. You won't be able to package into a binary since nbin doesn't support that architecture yet.
Here is the build output I get while doing sudo yarn build 1.39.2 arm after adding a lot of missing packages, still doesn’t work. Any fix for it?
CAC22BB7-3E9F-42D1-A5EA-641EB2EF693C
I think the build script swallows some error output. You could try running that command manually in the root VS Code directory and it might show you what's really going on: yarn gulp compile-extensions-build --max-old-space-size=32384.
You can also run yarn in the root VS Code directory when there are missing dependencies, although there should only be missing dependencies if the build is cancelled while it's installing because then on the next run it sees that node_modules exists and doesn't try to install again. Actually I'll fix that right now so it always runs yarn.
deftdawg
commented
Dec 9, 2019
@code-asher's fix commit is 015a99e...
I'll cherry pick it to @sr229 's arm branch and have another go at attempting to build this with nbin/master this time.
@deftdawg this PR only changes the CI so there's no benefit in building against it locally. You could just build against master.
deftdawg
commented
Dec 10, 2019
@code-asher my bad, I'll have a go against master then.
@code-asher I don’t really get more output with yarn gulp compile-extensions-build --max-old-space-size=32384 (I also tried yarn gulp compile-extensions-build)
Akarys42
commented
Dec 13, 2019
via email
deftdawg
commented
Jan 4, 2020
Reducing max-old-space-size did not work.
I did however have success building it in a aarch64 alpine Docker container running under qemu-aarch64-static... The x86-64 host machine had 64GB of RAM and I estimate the build required 10GB of memory to complete.
The same machine only reported 2GB free with an arm Docker container, so will need to figure out how to get past that for an arm 32-bit build.
@deftdawg make a 12GB swap can work ?
deftdawg
commented
Jan 6, 2020
Yarn complains about using node >8 or >11. For my successful build, I used Alpine 3.9 inside a Docker container with qemu-aarch64-static registered to build Master on an x86-64. Then I scp'ed the full code-server directory and started it on a Raspbery Pi 4 running aarch64.
Newer versions of Alpine didn't work inside of Docker on x86-64, node will fail to compile while QEMU spits up (alpinelinux/docker-alpine#48).
Screenshot of it running:
I'm not sure how we can get this built on Arm32v7 though, I think qemu-arm-static maybe has some 2GB memory limit or something on 32-bit... I searched for Arm 32 machines with lots of ram and the only one I could find is an older QNAP NAS w/ a Coretex-A15 and DDR3 ram slots for up to 16gb.
Closing since we found a better way now :3c
This allows building for ARM using Travis's new Multiarch support. This will supersede ALL PRs I had for ARM support.
Resolves #35 and requires coder/nbin#25.