Skip to content

Refactor Init process to use new CLI gRPC API #342

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 6 commits into from

Conversation

silvanocerza
Copy link
Contributor

The CLI initialization process has been changed in significant ways with PR arduino/arduino-cli#1274, it needs to be thorougly tested before merging to avoid breaking the IDE.

@silvanocerza silvanocerza requested a review from a team April 27, 2021 16:04
@@ -26,6 +26,7 @@ export class CoreServiceImpl extends CoreClientAware implements CoreService {
const { sketchUri, fqbn, compilerWarnings } = options;
const sketchPath = FileUri.fsPath(sketchUri);

await this.coreClientProvider.initialized;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@silvanocerza what happens if the initialized fails or rejects? is it ok to proceed calling coreClient()?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's fine, if the Init gRPC function fails it means it has been called, so Create was successful meaning we have an internal instance in the CLI daemon and we have a "working" client.

If Init fails completely though we must have some other huge problems, with the refactoring failure to load a platform or library just logs an error, but it doesn't stop completely.

I still don't like how I implemented this though, I'd like to show the user a notification when there are this kind of failures but am not sure how to handle that.

@silvanocerza silvanocerza force-pushed the scerza/new-init-process branch 2 times, most recently from e6e139d to f73f321 Compare May 13, 2021 09:57
@ubidefeo
Copy link

@silvanocerza
Installing a platform rebuilds the tools>board menu, but uninstalling does not

  • install a platform
  • look at the boards menu: it's there
  • uninstall the platform
  • look at the boards menu: it's still there

image

@silvanocerza
Copy link
Contributor Author

@ubidefeo I investigated a bit, the same issue is also present when uninstalling a library.

It seems to me this is a race condition, the list of boards divided by platform is retrieved before the platform is uninstalled, the strange thing though is that after installing a new one I'd expect it to stop showing the uninstalled platform but it doesn't. 🤔

This requires some further investigation I guess.

@silvanocerza silvanocerza force-pushed the scerza/new-init-process branch from b6b1073 to 178a11d Compare June 15, 2021 15:20
@silvanocerza
Copy link
Contributor Author

silvanocerza commented Jun 15, 2021

Rebased to fix conflicts and trigger a new build after updating the version of the Arduino CLI.
The issues with core/platforms uninstallation is solved, it was an issue in the CLI after all.

@fstasi fstasi force-pushed the scerza/new-init-process branch from be4546b to 178a11d Compare June 16, 2021 06:41
@silvanocerza silvanocerza force-pushed the scerza/new-init-process branch from 178a11d to 13de2f8 Compare June 16, 2021 10:34
Copy link

@ubidefeo ubidefeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

been poking around for almost an hour and haven't found anything which isn't already an issue in the Beta 7.
LGTM

@silvanocerza
Copy link
Contributor Author

This has been superseded by #506. Closing.

@silvanocerza silvanocerza deleted the scerza/new-init-process branch October 13, 2021 08:06
@per1234 per1234 added conclusion: duplicate Has already been submitted topic: code Related to content of the project itself type: enhancement Proposed improvement labels Oct 13, 2021
@per1234 per1234 added the topic: CLI Related to Arduino CLI label Oct 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: duplicate Has already been submitted topic: CLI Related to Arduino CLI topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants