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)
Activity
kittaakos commentedon Jul 15, 2019
I have found that the
Boards
are set only for the most recent version of thePlatformRelease
even when running the CLI in non-daemon mode. It is available for1.6.23
but missing for all other previous release versions. I do not know if it is related, though.kittaakos commentedon Jul 15, 2019
I think it is broken for
core search
as well. I have checked out the source, modified a bit by adding some logging, and ran thecore search ""
command; theBoards
were an empty array.BoardsManifest
were correctly set.Commit: 1628b39
My local changes:
Executed command:
go run main.go core search ""
Output:
I would have expected, when the
BoardsManifest
is populated, theBoards
are too. Since theBoards
are not set the gRPC client cannot get back theBoards
for a particularPlatform
.kittaakos commentedon Jul 18, 2019
I am still trying to catch up with the codebase but isn't it a problem that we set the
BoardsManifest
but we do not set theBoards
herearduino-cli/arduino/cores/packageindex/index.go
Line 142 in 296c872
when we load the package index from
https:/downloads.arduino.cc/packages/package_index.json
?BoardsManifest
ifBoards
is not applicable #294cmaglie commentedon Sep 12, 2019
Fixed by #294