Building vscode on the N2

Post Reply
wallyz21
Posts: 146
Joined: Thu Apr 04, 2019 11:00 am
languages_spoken: english
ODROIDs: N2
Has thanked: 10 times
Been thanked: 17 times
Contact:

Building vscode on the N2

Post by wallyz21 »

[Update]

Building vscode is now longer required as a fully functional version is now available via the software store. Just search for "VS codium".

I have installed VS codium and it has now replaced my self built vs code version.

Like VS code it does not support Microsoft's Intellisence/Debugger but it does supports native debugging.

--------------------------------------------------------------------------------------------------------------------------------

You can build vscode on the N2 Ubuntu Arm64 if you follow the vscode on XU4 guide found here:

https://www.hardkernel.com/blog-2/visua ... ntu-18-04/

However replace any references to armhf with arm64. (eg ./scripts/npm.sh install --arch=armhf --> ./scripts/npm.sh install --arch=arm64)

Also the command :

Code: Select all

 curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt
will not work on 18.04 because /etc/apt is no longer a file but is instead a directory.

Instead launch Ubuntu "Software & Updates" goto the "Other Software" tab and manually add this entry (cut n paste)

Code: Select all

deb https://dl.yarnpkg.com/debian/ stable main.
The install should then proceed as described in the article.

Once finished you will notice there are no extensions in the extension store. To fix this add the following entry to the product.json file and you will be able to add any extension you like.

Code: Select all

"extensionsGallery": {
    "serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery",
    "cacheUrl": "https://vscode.blob.core.windows.net/gallery/index",
    "itemUrl": "https://marketplace.visualstudio.com/items"
}
(Add it after the last entry and restart vscode)

Everything including the extensions appear to work! However I am having trouble getting vscode to attach to the debugger! I'll get back to you'll on this!

For those unfamiliar with vscode you will want to add the C/C++ (IntelliSense, debugging, and code browsing. Extension) as this provides your basic debugging support.
And another good extension is gitlens which add GUI support for git.

Buon Odroiding
Last edited by wallyz21 on Tue May 12, 2020 1:48 pm, edited 2 times in total.
Walter Zambotti
N2 - Ubuntu Mate Desktop

joshua.yang
Posts: 433
Joined: Fri Sep 22, 2017 5:54 pm
languages_spoken: Korean, English
ODROIDs: XU4, XU4Q + Cloudshell2, H2, N2
Has thanked: 26 times
Been thanked: 98 times
Contact:

Re: Building vscode on the N2

Post by joshua.yang »

Great guide. :)

Is any laggy behaves on VS Code?

wallyz21
Posts: 146
Joined: Thu Apr 04, 2019 11:00 am
languages_spoken: english
ODROIDs: N2
Has thanked: 10 times
Been thanked: 17 times
Contact:

Re: Building vscode on the N2

Post by wallyz21 »

@ joshua.yang : The only lag is when vscode first launches but it's not that bad. Once open it is acceptably quite good!

Keep in mind the very first time you open vscode it completes the build process so this can take 30 minutes or so. As stated in the guide this only occurs once (on the first open). Subsequent opens are good!
Walter Zambotti
N2 - Ubuntu Mate Desktop

joshua.yang
Posts: 433
Joined: Fri Sep 22, 2017 5:54 pm
languages_spoken: Korean, English
ODROIDs: XU4, XU4Q + Cloudshell2, H2, N2
Has thanked: 26 times
Been thanked: 98 times
Contact:

Re: Building vscode on the N2

Post by joshua.yang »

Sounds it works flawlessly. Glad to hear that, thanks :)

wallyz21
Posts: 146
Joined: Thu Apr 04, 2019 11:00 am
languages_spoken: english
ODROIDs: N2
Has thanked: 10 times
Been thanked: 17 times
Contact:

Re: Building vscode on the N2

Post by wallyz21 »

As to getting the debugger working for C/C++. Unfortunately MS only provide runtime libraries for certain environments. Linux ARM64 is not one of them. We'll just have to wait until it is provided.

Even if you build vscode-cpptools from the source the finished extension downloads two final dependent runtime binaries from MS when you first install/run the extension.
Walter Zambotti
N2 - Ubuntu Mate Desktop

wallyz21
Posts: 146
Joined: Thu Apr 04, 2019 11:00 am
languages_spoken: english
ODROIDs: N2
Has thanked: 10 times
Been thanked: 17 times
Contact:

Re: Building vscode on the N2

Post by wallyz21 »

I have now managed to get native debugging working in vscode on the N2. The secret is not to use Microsoft's intellisense and debugger but to instead install "Native Debug" by webfreak from the vscode extensions store.
Then configure a launch.json as per usual and it works as expected.
These users thanked the author wallyz21 for the post (total 2):
odroid (Mon Aug 05, 2019 9:51 am) • xabolcs (Mon Aug 12, 2019 11:34 pm)
Walter Zambotti
N2 - Ubuntu Mate Desktop

wallyz21
Posts: 146
Joined: Thu Apr 04, 2019 11:00 am
languages_spoken: english
ODROIDs: N2
Has thanked: 10 times
Been thanked: 17 times
Contact:

Re: Building vscode on the N2

Post by wallyz21 »

Another visual debug tool that works on the N2 is gdbgui which runs in the browser. Works well and disassembles to arm64 code if required.

https://www.gdbgui.com/
Walter Zambotti
N2 - Ubuntu Mate Desktop

invenis
Posts: 23
Joined: Sun Apr 19, 2020 12:40 am
languages_spoken: english
Has thanked: 4 times
Been thanked: 0
Contact:

Re: Building vscode on the N2

Post by invenis »

A year passed...

I plan to buy N2 as a desktop replacement computer because I don't like fan noise.
And N2 is cheaper than an ultrabook with passive cooling.
I would like to do light programming tasks using Visual Studio Code. Mostly JavaScript (Node.js, Angular) and some .Net Core C #.
I have questions:
1. Can I install Visual Studio Code from here https://code.headmelted.com/#linux-install-scripts instead of using your tutorial?
2. Would you be so kind and check for me if the latest version of Visual Studio Code still works well on N2?

Thank you.

jgmdev
Posts: 138
Joined: Tue Jan 28, 2020 2:28 pm
languages_spoken: english, spanish
ODROIDs: U2, N2, N2+, C4
Has thanked: 39 times
Been thanked: 80 times
Contact:

Re: Building vscode on the N2

Post by jgmdev »

invenis wrote:
Thu Apr 30, 2020 2:13 am
1. Can I install Visual Studio Code from here https://code.headmelted.com/#linux-install-scripts instead of using your tutorial?
2. Would you be so kind and check for me if the latest version of Visual Studio Code still works well on N2?
VSCodium is a open source fork of VSCode that basically removes most Microsoft branding and the parts that send data back to Microsoft servers, all this while maintaining original functionality of the editor intact.

So Instead of building it your self which is time consuming some folks are already doing it for you for the aarch platform (arm64) here https://github.com/VSCodium/vscodium and the downloads here https://github.com/VSCodium/vscodium/releases you can also easily install it on archlinux like any other software using the AUR repository https://aur.archlinux.org/packages/vscodium-bin

I used it a couple of times and the performance is great, the only issue is ram consumption which is more than 1 Gig but the N2 with the 4Gig ram gets the job done :), just make sure to use a lightweight desktop environment like mate, xfce, lxde, etc... since swapping can be bad, also make sure to run the OS from a ssd (solid state drive) to get the best performance. I switched to nvim to save ram and because now is easy to add lsp (language server protocol) to get intelisense/autocompletion for any programming language, but I did had to invest some time researching vim plugins and configurations to make editing with it comfortable and efficient :D
These users thanked the author jgmdev for the post (total 2):
odroidn2user (Thu Apr 30, 2020 4:59 pm) • invenis (Fri May 01, 2020 5:33 am)

invenis
Posts: 23
Joined: Sun Apr 19, 2020 12:40 am
languages_spoken: english
Has thanked: 4 times
Been thanked: 0
Contact:

Re: Building vscode on the N2

Post by invenis »

jgmdev wrote:
Thu Apr 30, 2020 11:24 am
also make sure to run the OS from a ssd (solid state drive) to get the best performance.
Originally I was planning to just use an SD card, but you are right - using SSD or at least eMMC is a good idea. Thanks for the advice, I will check VS Codium once I have N2.

wallyz21
Posts: 146
Joined: Thu Apr 04, 2019 11:00 am
languages_spoken: english
ODROIDs: N2
Has thanked: 10 times
Been thanked: 17 times
Contact:

Re: Building vscode on the N2

Post by wallyz21 »

VsCodium can be installed directly via the Mate Software store GUI.
Walter Zambotti
N2 - Ubuntu Mate Desktop

Post Reply

Return to “Ubuntu”

Who is online

Users browsing this forum: No registered users and 0 guests