From f1a377045e1e77b780d64c67054711fe8c0241e7 Mon Sep 17 00:00:00 2001 From: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com> Date: Thu, 29 Aug 2024 12:27:15 -0400 Subject: [PATCH] fix presets expansion (#4024) * fix presets expansion * missed a change * update changelog --- CHANGELOG.md | 8 +++++++- src/preset.ts | 6 +++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 75aa5545d..20e2c6895 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,12 @@ # What's New? -## 1.19 +## 1.19.50 + +Bug Fixes: + +- Fix env expansion of all variables (toolchainFile, etc.) in presets. [#4019](https://github.com/microsoft/vscode-cmake-tools/issues/4019) + +## 1.19.49 Features: diff --git a/src/preset.ts b/src/preset.ts index ddf3a4a9d..3d689398a 100644 --- a/src/preset.ts +++ b/src/preset.ts @@ -1284,7 +1284,7 @@ export async function expandConfigurePresetVariables(preset: ConfigurePreset, fo } } - expansionOpts.envOverride = expandedPreset.environment; + expansionOpts.envOverride = EnvironmentUtils.mergePreserveNull([env, expandedPreset.environment]); if (preset.__file && preset.__file.version >= 3) { // For presets v3+ binaryDir is optional, but cmake-tools needs a value. Default to something reasonable. @@ -1659,7 +1659,7 @@ export async function expandBuildPresetVariables(preset: BuildPreset, name: stri } } - expansionOpts.envOverride = expandedPreset.environment; + expansionOpts.envOverride = EnvironmentUtils.mergePreserveNull([env, expandedPreset.environment]); // Expand other fields if (preset.targets) { @@ -1834,7 +1834,7 @@ export async function expandTestPresetVariables(preset: TestPreset, name: string } } - expansionOpts.envOverride = expandedPreset.environment; + expansionOpts.envOverride = EnvironmentUtils.mergePreserveNull([env, expandedPreset.environment]); // Expand other fields if (preset.overwriteConfigurationFile) {