Skip to content

chore(cli): update CLI to 0.35.0-rc.2 #2267

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions arduino-ide-extension/package.json
Original file line number Diff line number Diff line change
@@ -169,13 +169,13 @@
],
"arduino": {
"arduino-cli": {
"version": "0.34.0"
"version": "0.35.0-rc.2"
},
"arduino-fwuploader": {
"version": "2.4.1"
},
"arduino-language-server": {
"version": "0.7.4"
"version": "0.7.5"
},
"clangd": {
"version": "14.0.0"
14 changes: 7 additions & 7 deletions arduino-ide-extension/scripts/generate-protocol.js
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@
const { mkdirSync, promises: fs } = require('node:fs');
const { exec } = require('./utils');
const glob = require('glob');
const { SemVer, gte, valid: validSemVer } = require('semver');
const protoc = path.dirname(require('protoc/protoc'));

const repository = await fs.mkdtemp(path.join(os.tmpdir(), 'arduino-cli-'));
@@ -94,13 +95,12 @@
}
*/
const versionObject = JSON.parse(versionJson);
const version = versionObject.VersionString;
if (
version &&
!version.startsWith('nightly-') &&
version !== '0.0.0-git' &&
version !== 'git-snapshot'
) {
let version = versionObject.VersionString;
if (validSemVer(version)) {
// https://github.com/arduino/arduino-cli/pull/2374
if (gte(new SemVer(version, { loose: true }), new SemVer('0.35.0-rc.1'))) {
version = `v${version}`;
}
console.log(`>>> Checking out tagged version: '${version}'...`);
exec('git', ['-C', repository, 'fetch', '--all', '--tags'], {
logStdout: true,
Original file line number Diff line number Diff line change
@@ -308,7 +308,7 @@ export namespace Sketch {
export namespace Extensions {
export const DEFAULT = '.ino';
export const MAIN = [DEFAULT, '.pde'];
export const SOURCE = ['.c', '.cpp', '.S'];
export const SOURCE = ['.c', '.cpp', '.S', '.cxx', '.cc'];
export const CODE_FILES = [
...MAIN,
...SOURCE,
42 changes: 10 additions & 32 deletions arduino-ide-extension/src/node/board-discovery.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ClientDuplexStream } from '@grpc/grpc-js';
import type { ClientReadableStream } from '@grpc/grpc-js';
import {
Disposable,
DisposableCollection,
@@ -30,9 +30,9 @@ import type { Port as RpcPort } from './cli-protocol/cc/arduino/cli/commands/v1/
import { CoreClientAware } from './core-client-provider';
import { ServiceError } from './service-error';

type Duplex = ClientDuplexStream<BoardListWatchRequest, BoardListWatchResponse>;
type Stream = ClientReadableStream<BoardListWatchResponse>;
interface StreamWrapper extends Disposable {
readonly stream: Duplex;
readonly stream: Stream;
readonly uuid: string; // For logging only
}

@@ -121,34 +121,15 @@ export class BoardDiscovery
return Disposable.create(() => clearTimeout(timer));
}

private async requestStartWatch(
req: BoardListWatchRequest,
duplex: Duplex
): Promise<void> {
return new Promise<void>((resolve, reject) => {
if (
!duplex.write(req, (err: Error | undefined) => {
if (err) {
reject(err);
return;
}
})
) {
duplex.once('drain', resolve);
} else {
process.nextTick(resolve);
}
});
}

private async createWrapper(
client: ArduinoCoreServiceClient
client: ArduinoCoreServiceClient,
req: BoardListWatchRequest
): Promise<StreamWrapper> {
if (this.wrapper) {
throw new Error(`Duplex was already set.`);
}
const stream = client
.boardListWatch()
.boardListWatch(req)
.on('end', () => {
this.logger.info('received end');
this.onStreamDidEndEmitter.fire();
@@ -202,14 +183,11 @@ export class BoardDiscovery
this.watching = new Deferred();
this.logger.info('start new deferred');
const { client, instance } = await this.coreClient;
const wrapper = await this.createWrapper(client);
wrapper.stream.on('data', (resp) => this.onBoardListWatchResponse(resp));
this.logger.info('start request start watch');
await this.requestStartWatch(
new BoardListWatchRequest().setInstance(instance),
wrapper.stream
const wrapper = await this.createWrapper(
client,
new BoardListWatchRequest().setInstance(instance)
);
this.logger.info('start requested start watch');
wrapper.stream.on('data', (resp) => this.onBoardListWatchResponse(resp));
this.watching.resolve();
this.logger.info('start resolved watching');
}
Original file line number Diff line number Diff line change
@@ -488,8 +488,6 @@ export class BoardListWatchRequest extends jspb.Message {
clearInstance(): void;
getInstance(): cc_arduino_cli_commands_v1_common_pb.Instance | undefined;
setInstance(value?: cc_arduino_cli_commands_v1_common_pb.Instance): BoardListWatchRequest;
getInterrupt(): boolean;
setInterrupt(value: boolean): BoardListWatchRequest;

serializeBinary(): Uint8Array;
toObject(includeInstance?: boolean): BoardListWatchRequest.AsObject;
@@ -504,7 +502,6 @@ export class BoardListWatchRequest extends jspb.Message {
export namespace BoardListWatchRequest {
export type AsObject = {
instance?: cc_arduino_cli_commands_v1_common_pb.Instance.AsObject,
interrupt: boolean,
}
}

Original file line number Diff line number Diff line change
@@ -4181,8 +4181,7 @@ proto.cc.arduino.cli.commands.v1.BoardListWatchRequest.prototype.toObject = func
*/
proto.cc.arduino.cli.commands.v1.BoardListWatchRequest.toObject = function(includeInstance, msg) {
var f, obj = {
instance: (f = msg.getInstance()) && cc_arduino_cli_commands_v1_common_pb.Instance.toObject(includeInstance, f),
interrupt: jspb.Message.getBooleanFieldWithDefault(msg, 2, false)
instance: (f = msg.getInstance()) && cc_arduino_cli_commands_v1_common_pb.Instance.toObject(includeInstance, f)
};

if (includeInstance) {
@@ -4224,10 +4223,6 @@ proto.cc.arduino.cli.commands.v1.BoardListWatchRequest.deserializeBinaryFromRead
reader.readMessage(value,cc_arduino_cli_commands_v1_common_pb.Instance.deserializeBinaryFromReader);
msg.setInstance(value);
break;
case 2:
var value = /** @type {boolean} */ (reader.readBool());
msg.setInterrupt(value);
break;
default:
reader.skipField();
break;
@@ -4265,13 +4260,6 @@ proto.cc.arduino.cli.commands.v1.BoardListWatchRequest.serializeBinaryToWriter =
cc_arduino_cli_commands_v1_common_pb.Instance.serializeBinaryToWriter
);
}
f = message.getInterrupt();
if (f) {
writer.writeBool(
2,
f
);
}
};


@@ -4312,24 +4300,6 @@ proto.cc.arduino.cli.commands.v1.BoardListWatchRequest.prototype.hasInstance = f
};


/**
* optional bool interrupt = 2;
* @return {boolean}
*/
proto.cc.arduino.cli.commands.v1.BoardListWatchRequest.prototype.getInterrupt = function() {
return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false));
};


/**
* @param {boolean} value
* @return {!proto.cc.arduino.cli.commands.v1.BoardListWatchRequest} returns this
*/
proto.cc.arduino.cli.commands.v1.BoardListWatchRequest.prototype.setInterrupt = function(value) {
return jspb.Message.setProto3BooleanField(this, 2, value);
};





Loading