Skip to content

Commit

Permalink
feat: build IDE2 on darwin arm64
Browse files Browse the repository at this point in the history
 - Use Node.js 16+,
 - All workflow files use `.yml` instead of `.yaml`,
 - Use Arduino LS `0.7.2`,
 - Updated `electron-builder` to `23.3.3`,
 - Removed unused `conf-node-gyp.sh`,
 - Removed unused `THEIA_ELECTRON_SKIP_REPLACE_FFMPEG`, and
 - Aligned `node-gyp@9.3.0`, `electron-rebuild@3.2.9` to Theia.

Co-authored-by: per1234 <accounts@perglass.com>
Co-authored-by: Akos Kitta <a.kitta@arduino.cc>

Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
  • Loading branch information
Akos Kitta committed Oct 27, 2022
1 parent f93f780 commit cd1d16f
Show file tree
Hide file tree
Showing 21 changed files with 75 additions and 158 deletions.
File renamed without changes.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- name: Install Node.js 14.x
- name: Install Node.js 16.x
uses: actions/setup-node@v1
with:
node-version: '14.x'
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'

- name: Install Python 3.x
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/check-i18n-task.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install Node.js 14.x
- name: Install Node.js 16.x
uses: actions/setup-node@v2
with:
node-version: '14.x'
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'

- name: Install Go
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
env:
CHANGELOG_ARTIFACTS: changelog
# See: https://github.com/actions/setup-node/#readme
NODE_VERSION: 14.x
NODE_VERSION: 16.x

jobs:
create-changelog:
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions .github/workflows/i18n-nightly-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- name: Install Node.js 14.x
- name: Install Node.js 16.x
uses: actions/setup-node@v2
with:
node-version: '14.x'
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'

- name: Install Go
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/i18n-weekly-pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v2

- name: Install Node.js 14.x
- name: Install Node.js 16.x
uses: actions/setup-node@v2
with:
node-version: '14.x'
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'

- name: Install Go
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/themes-weekly-pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
env:
# See vars.GO_VERSION field of https://github.com/arduino/arduino-cli/blob/master/DistTasks.yml
GO_VERSION: "1.17"
NODE_VERSION: 14.x
NODE_VERSION: 16.x

jobs:
pull-from-jsonbin:
Expand Down
2 changes: 1 addition & 1 deletion arduino-ide-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@
"version": "14.0.0"
},
"languageServer": {
"version": "0.7.1"
"version": "0.7.2"
}
}
}
3 changes: 3 additions & 0 deletions arduino-ide-extension/scripts/download-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
const suffix = (() => {
switch (platform) {
case 'darwin':
if (arch === 'arm64') {
return 'macOS_ARM64.tar.gz';
}
return 'macOS_64bit.tar.gz';
case 'win32':
return 'Windows_64bit.zip';
Expand Down
6 changes: 6 additions & 0 deletions arduino-ide-extension/scripts/download-ls.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,12 @@
lsSuffix = 'macOS_64bit.tar.gz';
clangdSuffix = 'macOS_64bit';
break;
case 'darwin-arm64':
clangdExecutablePath = path.join(build, 'clangd');
clangFormatExecutablePath = path.join(build, 'clang-format');
lsSuffix = 'macOS_ARM64.tar.gz';
clangdSuffix = 'macOS_ARM64';
break;
case 'linux-x64':
clangdExecutablePath = path.join(build, 'clangd');
clangFormatExecutablePath = path.join(build, 'clang-format');
Expand Down
2 changes: 1 addition & 1 deletion docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ This repository contains the main code, but two more repositories are included d
If you’re familiar with TypeScript, the [Theia IDE](https://theia-ide.org/), and if you want to contribute to the
project, you should be able to build the Arduino IDE locally.
Please refer to the [Theia IDE prerequisites](https://github.com/eclipse-theia/theia/blob/master/doc/Developing.md#prerequisites) documentation for the setup instructions.
> **Note**: Node.js 14 must be used instead of the version 12 recommended at the link above.
> **Note**: Node.js 16 must be used instead of the version 14 recommended at the link above.
Once you have all the tools installed, you can build the editor following these steps

Expand Down
6 changes: 3 additions & 3 deletions docs/internal/Arm.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

Building the Pro IDE on Linux `armv7l` (aka `armhf`) and `aarch64` (aka `arm64`):

1. Install Node.js 14.x with [nvm](https://github.com/nvm-sh/nvm#install--update-script):
1. Install Node.js 16.x with [nvm](https://github.com/nvm-sh/nvm#install--update-script):
```
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
```
Restart your shell then:
```
nvm install 14
nvm use 14
nvm install 16
nvm use 16
```
Verify:
```
Expand Down
6 changes: 3 additions & 3 deletions docs/internal/Ubuntu.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ sudo apt update \
build-essential \
&& wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash \
&& source ~/.bashrc \
&& nvm install 14 \
&& nvm use 14 \
&& nvm alias default 14 \
&& nvm install 16 \
&& nvm use 16 \
&& nvm alias default 16 \
&& 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 && sudo apt install --no-install-recommends yarn \
Expand Down
9 changes: 6 additions & 3 deletions electron/build/template-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"devDependencies": {
"@theia/cli": "1.25.0",
"cross-env": "^7.0.2",
"electron-builder": "23.0.2",
"electron-builder": "23.3.3",
"electron-notarize": "^1.1.1",
"is-ci": "^2.0.0",
"ncp": "^2.0.0",
Expand All @@ -26,7 +26,7 @@
"patch": "ncp ./patch/backend/main.js ./src-gen/backend/main.js"
},
"engines": {
"node": ">=14.0.0 <15"
"node": ">=16.0.0 <17"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -89,7 +89,10 @@
"hardenedRuntime": true,
"gatekeeperAssess": false,
"entitlements": "resources/entitlements.mac.plist",
"entitlementsInherit": "resources/entitlements.mac.plist"
"entitlementsInherit": "resources/entitlements.mac.plist",
"target": {
"target": "default"
}
},
"linux": {
"target": [
Expand Down
11 changes: 0 additions & 11 deletions electron/packager/conf-node-gyp.sh

This file was deleted.

3 changes: 3 additions & 0 deletions electron/packager/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ function artifactName() {
throw new Error(`Unsupported platform, arch: ${platform}, ${arch}`);
}
case 'darwin': {
if (arch === 'arm64') {
return `${name}_${id}_macOS_ARM64.\$\{ext}`;
}
return `${name}_${id}_macOS_64bit.\$\{ext}`;
}
case 'linux': {
Expand Down
1 change: 0 additions & 1 deletion electron/packager/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
const shell = require('shelljs');
const glob = require('glob');
const isCI = require('is-ci');
shell.env.THEIA_ELECTRON_SKIP_REPLACE_FFMPEG = '1'; // Do not run the ffmpeg validation for the packager.
// Note, this will crash on PI if the available memory is less than desired heap size.
// https://github.com/shelljs/shelljs/issues/1024#issuecomment-1001552543
shell.env.NODE_OPTIONS = '--max_old_space_size=4096'; // Increase heap size for the CI
Expand Down
2 changes: 1 addition & 1 deletion electron/packager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"yargs": "^12.0.5"
},
"engines": {
"node": ">=14.0.0 <15"
"node": ">=16.0.0 <17"
},
"mocha": {
"reporter": "spec",
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"license": "AGPL-3.0-or-later",
"private": true,
"engines": {
"node": ">=14.0.0 <15"
"node": ">=16.0.0 <17"
},
"devDependencies": {
"@theia/cli": "1.25.0",
Expand All @@ -26,7 +26,7 @@
"ignore-styles": "^5.0.1",
"lerna": "^3.20.2",
"lint-staged": "^11.0.0",
"node-gyp": "^9.0.0",
"node-gyp": "^9.3.0",
"prettier": "^2.3.1",
"reflect-metadata": "^0.1.10",
"rimraf": "^2.6.1",
Expand All @@ -37,7 +37,8 @@
"xhr2": "^0.2.1"
},
"resolutions": {
"@types/react": "16.14.25"
"@types/react": "16.14.25",
"electron-rebuild": "3.2.9"
},
"scripts": {
"prepare": "lerna run prepare && yarn download:plugins",
Expand Down
Loading

0 comments on commit cd1d16f

Please sign in to comment.