Skip to content

Instantly share code, notes, and snippets.

@kcchien
Last active July 24, 2020 17:19
Show Gist options
  • Save kcchien/5ff36c355be9ea61e4849b4f8e092c28 to your computer and use it in GitHub Desktop.
Save kcchien/5ff36c355be9ea61e4849b4f8e092c28 to your computer and use it in GitHub Desktop.
在 nVidia Jetson Nano 編譯與安裝 VSCode buildVSCode.sh : 編譯與安裝 product.json: 要記得先覆蓋原始碼裡的那一份
# 退出桌面模式,以節省記憶體,不然編譯到一半會有記憶體不足的狀況,造成失敗
# 你的畫面會進入Console 模式,是正常的
sudo systemctl isolate multi-user
# 準備建置原始碼
yarn
# 建置原始碼,這個會要花一些時間,約15~20分鐘
yarn run gulp vscode-linux-arm64-min
yarn run gulp vscode-linux-arm64-build-deb
# 安裝建置完的deb
sudo dpkg -i ./.build/linux/deb/arm64/deb/code-oss_1.??.?-*_arm64.deb
# 因為Yarn是必要的套件,所以要加入Yarn的repo
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/sources.list.d/yarn.list
# 更新
sudo apt update
# 安裝Yarn跟其他必要的套件
sudo apt install -y libx11-dev libxkbfile-dev libsecret-1-dev fakeroot npm curl nodejs nodejs-dev yarn
# 切換到家目錄底下
cd ~
# 下載官方Visual Studio Code 的原始碼
git clone https://github.com/Microsoft/vscode.git
# 切到vscode目錄底下
pushd vscode
# 把package.json的 max_old_space_size參數由4095改成2048
sed -i 's/4095/2048/g' package.json
{
"nameShort": "Code - OSS",
"nameLong": "Code - OSS",
"applicationName": "code-oss",
"dataFolderName": ".vscode-oss",
"win32MutexName": "vscodeoss",
"licenseName": "MIT",
"licenseUrl": "https://github.com/Microsoft/vscode/blob/master/LICENSE.txt",
"win32DirName": "Microsoft Code OSS",
"win32NameVersion": "Microsoft Code OSS",
"win32RegValueName": "CodeOSS",
"win32AppId": "{{E34003BB-9E10-4501-8C11-BE3FAA83F23F}",
"win32x64AppId": "{{D77B7E06-80BA-4137-BCF4-654B95CCEBC5}",
"win32UserAppId": "{{C6065F05-9603-4FC4-8101-B9781A25D88E}",
"win32x64UserAppId": "{{C6065F05-9603-4FC4-8101-B9781A25D88E}",
"win32AppUserModelId": "Microsoft.CodeOSS",
"win32ShellNameShort": "C&ode - OSS",
"darwinBundleIdentifier": "com.visualstudio.code.oss",
"linuxIconName": "com.visualstudio.code.oss",
"licenseFileName": "LICENSE.txt",
"reportIssueUrl": "https://github.com/Microsoft/vscode/issues/new",
"urlProtocol": "code-oss",
"extensionAllowedProposedApi": [
"ms-vscode.references-view"
],
"extensionsGallery": {
"serviceUrl": "https://marketplace.visualstudio.com/_apis/public/gallery",
"cacheUrl": "https://vscode.blob.core.windows.net/gallery/index",
"itemUrl": "https://marketplace.visualstudio.com/items"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment