Skip to content
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

Improve stability of CMake generator selection #747

Merged
merged 11 commits into from
Sep 12, 2019

Conversation

KoeMai
Copy link
Contributor

@KoeMai KoeMai commented Aug 24, 2019

This change addresses item #512

This changes behavior and stability of the extension

The following changes are proposed:

  • Replaces the CMake generator check from callback by previously CMake generator check and provide it as variable to the driver

The purpose of this change

Issue #512 reports that the extension crashes completely if there was a generator selection problem.
The cmake generator is checked at start of the cmake client when the cmake server protocol requires the information. If there is no useable build system (generator), then there cmake-server client throws an error. But there is no way to return this error into the cmake-server-driver instance. The driver instance is broken, and cmake-tools does not know it and will not create a new instance.

The simplest solution was to move the generator selection to the cmake-tools context so that the driver does not have to select the generator. It only uses it like other build information.

This kind of error is only possible in cmake-server-api driver, legacy driver and file-api driver need the generator before executing the cmake configure step.

Additional information

KoeMai and others added 8 commits August 18, 2019 07:42
The cms client normally started a pick call in the UI.
This modification moves the questions infront of the start.
This removes the required callback from cms client.
The prefered generators are extracted by the cmake drive from configuration,
kit files or settings. This modification moves the aggregation of different
prefered generator out of the driver into the cmake tools.
This allows to defines exact preferred generators for testing (no hidden
dependency). The driver only checks the prefered generator list,
if there is more then one then the first existing generator is selected.

- Fix wrong preferred generator definition in test
- Extend debug information
The error of invalid generators/kits is a parallel event based dead of
the backend driver (Cmake-server client).

This modification moves the generator selection and test from the
backend driver part to the UI accessable part of the driver.
This makes exception visible for Promise and exception handling.
- Replace driver creation by only update existing driver if it is present
- Clear active kit if it is broken
- Extend test for linux
@bobbrow
Copy link
Member

bobbrow commented Aug 29, 2019

#707 is about ready to go, if you can respond to my feedback, we can get that one committed so there will be less churn to review in this PR.

bobbrow
bobbrow previously approved these changes Sep 7, 2019
Copy link
Member

@bobbrow bobbrow left a comment

Choose a reason for hiding this comment

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

Please fix the spelling regression, then this is good to go.

@@ -271,25 +271,25 @@ export class CMakeTools implements vscode.Disposable, api.CMakeToolsAPI {
}

let drv: CMakeDriver;
const preferredGenerators = this.getPreferredGenerators();
const preferedGenerators = this.getPreferredGenerators();
Copy link
Member

Choose a reason for hiding this comment

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

The spelling was correct before. Now it is incorrect. Please revert.

@bobbrow bobbrow merged commit bf4d15c into microsoft:develop Sep 12, 2019
@KoeMai KoeMai deleted the issue_512_move_generator_selection branch September 13, 2019 05:57
@github-actions github-actions bot locked and limited conversation to collaborators Jan 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants