Skip to content

Mismatching results when executing platform search in daemon mode #277

Closed
@kittaakos

Description

@kittaakos

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:

func platformReleaseToRPC(platformRelease *cores.PlatformRelease) *rpc.Platform {

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)

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions