Skip to content

Commit e34dccd

Browse files
author
Akos Kitta
committed
feat: build IDE2 on linux arm
Ref: #107 Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
1 parent cd1d16f commit e34dccd

File tree

7 files changed

+21
-14
lines changed

7 files changed

+21
-14
lines changed

Diff for: arduino-ide-extension/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@
115115
"mockdate": "^3.0.5",
116116
"moment": "^2.24.0",
117117
"protoc": "^1.0.4",
118-
"shelljs": "^0.8.3",
118+
"shelljs": "^0.8.5",
119119
"sinon": "^12.0.1",
120120
"sinon-chai": "^3.7.0",
121121
"typemoq": "^2.1.0",
@@ -162,7 +162,7 @@
162162
"version": "0.28.0"
163163
},
164164
"fwuploader": {
165-
"version": "2.2.0"
165+
"version": "2.2.2"
166166
},
167167
"clangd": {
168168
"version": "14.0.0"

Diff for: arduino-ide-extension/scripts/download-ls.js

+6
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,12 @@
8888
lsSuffix = 'Linux_64bit.tar.gz';
8989
clangdSuffix = 'Linux_64bit';
9090
break;
91+
case 'linux-arm':
92+
clangdExecutablePath = path.join(build, 'clangd');
93+
clangFormatExecutablePath = path.join(build, 'clang-format');
94+
lsSuffix = 'Linux_ARMv7.tar.gz';
95+
clangdSuffix = 'Linux_ARMv6'; // there is no ARNv7 available/ but armv7l GNU/Linux can run ARMv6 artifacts
96+
break;
9197
case 'win32-x64':
9298
clangdExecutablePath = path.join(build, 'clangd.exe');
9399
clangFormatExecutablePath = path.join(build, 'clang-format.exe');

Diff for: electron/build/template-package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"electron-notarize": "^1.1.1",
1616
"is-ci": "^2.0.0",
1717
"ncp": "^2.0.0",
18-
"shelljs": "^0.8.3"
18+
"shelljs": "^0.8.5"
1919
},
2020
"scripts": {
2121
"build": "yarn download:plugins && theia build --mode production && yarn patch",

Diff for: electron/packager/index.js

+6-5
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@
66
const shell = require('shelljs');
77
const glob = require('glob');
88
const isCI = require('is-ci');
9-
// Note, this will crash on PI if the available memory is less than desired heap size.
9+
// Note, this will crash on PI if the available memory is less than the desired heap size. Limit the max heap size to the 75% of the available memory.
1010
// https://github.com/shelljs/shelljs/issues/1024#issuecomment-1001552543
11-
shell.env.NODE_OPTIONS = '--max_old_space_size=4096'; // Increase heap size for the CI
11+
const heapSize = Math.min(4096, (require('v8').getHeapStatistics().total_physical_size / 1024) * 0.75).toFixed(0);
12+
shell.env.NODE_OPTIONS = `--max_old_space_size=${heapSize}`; // Increase heap size for the CI
1213
shell.env.PUPPETEER_SKIP_CHROMIUM_DOWNLOAD = 'true'; // Skip download and avoid `ERROR: Failed to download Chromium`.
1314
const template = require('./config').generateTemplate(
1415
new Date().toISOString()
@@ -266,14 +267,14 @@ ${fs.readFileSync(path('..', 'build', 'package.json')).toString()}
266267
//-----------------------------------+
267268
// Package the electron application. |
268269
//-----------------------------------+
270+
const arch = process.platform === 'linux' && process.arch === 'arm' ? ' --armv7l' : '';
269271
exec(
270-
`yarn --network-timeout 1000000 --cwd ${path('..', 'build')} package`,
272+
`yarn --network-timeout 1000000 --cwd ${path('..', 'build')} package${arch}`,
271273
`Packaging your ${productName} application`
272274
);
273275

274276
//-----------------------------------------------------------------------------------------------------+
275-
// Recalculate artifacts hash and copy to another folder (because they can change after signing them).
276-
// Azure does not support wildcard for `PublishBuildArtifacts@1.pathToPublish` |
277+
// Recalculate artifacts hash and copy to another folder (because they can change after signing them). |
277278
//-----------------------------------------------------------------------------------------------------+
278279
if (isCI) {
279280
try {

Diff for: electron/packager/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"is-ci": "^2.0.0",
2727
"mocha": "^7.1.1",
2828
"semver": "^7.3.2",
29-
"shelljs": "^0.8.3",
29+
"shelljs": "^0.8.5",
3030
"sinon": "^9.0.1",
3131
"temp": "^0.9.1",
3232
"yaml": "^1.10.2",

Diff for: electron/packager/yarn.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -1338,10 +1338,10 @@ shebang-regex@^1.0.0:
13381338
resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3"
13391339
integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=
13401340

1341-
shelljs@^0.8.3:
1342-
version "0.8.3"
1343-
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.3.tgz#a7f3319520ebf09ee81275b2368adb286659b097"
1344-
integrity sha512-fc0BKlAWiLpwZljmOvAOTE/gXawtCoNrP5oaY7KIaQbbyHeQVg01pSEuEGvGh3HEdBU4baCD7wQBwADmM/7f7A==
1341+
shelljs@^0.8.5:
1342+
version "0.8.5"
1343+
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.5.tgz#de055408d8361bed66c669d2f000538ced8ee20c"
1344+
integrity sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==
13451345
dependencies:
13461346
glob "^7.0.0"
13471347
interpret "^1.0.0"

Diff for: yarn.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -13404,7 +13404,7 @@ shell-path@^2.1.0:
1340413404
dependencies:
1340513405
shell-env "^0.3.0"
1340613406

13407-
shelljs@^0.8.3:
13407+
shelljs@^0.8.5:
1340813408
version "0.8.5"
1340913409
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.5.tgz#de055408d8361bed66c669d2f000538ced8ee20c"
1341013410
integrity sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==

0 commit comments

Comments
 (0)