-
Notifications
You must be signed in to change notification settings - Fork 464
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
Changes from 7 commits
75332f1
60084d0
0b43e71
cd72206
b3d12f5
c965ab8
4cd6d14
0f0a1db
c4b7c03
08f4ae6
ba58c7a
188de38
b43f39b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,8 @@ import rollbar from '@cmt/rollbar'; | |
import { ExpansionOptions } from '@cmt/expand'; | ||
import paths from '@cmt/paths'; | ||
import { KitsController } from '@cmt/kitsController'; | ||
import { descriptionForKit, Kit, SpecialKits } from '@cmt/kit'; | ||
import { descriptionForKit, Kit, getKitDetect, SpecialKits } from '@cmt/kit'; | ||
import { majorVersionSemver, minorVersionSemver, parseTargetTriple, TargetTriple } from '@cmt/triple'; | ||
import { getHostTargetArchString } from '@cmt/installs/visualStudio'; | ||
import { loadSchema } from '@cmt/schema'; | ||
import json5 = require('json5'); | ||
|
@@ -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(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 kitDetect = kit ? await getKitDetect(kit) : undefined; | ||
const target: Partial<TargetTriple> | undefined = kitDetect ? parseTargetTriple(kitDetect?.triple ?? '') ?? {} : undefined; | ||
const version = kitDetect?.version ?? '0.0'; | ||
|
||
const expansionOpts: ExpansionOptions = { | ||
vars: { | ||
workspaceFolder, | ||
workspaceFolderBasename: path.basename(workspaceFolder), | ||
workspaceHash: util.makeHashString(workspaceFolder), | ||
workspaceRoot: workspaceFolder, | ||
buildKit: kit?.name || '__unknownkit__', | ||
buildKitVendor: kitDetect?.vendor ?? '__unknow_vendor__', | ||
buildKitTriple: kitDetect?.triple ?? '__unknow_triple__', | ||
buildKitVersion: version, | ||
buildKitHostOs: process.platform, | ||
buildKitTargetOs: target?.targetOs ?? '__unknow_target_os__', | ||
buildKitTargetArch: target?.targetArch ?? '__unknow_target_arch__', | ||
buildKitVersionMajor: majorVersionSemver(version), | ||
buildKitVersionMinor: minorVersionSemver(version), | ||
workspaceRootFolderName: path.dirname(workspaceFolder), | ||
userHome: paths.userHome, | ||
// Following fields are not supported for sourceDir expansion | ||
|
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.