Skip to content

Commit aa941ea

Browse files
committed
Merge branch 'main' into patch/eclipse-theia/theia#14309
2 parents 5f318d8 + 63e9dfd commit aa941ea

File tree

7 files changed

+33
-24
lines changed

7 files changed

+33
-24
lines changed

.github/workflows/build.yml

+2
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,8 @@ jobs:
286286
SIGNTOOL_PATH: "C:/Program Files (x86)/Windows Kits/10/bin/10.0.19041.0/x86/signtool.exe"
287287
WIN_CERT_PASSWORD: ${{ secrets.INSTALLER_CERT_WINDOWS_PASSWORD }}
288288
WIN_CERT_CONTAINER_NAME: ${{ secrets.INSTALLER_CERT_WINDOWS_CONTAINER }}
289+
WIN_SIGNING_ENABLED: ${{ !github.event.pull_request.head.repo.fork }}
290+
289291
strategy:
290292
matrix:
291293
config: ${{ fromJson(needs.select-targets.outputs.build-matrix) }}

arduino-ide-extension/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "arduino-ide-extension",
3-
"version": "2.3.3",
3+
"version": "2.3.4",
44
"description": "An extension for Theia building the Arduino IDE",
55
"license": "AGPL-3.0-or-later",
66
"scripts": {

arduino-ide-extension/src/node/service-error.ts

+22-19
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { ProgrammerIsRequiredForUploadError } from './cli-protocol/cc/arduino/cl
66
type ProtoError = typeof ProgrammerIsRequiredForUploadError;
77
const protoErrorsMap = new Map<string, ProtoError>([
88
[
9-
'type.googleapis.com/cc.arduino.cli.commands.v1.ProgrammerIsRequiredForUploadError',
9+
'cc.arduino.cli.commands.v1.ProgrammerIsRequiredForUploadError',
1010
ProgrammerIsRequiredForUploadError,
1111
],
1212
// handle other cli defined errors here
@@ -22,30 +22,33 @@ export namespace ServiceError {
2222
return arg instanceof Error && isStatusObject(arg);
2323
}
2424

25-
export function isInstanceOf(arg: unknown, type: unknown): boolean {
25+
export function isInstanceOf<ProtoError>(
26+
arg: unknown,
27+
type: new (...args: unknown[]) => ProtoError
28+
): arg is ProtoError {
2629
if (!isStatusObject(arg)) {
2730
return false;
2831
}
2932

30-
const bin = arg.metadata.get('grpc-status-details-bin')[0];
33+
try {
34+
const bin = arg.metadata.get('grpc-status-details-bin')[0];
35+
const uint8Array =
36+
typeof bin === 'string'
37+
? stringToUint8Array(bin)
38+
: new Uint8Array(bin.buffer, bin.byteOffset, bin.byteLength);
3139

32-
const uint8Array =
33-
typeof bin === 'string'
34-
? stringToUint8Array(bin)
35-
: new Uint8Array(bin.buffer, bin.byteOffset, bin.byteLength);
40+
const errors = Status.deserializeBinary(uint8Array)
41+
.getDetailsList()
42+
.map((details) => {
43+
const typeName = details.getTypeName();
44+
const ErrorType = protoErrorsMap.get(typeName);
45+
return ErrorType?.deserializeBinary(details.getValue_asU8());
46+
});
3647

37-
const errors = Status.deserializeBinary(uint8Array)
38-
.getDetailsList()
39-
.map((details) => {
40-
const typeUrl = details.getTypeUrl();
41-
const ErrorType = protoErrorsMap.get(typeUrl);
42-
return ErrorType?.deserializeBinary(details.getValue_asU8());
43-
});
44-
45-
return !!errors.find((error) => {
46-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
47-
return error && error instanceof <any>type;
48-
});
48+
return !!errors.find((error) => error && error instanceof type);
49+
} catch {
50+
return false;
51+
}
4952
}
5053

5154
function isStatusObject(arg: unknown): arg is StatusObject {

docs/development.md

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ This repository contains the main code, but two more repositories are included d
5050

5151
- To build the application, follow the Theia IDE [prerequisites](https://github.com/eclipse-theia/theia/blob/master/doc/Developing.md#prerequisites).
5252
- This project recommends using [Visual Studio Code (VS Code)](https://code.visualstudio.com/) for the development.
53+
- The build system might also need to build the [Arduino CLI](https://github.com/arduino/arduino-cli), the [Arduino Language Server](https://github.com/arduino/arduino-language-server), and other tools from the sources. In this case it is also necessary to have the build prerequisites for those projects installed. For more details, refer to the Arduino CLI's [prerequisites section](https://arduino.github.io/arduino-cli/latest/CONTRIBUTING/#prerequisites).
5354

5455
## Build from source
5556

electron-app/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
33
"name": "electron-app",
4-
"version": "2.3.3",
4+
"version": "2.3.4",
55
"license": "AGPL-3.0-or-later",
66
"main": "./src-gen/backend/electron-main.js",
77
"dependencies": {
@@ -19,7 +19,7 @@
1919
"@theia/preferences": "1.41.0",
2020
"@theia/terminal": "1.41.0",
2121
"@theia/workspace": "1.41.0",
22-
"arduino-ide-extension": "2.3.3"
22+
"arduino-ide-extension": "2.3.4"
2323
},
2424
"devDependencies": {
2525
"@theia/cli": "1.41.0",

electron-app/scripts/windowsCustomSign.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
const childProcess = require('child_process');
22

33
exports.default = async function (configuration) {
4-
if (!process.env.GITHUB_ACTIONS) {
4+
if (
5+
!process.env.GITHUB_ACTIONS ||
6+
process.env.WIN_SIGNING_ENABLED !== 'true'
7+
) {
58
return;
69
}
710

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "arduino-ide",
3-
"version": "2.3.3",
3+
"version": "2.3.4",
44
"description": "Arduino IDE",
55
"repository": "https://github.com/arduino/arduino-ide.git",
66
"author": "Arduino SA",

0 commit comments

Comments
 (0)