Description
Bug Report
Current behavior
I am experiencing some oddities when executing a platform search via the CLI.
When I call the CLI directly, it works. So for instance, when I run ./arduino-cli core list
, everything is fine. Here in the code, both the Boards
and BoardsManifest
are populated on the PlatformRelease
instance as expected; hence mapping to the RPC format is correct.
However, when I start the CLI in daemon mode and connect from my client, the Boards
is empty when I perform the same platform search.
Most likely, either my configuration is incomplete, or my InitRequest
is bogus.
I have noticed, the CLI always adds the default package index URL to the board manager additional URLs. I have corrected it; still, the Bords
array is empty.
My client code looks like this:
const config = new Configuration()
config.setSketchbookdir('~/Documents/Arduino');
config.setDatadir('~/Library/Arduino15/staging');
config.setDownloadsdir('~/Library/Arduino15/staging');
config.setBoardmanageradditionalurlsList(['https://downloads.arduino.cc/packages/package_index.json']);
const initReq = new InitReq();
initReq.setConfiguration(config);
const initResp = await new Promise<InitResp>(resolve => {
let resp: InitResp | undefined = undefined;
const stream = client.init(initReq);
stream.on('data', (data: InitResp) => {
if (!resp) {
resp = data;
}
})
stream.on('end', () => {
resolve(resp);
})
});
const instance = initResp.getInstance();
// Trigger an update index via `UpdateIndexReq`.
Expected behavior
The Boards
are populated just like BoardsManifest
on the cores.PlatformRelease
instances when calling:
arduino-cli/commands/core/core.go
Line 28 in 1628b39
Environment
- CLI version (output of
arduino-cli version
):
arduino-cli Version: nightly-21 Commit: 1628b39 BuildDate: 2019-07-15 09:31:26.332485 +0000 UTC
- Go version (if building from sources):
- OS version:
macOS 10.14.4 (18E226)