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

Fix1914 - Variable substitution stopped working with release 1.7 #3268

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

andreeis
Copy link
Contributor

Fix1914 - Variable substitution stopped working with release 1.7, related to sourceDirectory and kit info variables.
#1914

Will add explanations later, do more cleanup and also ensure more variables are considered. For now, just kit name and vendor, two examples that are different and exist in different data structures. Creating the PR to see tests outcome.

@andreeis andreeis marked this pull request as ready for review August 1, 2023 13:58
@@ -42,12 +43,26 @@ export class PresetsController {
const presetsController = new PresetsController(project, kitsController, isMultiProject);
const expandSourceDir = async (dir: string) => {
const workspaceFolder = project.workspaceFolder.uri.fsPath;
const kit = project.getActiveKit();
Copy link
Collaborator

Choose a reason for hiding this comment

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

This part worries me, if we're in the presetsController then don't we not care about kits? Since it's either kits or Presets? Not both?

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 didn't step back and realize this obvious fact. I just noticed errors and complains in my repro and just went head first into making those go away. I'll rethink a bit and get back with an update. Very good essential point.

const ws_root = util.lightNormalizePath(workspaceFolderFspath || '.');

// Fill in default replacements
if (!kit) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same worry here, I'm not sure we want to be using kits every time the cmakeDriver uses this method, since couldn't a preset use this method?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Perfect point, I'll rethink and be back with an update.

@andreeis
Copy link
Contributor Author

The last PR update does the following:

  • error when presets are on and user still has kit variables to expand. we don't expand even if, with presets off, we have all info available saved in the project state
  • fix wrong assumption in the previous approach: we can't expand the generator name variable in sourceDir. Generator deduction depends on configure which depends on sourceDir. So we error if sourceDir contains generator variable.

@gcampbell-msft gcampbell-msft added this to the 1.17 milestone Nov 13, 2023
@gcampbell-msft gcampbell-msft modified the milestones: 1.17, Backlog Jan 16, 2024
@andreeis andreeis reopened this May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants