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

Option to resolve build diagnostics relative to workspace folder #1401

Closed
i-ky opened this issue Aug 6, 2020 · 7 comments
Closed

Option to resolve build diagnostics relative to workspace folder #1401

i-ky opened this issue Aug 6, 2020 · 7 comments
Labels
enhancement an enhancement to the product that is either not present or an improvement to an existing feature Feature: build help wanted we currently are not planning work on this and would like help from the open source community stale-exempt to use with close-stale-issues and close-old-issues bot
Milestone

Comments

@i-ky
Copy link
Contributor

i-ky commented Aug 6, 2020

Brief Issue Summary

It is a known problem that achieving reproducible builds with CMake requires hacks and workarounds, especially if compiler in use does not support -ffile-prefix-map. In our project we apply some trickery to ensure that compiler is always invoked from the source root with a relative path to source file. As a result of that, compiler prints all errors and warnings with paths relative to the source root instead of absolute paths or paths relative to build directory:

[build] some/path/relative/to/source/root/foo.cpp:12:2: error: #error test
[build]  #error test
[build]   ^

This confuses CMake Tools, if extension detects that path is relative, it appends it to build directory. In Problems tab we see something like:

foo.cpp build/directory/some/path/relative/to/source/root
#error test GCC [12, 2]

Some relevant code:

const file_diags = consumer.compileConsumer.resolveDiagnostics(drv.binaryDir);

resolveDiagnostics(basePath: string): FileDiagnostic[] {

const filepath = util.resolvePath(raw_diag.file, basePath);

const relFilePath = vscode.Uri.file(util.resolvePath(rel.file, basePath));

export function resolvePath(inpath: string, base: string) {
const abspath = path.isAbsolute(inpath) ? inpath : path.join(base, inpath);
// Even absolute paths need to be normalized since they could contain rogue .. and .
return lightNormalizePath(abspath);
}

Expected:

We need some sort of configuration option to be able to resolve compiler diagnostics relative to the source root.

Apparent Behavior:

Currently, diagnostics are reported with wrong file path and cannot be opened by clicking on them.

Unable to open 'foo.cpp': Unable to read file '/workspace/folder/build/directory/some/path/relative/to/source/root/foo.cpp' (Error: Unable to resolve non-existing file '/workspace/folder/build/directory/some/path/relative/to/source/root/foo.cpp').

Platform and Versions

  • Operating System: Ubuntu 16.04
  • CMake Version: 3.15.5
  • VSCode Version: 1.47.3
  • CMake Tools Extension Version: 0.29.0
  • Compiler/Toolchain: GCC 4.9.3
@bobbrow
Copy link
Member

bobbrow commented Aug 6, 2020

If you would like to add a new setting (e.g. cmake.buildDiagnosticsRootPath) and do a PR for this feature, we would be happy to review and accept it.

@bobbrow bobbrow added enhancement an enhancement to the product that is either not present or an improvement to an existing feature Feature: build labels Aug 6, 2020
@bobbrow bobbrow added this to the Backlog milestone Aug 6, 2020
@i-ky
Copy link
Contributor Author

i-ky commented Aug 18, 2020

We managed to work around the issue using

"cmake.buildTask": true

in settings.json and a custom build task in tasks.json:

{
    "label": "Build selected configuration",
    "group": {
        "kind": "build",
        "isDefault": true
    },
    "type": "shell",
    "command": "/bin/bash",
    "args": [
        "-c",
        "${command:cmake.tasksBuildCommand}"
    ],
    "problemMatcher": "$gcc"
}

This way we gained control over problemMatcher and now it seems to be doing the right thing.

I have to say it took us a while to figure out how cmake.buildTask was supposed to work, it is a pity that #647 got merged without documentation update.

@dagar
Copy link

dagar commented Sep 16, 2020

I've come across the same problem with the current workaround of using a custom build task that sets a relative file location for the problemMatcher.

        {
            "label": "build",
            "type": "shell",
            "command": "/bin/bash",
            "args": [
                "-c",
                "${command:cmake.tasksBuildCommand}"
            ],
            "options": {
                "cwd": "${command:cmake.buildDirectory}"
            },
            "group": {
                "kind": "build",
                "isDefault": true,
            },
            "problemMatcher": {
                "base": "$gcc",
                "fileLocation": ["relative", "${command:cmake.buildDirectory}"]
            }
        },

Is this not in general the right thing to do with cmake? With Ninja it doesn't appear to be possible to have non-relative paths.

@github-actions
Copy link

This issue is now marked as 'stale-old' due to there being no activity on it for the past 720 days. Unless the 'stale-old' label is removed or the issue is commented on, this will be remain open for at least 14 days and then it may be closed. If you would like to make this issue exempt from getting stale, please add the 'stale-exempt' label.

@github-actions github-actions bot added the stale-old to use with the close-old-issues bot label Oct 19, 2023
@snehara99 snehara99 added help wanted we currently are not planning work on this and would like help from the open source community stale-exempt to use with close-stale-issues and close-old-issues bot labels Nov 14, 2023
@github-actions github-actions bot removed the stale-old to use with the close-old-issues bot label Nov 14, 2023
fargies pushed a commit to fargies/vscode-cmake-tools that referenced this issue Jul 14, 2024
fargies pushed a commit to fargies/vscode-cmake-tools that referenced this issue Jul 14, 2024
gcampbell-msft added a commit that referenced this issue Jul 29, 2024
* Fix GitHub 1401, diagnostics relative to workspace folder

 - relative diagnostics files are searched in build_dir and src_dir,
   first existing file is returned
 - defaults to old behavior : `path.resolve(build_dir, file)`
 - `resolveDiagnostics` has been made async to not slow down IDE when
   testing files

* update ChangeLog for #1401

* fix relative file resolution diagnostics test

 - diagnostics paths always use POSIX separators (see `normalizePath` in
   [src/util.ts](src/util.ts))

---------

Co-authored-by: Sylvain Fargier <sylvain.fargier@cern.ch>
Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>
qarni added a commit that referenced this issue Aug 22, 2024
* reversed order of creating workspace browse configurations (#3758)

* reversed order of creating workspace browse configurations

* updated tests

* minimized change by only reversing fileGroups, and reverted tests

* Add clarity in the build log when builds are out of source (#3778)

* Add chesscc to the allow-list of compilers. (#3777)

Co-authored-by: snehara99 <113148726+snehara99@users.noreply.github.com>

* Fix doubling of cpack args passed by package preset (#3766)

* Remove unnecessary logging about string expansion (#3761)

* Remove unnecessary logging about string expansion

* Fix typo in var name

---------

Co-authored-by: snehara99 <113148726+snehara99@users.noreply.github.com>

* Fix UI for settings override of package presets (#3770)

* Fix UI for settings override of package presets

* Fix linter errors

* Skip full configure on variant change for multi-config generators (#3763)

* Don't fully configure after variant change for multi-config generators. Only change parameter for build and refresh IntelliSense.

* Added missing return on 'if else'

* Removed unnecessary log. No previous configure message was printed before it.'

* Run clean-configure when workflow has different configure preset than project (#3768)

* Let cmake.configureArgs overwrite the default cmake args (#3762)

Co-authored-by: snehara99 <113148726+snehara99@users.noreply.github.com>

* Handle "~" in binaryDir path (#3764)

* File system APIs don't recognize ~ in paths and because of this the extension cannot properly interpret cmake file-api jsons to list targets.

* Fix path typo

---------

Co-authored-by: snehara99 <113148726+snehara99@users.noreply.github.com>

* Warning when VS installation instance not found (#3775)

* Add warning about not found VS installation instance and suggestion to re-scan kits, at the request of developers in the community.

* Fix linter errors

---------

Co-authored-by: snehara99 <113148726+snehara99@users.noreply.github.com>

* Fix GitHub 3602, mention --build-config even for default test preset (#3779)

* Better validations that validate before running.  (#3774)

* initial commit

* add better values

* check notice and changelog before release version

* Update kits-variants doc with unsupported commands that are specific for presets (#3784)

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* colorization support in pre-release (#3794)

* colorization support in pre-release

* update changelog

* Sort CMakeLists.txt by depth (#3789)

* Sort CMakeLists.txt by depth

* Add changes to CHANGELOG.md

---------

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* Fixed string parameters and added clarification to the log message (#3787)

* Localization - Translated Strings (#3753)

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* fix schema field in v8 schema (#3809)

* Add check that limits when we -R a regex of all tests (#3814)

* fix ctest

* only try to be smart about this in the test explorer entry points

* updating comment

* add try catch in debug createRunProfile

* Localization - Translated Strings (#3816)

* Update CHANGELOG.md

* update localization for project status view and quick pick (#3810)

* fix issue with test results not found (#3823)

* update braces dependency (#3839)

* Fixes #3725 - user presets not read correctly (#3826)

* get all presets to show in inherit

* if new configure preset inherits from a user preset add to the user presets file

* todo: finish update for different types of presets

* checks for configure inherit and inherit. todo - check workflow

* cleanup + mark as isUserPreset

* undo use isuserpreset field

* cleanup and changelog

* cleanup

* rename interface

* update workflow preset to not extend preset + refactor inheritsfromuserpreset func

* remove preset class fields from workflow preset

* more workflow preset cleanup

* Fixes #3811 - checks for cmake.exe again if it wasnt present the previous time  (#3840)

checks for exe again if it wasn't present the previous time

* Tree view for tests using test suite delimiter (#3759)

* Implement treeview for tests using test suite delimiter

* Support regular expressions for delimiters

* Improve UI string

* Improve UI string

* Address CR comments

* Fix spacing

* make sure to pass entry point through

---------

Co-authored-by: Garrett Campbell <gcampbell@microsoft.com>
Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* Update telemetry API to latest version. (#3843)

* presets + cmake.buildToolArgs: make sure `--` is added in all cases (#3755)

* presets + cmake.buildToolArgs: make sure `--` is added in all cases

Fixes #3754.
This issue was introduced in #3537 (cmake.buildToolsArgs was ignored for presets before).

* Update changelog

---------

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* Update CHANGELOG.md

* Fixes #3140 - Test log unavailable (#3752)

* Using \r\n as line ending

Seems like \r\n is the line ending characters in the Test Output even on systems different from win32

* Specify the test item in the call to appendOutput

Doing so allows to have the output of the test to be printed out in the left part of the "TEST RESULTS" pane when clicking on the desired test in the right part of the same pane.
Before this change we get "The test case did not report any output"

* Adds location information in the call to appendOutput.

The test object may have uri and ranges that can help localization

* Adds entry in the CHANGELOG

---------

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* Upgrade cmake_minimum_required version 3.0.0 -> 3.5.0 (#3805)

* Update cmakeProject.ts

Upgrade cmake_minimum_required version 3.0.0 -> 3.5.0

* Update CHANGELOG.md

---------

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* Add setting for deleting whole build dir when clean configuring (#3783)

* Add setting for deleting whole build dir when clean configuring

* Remove unnecessary tag in new setting in package.json

* Add changelog entry. Remove unnecessary | null from new boolean setting.

---------

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* log error for cmake exe not found (#3847)

* Fixed how we use our '--warn-unused-cli' flag (#3860)

* '--warn-unused-cli' is now used to remove the default '--no-warn-unused-cli' command instead of removing and also adding itself to the arguments

* only removed '--warn--unused-cli' instead of all initial_common_flgs

* Set useCMakePresets context after quick start (#3853)

update active proj to set userpreset context

* remove from pre-release (#3861)

* clean configures when platform differs between old and new selected kit (#3859)

* clean configures when only platform changes between kits

* updated changelog

* check toolset too

* changelog

* update changelog

* add rel to branches (#3867)

* update third parties

* fix release pipeline verification

* fix release pipeline

* update release version for prerelease

* fix variable ref

* Localization - Translated Strings (#3833)

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* Use relative intralinks; Point 'issues' to main GH repo (#3858)

* Replace intra-repo absolute URLs with relative ones.
* Replace remaining pointers to `vector-of-bool` with `microsoft`
  in the URLs than must remain absolute.

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* Update Preferred Generator selection logic (#3869)

* Update preferred generator selection logic

* Update changelog

* Fix lint error

* updated command string to better reflect function (#3876)

* Add guard against reloading a file that's not a variants file (#3878)

* Add guard against reloading a file that's not a variants file

* Update CHANGELOG.md

* Update CHANGELOG.md

* Fix debugger hang on restart (#3846)

* telemetry check for trigger, also include trigger and folder in obj for debugger

* update origin telemetry

* add enum for debug origin

* pass in from command info and cleanup

* Update cmakeFileApiDriver.ts take out import

* move to 1.19 changelog

---------

Co-authored-by: Garrett Campbell <gcampbell@microsoft.com>

* update warning to be an error (#3881)

* add try catch and attempt to grab specifically the json (#3868)

* add try catch and attempt to grab specifically the json

* fix lint errors

---------

Co-authored-by: Fatima Qarni <fatimaqarni@microsoft.com>

* show userpresets in project  outline (#3877)

* move user env expansion forkits to after vsenv merged in (#3887)

* move user env expansion forkits to after vsenv merged in

* changelog

* fix for penv and env differentiation

* avoiding stringifying extensionContext (#3880)

* attempt avoiding stringifying extensionContext

* update changelog

* Skip initializing variant manager when using CMakePresets (#3888)

* Fixed spelling in Delete Build Dir On Clean Configure description (#3893)

* Allow CMake to select a default internal generator when the user selects "__unspec__" for the kit (#3889)

* updated to allow no generator when using file api and cmake 3.15.0 or greater

* fixed kit name check

* updated changelog

* throw nogenerator error if kit isn't __unspec__

* Add "Unspecified" Build Type and Use by Default (Kits Only) (#3879)

* add unspecified build type and remove CMAKE_BUILD_TYPE prop when it's used

* reverted commenting out debugger

* let debugger stop on error again

* updated changelog

* updated the docs with the new option

* updated default kit build type

* fix failing tests

---------

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* localize override settings applied (#3896)

* change langext check for cpp (#3897)

* fix debug environment config being overwritten (#3894)

* fix debug environment config being overwritten

* changelog

* localized the additional properties case (#3895)

* show build task if preset is set to activebuildpreset (#3898)

* show build task if preset is set to activebuildpreset

* changelog

* fix our depth search for CMakeLists.txt (#3904)

* if installDir is a relative path, calculate it relative to the source directory (#3903)

* if installDir is a relative path, I calculate it relative to the source dir

* updated location of checking and updating installDir

* combined with expansion check

* add permissions to workflow

* Fix localized file path for schemas (#3906)

* Add setting to control how we use VS Dev Env (#3892)

* committing state, no progress, just thinking through

* fix how we apply and override devenv to ensure we don't accidentally delete preset environment modifications from user

* check if ninja exists and it's the generator, use that to determine if we should add vs devenv as well

* currently broken, but saving state for adding a setting

* this works well, but I need to add back code that prohibits repeated devenv searching with where.exe

* finalize implementation of the setting for useVsDeveloperEnvironment

* minimize branches

* fix import

* update comments

* fix comment

* remove unnecessary comment

* fallback to better architecture/toolset

* update devenv vars and tests

* fix test for mac

* fix tests

* update changelog

* fix test expand and where.exe env

* update test to explicitly test architecture unit test

---------

Co-authored-by: snehara99 <113148726+snehara99@users.noreply.github.com>

* Fix link in configure.md (#3899)

The section is called "General options", not "Generic options".

* Fix typo in configure.md (#3900)

als -> also

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* The kit name for Clang/MSVC too long, put the arch at the front (#3835)

[kit] Found Kit (trusted): Clang 17.0.3 (MSVC CLI) for MSVC 17.10.35004.147 (Visual Studio Community 2022 Release - x86)
[kit] Found Kit (trusted): Clang 17.0.3 (GNU CLI) for MSVC 17.10.35004.147 (Visual Studio Community 2022 Release - x86)
[kit] Found Kit (trusted): Clang 17.0.3 (MSVC CLI) for MSVC 17.10.35004.147 (Visual Studio Community 2022 Release - amd64)
[kit] Found Kit (trusted): Clang 17.0.3 (GNU CLI) for MSVC 17.10.35004.147 (Visual Studio Community 2022 Release - amd64)

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* Update triage-labels.yml

* Update OneLocBuild process (#3912)

* try service connection already there

* use variables

* Delete .github/workflows/closed-fixed-pending-release.yml

* Only visual studio 2015 neesd fixes the windows sdk path (#3837)

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* Dispose of Launch terminal if environment has changed (#3902)

* Compare entire terminal launch environment and dispose if not equal

* Updated CHANGELOG

---------

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* Localization - Translated Strings (#3884)

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* implement  #2521 by adding output channel argument (#3785)

* implement  #2521 by adding output channel argument

* fix failed configuration not showing output channel on "on error"

* implement review, add changelog

* fix changelog

---------

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>
Co-authored-by: Garrett Campbell <gcampbell@microsoft.com>

* doc: cmake.environment is not applied to launch/debug (#3926)

* Don't require Ninja or Make on PATH when checking generators (#3927)

* Preset file expansion on open/save and expansion validation (#3905)

This change changes the way we do preset file expansion. Expansion now occurs upfront on file open or save, and if there are no errors, the expanded presets will be cached so repeated expansion is not necessary every time getAll{type of preset}Presets() is called.

The only time expansion will happen again is on set preset, which will then also apply the VS developer environment as needed. This is avoided on the initial expansion for performance.

If there are errors in expansion, the errors are shown in the problems panel per file. The presets file will also be set to undefined, which will invalidate that file and not allow any presets in that file to be recognized/selected as valid presets. This is in line with the CMake command line experience.

Some notes:

- The ${generator} macro should not work for packagePresets, but should now expand correctly for all other presets and evaluate conditions correctly
- Tertiary preset cache was added (really its just the original presets cache but used in a new way) to account for included json files that wouldnt be in the original presets files

* better match keybindings to what vscode has (#3928)

* better match keybindings to what vscode has

* update changelog

* Revert "Don't require Ninja or Make on PATH when checking generators (#3927)" (#3938)

This reverts commit bbc74d8.

* check for quick start in select configure preset to prevent second configure (#3933)

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* ensure we take deep copy of presets for presetsPlusIncluded (#3939)

* update telemetry key (#3944)

* update telemetry key

* typo

* Fix GitHub 1401, diagnostics relative to workspace folder (#3780)

* Fix GitHub 1401, diagnostics relative to workspace folder

 - relative diagnostics files are searched in build_dir and src_dir,
   first existing file is returned
 - defaults to old behavior : `path.resolve(build_dir, file)`
 - `resolveDiagnostics` has been made async to not slow down IDE when
   testing files

* update ChangeLog for #1401

* fix relative file resolution diagnostics test

 - diagnostics paths always use POSIX separators (see `normalizePath` in
   [src/util.ts](src/util.ts))

---------

Co-authored-by: Sylvain Fargier <sylvain.fargier@cern.ch>
Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* Configure precondition handler to return boolean to signal a successful recovery case (#3776)

* Making configure precondition handler return a boolean helps to differentiate the successful recovery cases

* Fix pre-condition handler prototype errors in tests

* Experiment with prototypes to fix linter errors

* Add setting for building whole build dir when clean configure

* Remove anything related to deleteBuildDirOnCleanConfigure since it's in a different PR. Keep proper promise<bool> prototype for pre-configure handler return and fix appropriately compilation and lint errors in tests.

* Forgot one file to remove deleteBuildDirOnCleanConfigure from

* Remove forgotten comment

* Add changelog entry

* remove changes not needed

* removing more bad changes

* add logic to regenerate the driver after selecting cmakelists

* remove unused imports

* keep sanity check in _beforeConfigureOrBuild

* only ensure we set the variable so that on retry, it works

* switch return

* erroneous update

* fix

---------

Co-authored-by: Garrett Campbell <gcampbell@microsoft.com>
Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* Localization - Translated Strings (#3932)

* Use template for release pipelines (converted from classic) (#3945)

* try to convert release pipeline to yaml

* ensure trigger

* fix variable expansion

* specify name specifically

* add release and fix powershell setup

* fix name

* uncomment vsce task

* only do release pipeline on release branch

* only allow rel branch for release

* enable trigger always, we can rely on manual verification

* evaluate inherit presets based on presets that should be visible from file (#3941)

* initial changes

* modify other preset flows

* fix unused import

* remove unused import

* check for default preset

* acocunt for userpresets

* remove extra condition

---------

Co-authored-by: Garrett Campbell <gcampbell@microsoft.com>

* fix pipelineArtifact reference (#3948)

* fix pipelineArtifact reference

* update variable update

* try corrected destinationPath

* fix destination typo

* switch to targetPath test

* use correct manual validation task

* Update pipeline (#3952)

* fix validation and pipeline, commented out vsce for testing

* fix indentation for job

* uncomment vsce

* Set usepresets context after manually creating presets file (#3935)

Fixes #3854. Support for watching multiple paths (cmakepresets.json/cmakeuserpresets.json/include files) was broken due to a Chokidar bug. Created a wrapper class to handle this scenario.

* Localization - Translated Strings (#3954)

* Ensure we correctly inherit preset from UserPreset (#3958)

* fix

* analyze user presets first because it's the base if it exists

* more updates to fix include files and telemetry, still needs work and testing

* ensure telemetry and other uses of 'all..Presets' is right

* more fixes

* ensure we don't duplicate cmakepresets in userpresets includes

* remove unnecessary return

* unionWith consistency

* add test

* saving progress (#3960)

* only do special handling of ~ in linux, it breaks windows (#3965)

* Remove popups and update defaults for `configureOnOpen` (#3967)

* update defaults and remove popups

* update changelog

* fix types for configureOnOpen

* fix eslint

* Update vscode-tas-client. (#3981)

* add telemetry for developer environment use (#3975)

* fix node versions in pipelines

* remove item from yml

* Localization - Translated Strings (#3984)

* Update cmake-presets.md (#3992)

Fixing broken links

* fix regression of kit environment variables (#3991)

* rollbar try catch (#3985)

Co-authored-by: Fatima Qarni <fatimaqarni@microsoft.com>

* switch to variable

* switch to variable

* fix env expansion (#3997)

* In short, with our recent updates, we are attempting to expand every
string in the environment. This isn't a problem in most cases, but it
exposed a bug in certain linux distros that use aliasing (environment
variables).

Therefore, we should be wiser about what we attempt to expand and only
expand the presets environment variables the user has in their files.
To do this, we need to be smarter about what we save in our cache and
update by reference.


* updated the other presets so they dont always have to reexpand configure preset. when they do, use plusIncludes which has the dev env cached if its been expanded before. also include the inherited parent envs

* Fix environment expansion so we don't expand unnecessary variables - don't save the process.env or parent environment to the environment field of the cache.

* Don't re-expand configure presets in the associated build/test/etc presets.

* Fix expansion reporting issues with reporting an invalid config preset, and changing for each loop to a traditional for loop to make sure we dont have async issues with reporting.

* fix validation bug for not being able to find a null config preset

---------

Co-authored-by: Garrett Campbell <gcampbell@microsoft.com>

* update third parties (#4001)

---------

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Co-authored-by: snehara99 <113148726+snehara99@users.noreply.github.com>
Co-authored-by: Andreea Isac <48239328+andreeis@users.noreply.github.com>
Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>
Co-authored-by: Joan Marcè i Igual <jmigual@users.noreply.github.com>
Co-authored-by: CSIGS@microsoft.com <csigs@users.noreply.github.com>
Co-authored-by: vinocher-bc <160914867+vinocher-bc@users.noreply.github.com>
Co-authored-by: Garrett Campbell <gcampbell@microsoft.com>
Co-authored-by: Bob Brown <bobbrow@users.noreply.github.com>
Co-authored-by: Jeremie Allard <jeremie.allard@insimo.fr>
Co-authored-by: hippo91 <guillaume.peillex@gmail.com>
Co-authored-by: LiuZengqiang <74355935+LiuZengqiang@users.noreply.github.com>
Co-authored-by: Cy 'kkm' Katsnelson <kkm@pobox.com>
Co-authored-by: Jonathan Phippen <30632563+jophippe@users.noreply.github.com>
Co-authored-by: moyo1997 <54333118+moyo1997@users.noreply.github.com>
Co-authored-by: Andrew Shark <ashark@linuxcomp.ru>
Co-authored-by: Yonggang Luo <luoyonggang@gmail.com>
Co-authored-by: stepeos <82703776+stepeos@users.noreply.github.com>
Co-authored-by: fargies <fargies@users.noreply.github.com>
Co-authored-by: Sylvain Fargier <sylvain.fargier@cern.ch>
Co-authored-by: Sean McManus <seanmcm@microsoft.com>
Co-authored-by: Sinem Akinci <99284450+sinemakinci1@users.noreply.github.com>
@v-frankwang
Copy link
Collaborator

@i-ky We have attempted to verify this issue on CMake tools: v1.19.45, but we don't have detailed reproduction steps to reproduce it. Are you able to go and verify that the issue is fixed?

qarni added a commit that referenced this issue Aug 28, 2024
* reversed order of creating workspace browse configurations (#3758)

* reversed order of creating workspace browse configurations

* updated tests

* minimized change by only reversing fileGroups, and reverted tests

* Add clarity in the build log when builds are out of source (#3778)

* Add chesscc to the allow-list of compilers. (#3777)

Co-authored-by: snehara99 <113148726+snehara99@users.noreply.github.com>

* Fix doubling of cpack args passed by package preset (#3766)

* Remove unnecessary logging about string expansion (#3761)

* Remove unnecessary logging about string expansion

* Fix typo in var name

---------

Co-authored-by: snehara99 <113148726+snehara99@users.noreply.github.com>

* Fix UI for settings override of package presets (#3770)

* Fix UI for settings override of package presets

* Fix linter errors

* Skip full configure on variant change for multi-config generators (#3763)

* Don't fully configure after variant change for multi-config generators. Only change parameter for build and refresh IntelliSense.

* Added missing return on 'if else'

* Removed unnecessary log. No previous configure message was printed before it.'

* Run clean-configure when workflow has different configure preset than project (#3768)

* Let cmake.configureArgs overwrite the default cmake args (#3762)

Co-authored-by: snehara99 <113148726+snehara99@users.noreply.github.com>

* Handle "~" in binaryDir path (#3764)

* File system APIs don't recognize ~ in paths and because of this the extension cannot properly interpret cmake file-api jsons to list targets.

* Fix path typo

---------

Co-authored-by: snehara99 <113148726+snehara99@users.noreply.github.com>

* Warning when VS installation instance not found (#3775)

* Add warning about not found VS installation instance and suggestion to re-scan kits, at the request of developers in the community.

* Fix linter errors

---------

Co-authored-by: snehara99 <113148726+snehara99@users.noreply.github.com>

* Fix GitHub 3602, mention --build-config even for default test preset (#3779)

* Better validations that validate before running.  (#3774)

* initial commit

* add better values

* check notice and changelog before release version

* Update kits-variants doc with unsupported commands that are specific for presets (#3784)

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* colorization support in pre-release (#3794)

* colorization support in pre-release

* update changelog

* Sort CMakeLists.txt by depth (#3789)

* Sort CMakeLists.txt by depth

* Add changes to CHANGELOG.md

---------

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* Fixed string parameters and added clarification to the log message (#3787)

* Localization - Translated Strings (#3753)

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* fix schema field in v8 schema (#3809)

* Add check that limits when we -R a regex of all tests (#3814)

* fix ctest

* only try to be smart about this in the test explorer entry points

* updating comment

* add try catch in debug createRunProfile

* Localization - Translated Strings (#3816)

* Update CHANGELOG.md

* update localization for project status view and quick pick (#3810)

* fix issue with test results not found (#3823)

* update braces dependency (#3839)

* Fixes #3725 - user presets not read correctly (#3826)

* get all presets to show in inherit

* if new configure preset inherits from a user preset add to the user presets file

* todo: finish update for different types of presets

* checks for configure inherit and inherit. todo - check workflow

* cleanup + mark as isUserPreset

* undo use isuserpreset field

* cleanup and changelog

* cleanup

* rename interface

* update workflow preset to not extend preset + refactor inheritsfromuserpreset func

* remove preset class fields from workflow preset

* more workflow preset cleanup

* Fixes #3811 - checks for cmake.exe again if it wasnt present the previous time  (#3840)

checks for exe again if it wasn't present the previous time

* Tree view for tests using test suite delimiter (#3759)

* Implement treeview for tests using test suite delimiter

* Support regular expressions for delimiters

* Improve UI string

* Improve UI string

* Address CR comments

* Fix spacing

* make sure to pass entry point through

---------

Co-authored-by: Garrett Campbell <gcampbell@microsoft.com>
Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* Update telemetry API to latest version. (#3843)

* presets + cmake.buildToolArgs: make sure `--` is added in all cases (#3755)

* presets + cmake.buildToolArgs: make sure `--` is added in all cases

Fixes #3754.
This issue was introduced in #3537 (cmake.buildToolsArgs was ignored for presets before).

* Update changelog

---------

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* Update CHANGELOG.md

* Fixes #3140 - Test log unavailable (#3752)

* Using \r\n as line ending

Seems like \r\n is the line ending characters in the Test Output even on systems different from win32

* Specify the test item in the call to appendOutput

Doing so allows to have the output of the test to be printed out in the left part of the "TEST RESULTS" pane when clicking on the desired test in the right part of the same pane.
Before this change we get "The test case did not report any output"

* Adds location information in the call to appendOutput.

The test object may have uri and ranges that can help localization

* Adds entry in the CHANGELOG

---------

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* Upgrade cmake_minimum_required version 3.0.0 -> 3.5.0 (#3805)

* Update cmakeProject.ts

Upgrade cmake_minimum_required version 3.0.0 -> 3.5.0

* Update CHANGELOG.md

---------

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* Add setting for deleting whole build dir when clean configuring (#3783)

* Add setting for deleting whole build dir when clean configuring

* Remove unnecessary tag in new setting in package.json

* Add changelog entry. Remove unnecessary | null from new boolean setting.

---------

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* log error for cmake exe not found (#3847)

* Fixed how we use our '--warn-unused-cli' flag (#3860)

* '--warn-unused-cli' is now used to remove the default '--no-warn-unused-cli' command instead of removing and also adding itself to the arguments

* only removed '--warn--unused-cli' instead of all initial_common_flgs

* Set useCMakePresets context after quick start (#3853)

update active proj to set userpreset context

* remove from pre-release (#3861)

* clean configures when platform differs between old and new selected kit (#3859)

* clean configures when only platform changes between kits

* updated changelog

* check toolset too

* changelog

* update changelog

* add rel to branches (#3867)

* update third parties

* fix release pipeline verification

* fix release pipeline

* update release version for prerelease

* fix variable ref

* Localization - Translated Strings (#3833)

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* Use relative intralinks; Point 'issues' to main GH repo (#3858)

* Replace intra-repo absolute URLs with relative ones.
* Replace remaining pointers to `vector-of-bool` with `microsoft`
  in the URLs than must remain absolute.

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* Update Preferred Generator selection logic (#3869)

* Update preferred generator selection logic

* Update changelog

* Fix lint error

* updated command string to better reflect function (#3876)

* Add guard against reloading a file that's not a variants file (#3878)

* Add guard against reloading a file that's not a variants file

* Update CHANGELOG.md

* Update CHANGELOG.md

* Fix debugger hang on restart (#3846)

* telemetry check for trigger, also include trigger and folder in obj for debugger

* update origin telemetry

* add enum for debug origin

* pass in from command info and cleanup

* Update cmakeFileApiDriver.ts take out import

* move to 1.19 changelog

---------

Co-authored-by: Garrett Campbell <gcampbell@microsoft.com>

* update warning to be an error (#3881)

* add try catch and attempt to grab specifically the json (#3868)

* add try catch and attempt to grab specifically the json

* fix lint errors

---------

Co-authored-by: Fatima Qarni <fatimaqarni@microsoft.com>

* show userpresets in project  outline (#3877)

* move user env expansion forkits to after vsenv merged in (#3887)

* move user env expansion forkits to after vsenv merged in

* changelog

* fix for penv and env differentiation

* avoiding stringifying extensionContext (#3880)

* attempt avoiding stringifying extensionContext

* update changelog

* Skip initializing variant manager when using CMakePresets (#3888)

* Fixed spelling in Delete Build Dir On Clean Configure description (#3893)

* Allow CMake to select a default internal generator when the user selects "__unspec__" for the kit (#3889)

* updated to allow no generator when using file api and cmake 3.15.0 or greater

* fixed kit name check

* updated changelog

* throw nogenerator error if kit isn't __unspec__

* Add "Unspecified" Build Type and Use by Default (Kits Only) (#3879)

* add unspecified build type and remove CMAKE_BUILD_TYPE prop when it's used

* reverted commenting out debugger

* let debugger stop on error again

* updated changelog

* updated the docs with the new option

* updated default kit build type

* fix failing tests

---------

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* localize override settings applied (#3896)

* change langext check for cpp (#3897)

* fix debug environment config being overwritten (#3894)

* fix debug environment config being overwritten

* changelog

* localized the additional properties case (#3895)

* show build task if preset is set to activebuildpreset (#3898)

* show build task if preset is set to activebuildpreset

* changelog

* fix our depth search for CMakeLists.txt (#3904)

* if installDir is a relative path, calculate it relative to the source directory (#3903)

* if installDir is a relative path, I calculate it relative to the source dir

* updated location of checking and updating installDir

* combined with expansion check

* add permissions to workflow

* Fix localized file path for schemas (#3906)

* Add setting to control how we use VS Dev Env (#3892)

* committing state, no progress, just thinking through

* fix how we apply and override devenv to ensure we don't accidentally delete preset environment modifications from user

* check if ninja exists and it's the generator, use that to determine if we should add vs devenv as well

* currently broken, but saving state for adding a setting

* this works well, but I need to add back code that prohibits repeated devenv searching with where.exe

* finalize implementation of the setting for useVsDeveloperEnvironment

* minimize branches

* fix import

* update comments

* fix comment

* remove unnecessary comment

* fallback to better architecture/toolset

* update devenv vars and tests

* fix test for mac

* fix tests

* update changelog

* fix test expand and where.exe env

* update test to explicitly test architecture unit test

---------

Co-authored-by: snehara99 <113148726+snehara99@users.noreply.github.com>

* Fix link in configure.md (#3899)

The section is called "General options", not "Generic options".

* Fix typo in configure.md (#3900)

als -> also

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* The kit name for Clang/MSVC too long, put the arch at the front (#3835)

[kit] Found Kit (trusted): Clang 17.0.3 (MSVC CLI) for MSVC 17.10.35004.147 (Visual Studio Community 2022 Release - x86)
[kit] Found Kit (trusted): Clang 17.0.3 (GNU CLI) for MSVC 17.10.35004.147 (Visual Studio Community 2022 Release - x86)
[kit] Found Kit (trusted): Clang 17.0.3 (MSVC CLI) for MSVC 17.10.35004.147 (Visual Studio Community 2022 Release - amd64)
[kit] Found Kit (trusted): Clang 17.0.3 (GNU CLI) for MSVC 17.10.35004.147 (Visual Studio Community 2022 Release - amd64)

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* Update triage-labels.yml

* Update OneLocBuild process (#3912)

* try service connection already there

* use variables

* Delete .github/workflows/closed-fixed-pending-release.yml

* Only visual studio 2015 neesd fixes the windows sdk path (#3837)

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* Dispose of Launch terminal if environment has changed (#3902)

* Compare entire terminal launch environment and dispose if not equal

* Updated CHANGELOG

---------

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* Localization - Translated Strings (#3884)

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* implement  #2521 by adding output channel argument (#3785)

* implement  #2521 by adding output channel argument

* fix failed configuration not showing output channel on "on error"

* implement review, add changelog

* fix changelog

---------

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>
Co-authored-by: Garrett Campbell <gcampbell@microsoft.com>

* doc: cmake.environment is not applied to launch/debug (#3926)

* Don't require Ninja or Make on PATH when checking generators (#3927)

* Preset file expansion on open/save and expansion validation (#3905)

This change changes the way we do preset file expansion. Expansion now occurs upfront on file open or save, and if there are no errors, the expanded presets will be cached so repeated expansion is not necessary every time getAll{type of preset}Presets() is called.

The only time expansion will happen again is on set preset, which will then also apply the VS developer environment as needed. This is avoided on the initial expansion for performance.

If there are errors in expansion, the errors are shown in the problems panel per file. The presets file will also be set to undefined, which will invalidate that file and not allow any presets in that file to be recognized/selected as valid presets. This is in line with the CMake command line experience.

Some notes:

- The ${generator} macro should not work for packagePresets, but should now expand correctly for all other presets and evaluate conditions correctly
- Tertiary preset cache was added (really its just the original presets cache but used in a new way) to account for included json files that wouldnt be in the original presets files

* better match keybindings to what vscode has (#3928)

* better match keybindings to what vscode has

* update changelog

* Revert "Don't require Ninja or Make on PATH when checking generators (#3927)" (#3938)

This reverts commit bbc74d8.

* check for quick start in select configure preset to prevent second configure (#3933)

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* ensure we take deep copy of presets for presetsPlusIncluded (#3939)

* update telemetry key (#3944)

* update telemetry key

* typo

* Fix GitHub 1401, diagnostics relative to workspace folder (#3780)

* Fix GitHub 1401, diagnostics relative to workspace folder

 - relative diagnostics files are searched in build_dir and src_dir,
   first existing file is returned
 - defaults to old behavior : `path.resolve(build_dir, file)`
 - `resolveDiagnostics` has been made async to not slow down IDE when
   testing files

* update ChangeLog for #1401

* fix relative file resolution diagnostics test

 - diagnostics paths always use POSIX separators (see `normalizePath` in
   [src/util.ts](src/util.ts))

---------

Co-authored-by: Sylvain Fargier <sylvain.fargier@cern.ch>
Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* Configure precondition handler to return boolean to signal a successful recovery case (#3776)

* Making configure precondition handler return a boolean helps to differentiate the successful recovery cases

* Fix pre-condition handler prototype errors in tests

* Experiment with prototypes to fix linter errors

* Add setting for building whole build dir when clean configure

* Remove anything related to deleteBuildDirOnCleanConfigure since it's in a different PR. Keep proper promise<bool> prototype for pre-configure handler return and fix appropriately compilation and lint errors in tests.

* Forgot one file to remove deleteBuildDirOnCleanConfigure from

* Remove forgotten comment

* Add changelog entry

* remove changes not needed

* removing more bad changes

* add logic to regenerate the driver after selecting cmakelists

* remove unused imports

* keep sanity check in _beforeConfigureOrBuild

* only ensure we set the variable so that on retry, it works

* switch return

* erroneous update

* fix

---------

Co-authored-by: Garrett Campbell <gcampbell@microsoft.com>
Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* Localization - Translated Strings (#3932)

* Use template for release pipelines (converted from classic) (#3945)

* try to convert release pipeline to yaml

* ensure trigger

* fix variable expansion

* specify name specifically

* add release and fix powershell setup

* fix name

* uncomment vsce task

* only do release pipeline on release branch

* only allow rel branch for release

* enable trigger always, we can rely on manual verification

* evaluate inherit presets based on presets that should be visible from file (#3941)

* initial changes

* modify other preset flows

* fix unused import

* remove unused import

* check for default preset

* acocunt for userpresets

* remove extra condition

---------

Co-authored-by: Garrett Campbell <gcampbell@microsoft.com>

* fix pipelineArtifact reference (#3948)

* fix pipelineArtifact reference

* update variable update

* try corrected destinationPath

* fix destination typo

* switch to targetPath test

* use correct manual validation task

* Update pipeline (#3952)

* fix validation and pipeline, commented out vsce for testing

* fix indentation for job

* uncomment vsce

* Set usepresets context after manually creating presets file (#3935)

Fixes #3854. Support for watching multiple paths (cmakepresets.json/cmakeuserpresets.json/include files) was broken due to a Chokidar bug. Created a wrapper class to handle this scenario.

* Localization - Translated Strings (#3954)

* Ensure we correctly inherit preset from UserPreset (#3958)

* fix

* analyze user presets first because it's the base if it exists

* more updates to fix include files and telemetry, still needs work and testing

* ensure telemetry and other uses of 'all..Presets' is right

* more fixes

* ensure we don't duplicate cmakepresets in userpresets includes

* remove unnecessary return

* unionWith consistency

* add test

* saving progress (#3960)

* only do special handling of ~ in linux, it breaks windows (#3965)

* Remove popups and update defaults for `configureOnOpen` (#3967)

* update defaults and remove popups

* update changelog

* fix types for configureOnOpen

* fix eslint

* Update vscode-tas-client. (#3981)

* add telemetry for developer environment use (#3975)

* fix node versions in pipelines

* remove item from yml

* Localization - Translated Strings (#3984)

* Update cmake-presets.md (#3992)

Fixing broken links

* fix regression of kit environment variables (#3991)

* rollbar try catch (#3985)

Co-authored-by: Fatima Qarni <fatimaqarni@microsoft.com>

* switch to variable

* switch to variable

* fix env expansion (#3997)

* In short, with our recent updates, we are attempting to expand every
string in the environment. This isn't a problem in most cases, but it
exposed a bug in certain linux distros that use aliasing (environment
variables).

Therefore, we should be wiser about what we attempt to expand and only
expand the presets environment variables the user has in their files.
To do this, we need to be smarter about what we save in our cache and
update by reference.


* updated the other presets so they dont always have to reexpand configure preset. when they do, use plusIncludes which has the dev env cached if its been expanded before. also include the inherited parent envs

* Fix environment expansion so we don't expand unnecessary variables - don't save the process.env or parent environment to the environment field of the cache.

* Don't re-expand configure presets in the associated build/test/etc presets.

* Fix expansion reporting issues with reporting an invalid config preset, and changing for each loop to a traditional for loop to make sure we dont have async issues with reporting.

* fix validation bug for not being able to find a null config preset

---------

Co-authored-by: Garrett Campbell <gcampbell@microsoft.com>

* update third parties (#4001)

* return expandedPreset, not preset (#4008)

* return expandedPreset, not preset

* make sure user presets are considered

* Localization - Translated Strings (#4003)

* add change from rel that I didn't do here (#4014)

---------

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Co-authored-by: snehara99 <113148726+snehara99@users.noreply.github.com>
Co-authored-by: Andreea Isac <48239328+andreeis@users.noreply.github.com>
Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>
Co-authored-by: Joan Marcè i Igual <jmigual@users.noreply.github.com>
Co-authored-by: CSIGS@microsoft.com <csigs@users.noreply.github.com>
Co-authored-by: vinocher-bc <160914867+vinocher-bc@users.noreply.github.com>
Co-authored-by: Garrett Campbell <gcampbell@microsoft.com>
Co-authored-by: Bob Brown <bobbrow@users.noreply.github.com>
Co-authored-by: Jeremie Allard <jeremie.allard@insimo.fr>
Co-authored-by: hippo91 <guillaume.peillex@gmail.com>
Co-authored-by: LiuZengqiang <74355935+LiuZengqiang@users.noreply.github.com>
Co-authored-by: Cy 'kkm' Katsnelson <kkm@pobox.com>
Co-authored-by: Jonathan Phippen <30632563+jophippe@users.noreply.github.com>
Co-authored-by: moyo1997 <54333118+moyo1997@users.noreply.github.com>
Co-authored-by: Andrew Shark <ashark@linuxcomp.ru>
Co-authored-by: Yonggang Luo <luoyonggang@gmail.com>
Co-authored-by: stepeos <82703776+stepeos@users.noreply.github.com>
Co-authored-by: fargies <fargies@users.noreply.github.com>
Co-authored-by: Sylvain Fargier <sylvain.fargier@cern.ch>
Co-authored-by: Sean McManus <seanmcm@microsoft.com>
Co-authored-by: Sinem Akinci <99284450+sinemakinci1@users.noreply.github.com>
qarni added a commit that referenced this issue Sep 3, 2024
* reversed order of creating workspace browse configurations (#3758)

* reversed order of creating workspace browse configurations

* updated tests

* minimized change by only reversing fileGroups, and reverted tests

* Add clarity in the build log when builds are out of source (#3778)

* Add chesscc to the allow-list of compilers. (#3777)

Co-authored-by: snehara99 <113148726+snehara99@users.noreply.github.com>

* Fix doubling of cpack args passed by package preset (#3766)

* Remove unnecessary logging about string expansion (#3761)

* Remove unnecessary logging about string expansion

* Fix typo in var name

---------

Co-authored-by: snehara99 <113148726+snehara99@users.noreply.github.com>

* Fix UI for settings override of package presets (#3770)

* Fix UI for settings override of package presets

* Fix linter errors

* Skip full configure on variant change for multi-config generators (#3763)

* Don't fully configure after variant change for multi-config generators. Only change parameter for build and refresh IntelliSense.

* Added missing return on 'if else'

* Removed unnecessary log. No previous configure message was printed before it.'

* Run clean-configure when workflow has different configure preset than project (#3768)

* Let cmake.configureArgs overwrite the default cmake args (#3762)

Co-authored-by: snehara99 <113148726+snehara99@users.noreply.github.com>

* Handle "~" in binaryDir path (#3764)

* File system APIs don't recognize ~ in paths and because of this the extension cannot properly interpret cmake file-api jsons to list targets.

* Fix path typo

---------

Co-authored-by: snehara99 <113148726+snehara99@users.noreply.github.com>

* Warning when VS installation instance not found (#3775)

* Add warning about not found VS installation instance and suggestion to re-scan kits, at the request of developers in the community.

* Fix linter errors

---------

Co-authored-by: snehara99 <113148726+snehara99@users.noreply.github.com>

* Fix GitHub 3602, mention --build-config even for default test preset (#3779)

* Better validations that validate before running.  (#3774)

* initial commit

* add better values

* check notice and changelog before release version

* Update kits-variants doc with unsupported commands that are specific for presets (#3784)

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* colorization support in pre-release (#3794)

* colorization support in pre-release

* update changelog

* Sort CMakeLists.txt by depth (#3789)

* Sort CMakeLists.txt by depth

* Add changes to CHANGELOG.md

---------

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* Fixed string parameters and added clarification to the log message (#3787)

* Localization - Translated Strings (#3753)

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* fix schema field in v8 schema (#3809)

* Add check that limits when we -R a regex of all tests (#3814)

* fix ctest

* only try to be smart about this in the test explorer entry points

* updating comment

* add try catch in debug createRunProfile

* Localization - Translated Strings (#3816)

* Update CHANGELOG.md

* update localization for project status view and quick pick (#3810)

* fix issue with test results not found (#3823)

* update braces dependency (#3839)

* Fixes #3725 - user presets not read correctly (#3826)

* get all presets to show in inherit

* if new configure preset inherits from a user preset add to the user presets file

* todo: finish update for different types of presets

* checks for configure inherit and inherit. todo - check workflow

* cleanup + mark as isUserPreset

* undo use isuserpreset field

* cleanup and changelog

* cleanup

* rename interface

* update workflow preset to not extend preset + refactor inheritsfromuserpreset func

* remove preset class fields from workflow preset

* more workflow preset cleanup

* Fixes #3811 - checks for cmake.exe again if it wasnt present the previous time  (#3840)

checks for exe again if it wasn't present the previous time

* Tree view for tests using test suite delimiter (#3759)

* Implement treeview for tests using test suite delimiter

* Support regular expressions for delimiters

* Improve UI string

* Improve UI string

* Address CR comments

* Fix spacing

* make sure to pass entry point through

---------

Co-authored-by: Garrett Campbell <gcampbell@microsoft.com>
Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* Update telemetry API to latest version. (#3843)

* presets + cmake.buildToolArgs: make sure `--` is added in all cases (#3755)

* presets + cmake.buildToolArgs: make sure `--` is added in all cases

Fixes #3754.
This issue was introduced in #3537 (cmake.buildToolsArgs was ignored for presets before).

* Update changelog

---------

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* Update CHANGELOG.md

* Fixes #3140 - Test log unavailable (#3752)

* Using \r\n as line ending

Seems like \r\n is the line ending characters in the Test Output even on systems different from win32

* Specify the test item in the call to appendOutput

Doing so allows to have the output of the test to be printed out in the left part of the "TEST RESULTS" pane when clicking on the desired test in the right part of the same pane.
Before this change we get "The test case did not report any output"

* Adds location information in the call to appendOutput.

The test object may have uri and ranges that can help localization

* Adds entry in the CHANGELOG

---------

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* Upgrade cmake_minimum_required version 3.0.0 -> 3.5.0 (#3805)

* Update cmakeProject.ts

Upgrade cmake_minimum_required version 3.0.0 -> 3.5.0

* Update CHANGELOG.md

---------

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* Add setting for deleting whole build dir when clean configuring (#3783)

* Add setting for deleting whole build dir when clean configuring

* Remove unnecessary tag in new setting in package.json

* Add changelog entry. Remove unnecessary | null from new boolean setting.

---------

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* log error for cmake exe not found (#3847)

* Fixed how we use our '--warn-unused-cli' flag (#3860)

* '--warn-unused-cli' is now used to remove the default '--no-warn-unused-cli' command instead of removing and also adding itself to the arguments

* only removed '--warn--unused-cli' instead of all initial_common_flgs

* Set useCMakePresets context after quick start (#3853)

update active proj to set userpreset context

* remove from pre-release (#3861)

* clean configures when platform differs between old and new selected kit (#3859)

* clean configures when only platform changes between kits

* updated changelog

* check toolset too

* changelog

* update changelog

* add rel to branches (#3867)

* update third parties

* fix release pipeline verification

* fix release pipeline

* update release version for prerelease

* fix variable ref

* Localization - Translated Strings (#3833)

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* Use relative intralinks; Point 'issues' to main GH repo (#3858)

* Replace intra-repo absolute URLs with relative ones.
* Replace remaining pointers to `vector-of-bool` with `microsoft`
  in the URLs than must remain absolute.

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* Update Preferred Generator selection logic (#3869)

* Update preferred generator selection logic

* Update changelog

* Fix lint error

* updated command string to better reflect function (#3876)

* Add guard against reloading a file that's not a variants file (#3878)

* Add guard against reloading a file that's not a variants file

* Update CHANGELOG.md

* Update CHANGELOG.md

* Fix debugger hang on restart (#3846)

* telemetry check for trigger, also include trigger and folder in obj for debugger

* update origin telemetry

* add enum for debug origin

* pass in from command info and cleanup

* Update cmakeFileApiDriver.ts take out import

* move to 1.19 changelog

---------

Co-authored-by: Garrett Campbell <gcampbell@microsoft.com>

* update warning to be an error (#3881)

* add try catch and attempt to grab specifically the json (#3868)

* add try catch and attempt to grab specifically the json

* fix lint errors

---------

Co-authored-by: Fatima Qarni <fatimaqarni@microsoft.com>

* show userpresets in project  outline (#3877)

* move user env expansion forkits to after vsenv merged in (#3887)

* move user env expansion forkits to after vsenv merged in

* changelog

* fix for penv and env differentiation

* avoiding stringifying extensionContext (#3880)

* attempt avoiding stringifying extensionContext

* update changelog

* Skip initializing variant manager when using CMakePresets (#3888)

* Fixed spelling in Delete Build Dir On Clean Configure description (#3893)

* Allow CMake to select a default internal generator when the user selects "__unspec__" for the kit (#3889)

* updated to allow no generator when using file api and cmake 3.15.0 or greater

* fixed kit name check

* updated changelog

* throw nogenerator error if kit isn't __unspec__

* Add "Unspecified" Build Type and Use by Default (Kits Only) (#3879)

* add unspecified build type and remove CMAKE_BUILD_TYPE prop when it's used

* reverted commenting out debugger

* let debugger stop on error again

* updated changelog

* updated the docs with the new option

* updated default kit build type

* fix failing tests

---------

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* localize override settings applied (#3896)

* change langext check for cpp (#3897)

* fix debug environment config being overwritten (#3894)

* fix debug environment config being overwritten

* changelog

* localized the additional properties case (#3895)

* show build task if preset is set to activebuildpreset (#3898)

* show build task if preset is set to activebuildpreset

* changelog

* fix our depth search for CMakeLists.txt (#3904)

* if installDir is a relative path, calculate it relative to the source directory (#3903)

* if installDir is a relative path, I calculate it relative to the source dir

* updated location of checking and updating installDir

* combined with expansion check

* add permissions to workflow

* Fix localized file path for schemas (#3906)

* Add setting to control how we use VS Dev Env (#3892)

* committing state, no progress, just thinking through

* fix how we apply and override devenv to ensure we don't accidentally delete preset environment modifications from user

* check if ninja exists and it's the generator, use that to determine if we should add vs devenv as well

* currently broken, but saving state for adding a setting

* this works well, but I need to add back code that prohibits repeated devenv searching with where.exe

* finalize implementation of the setting for useVsDeveloperEnvironment

* minimize branches

* fix import

* update comments

* fix comment

* remove unnecessary comment

* fallback to better architecture/toolset

* update devenv vars and tests

* fix test for mac

* fix tests

* update changelog

* fix test expand and where.exe env

* update test to explicitly test architecture unit test

---------

Co-authored-by: snehara99 <113148726+snehara99@users.noreply.github.com>

* Fix link in configure.md (#3899)

The section is called "General options", not "Generic options".

* Fix typo in configure.md (#3900)

als -> also

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* The kit name for Clang/MSVC too long, put the arch at the front (#3835)

[kit] Found Kit (trusted): Clang 17.0.3 (MSVC CLI) for MSVC 17.10.35004.147 (Visual Studio Community 2022 Release - x86)
[kit] Found Kit (trusted): Clang 17.0.3 (GNU CLI) for MSVC 17.10.35004.147 (Visual Studio Community 2022 Release - x86)
[kit] Found Kit (trusted): Clang 17.0.3 (MSVC CLI) for MSVC 17.10.35004.147 (Visual Studio Community 2022 Release - amd64)
[kit] Found Kit (trusted): Clang 17.0.3 (GNU CLI) for MSVC 17.10.35004.147 (Visual Studio Community 2022 Release - amd64)

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* Update triage-labels.yml

* Update OneLocBuild process (#3912)

* try service connection already there

* use variables

* Delete .github/workflows/closed-fixed-pending-release.yml

* Only visual studio 2015 neesd fixes the windows sdk path (#3837)

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* Dispose of Launch terminal if environment has changed (#3902)

* Compare entire terminal launch environment and dispose if not equal

* Updated CHANGELOG

---------

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* Localization - Translated Strings (#3884)

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* implement  #2521 by adding output channel argument (#3785)

* implement  #2521 by adding output channel argument

* fix failed configuration not showing output channel on "on error"

* implement review, add changelog

* fix changelog

---------

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>
Co-authored-by: Garrett Campbell <gcampbell@microsoft.com>

* doc: cmake.environment is not applied to launch/debug (#3926)

* Don't require Ninja or Make on PATH when checking generators (#3927)

* Preset file expansion on open/save and expansion validation (#3905)

This change changes the way we do preset file expansion. Expansion now occurs upfront on file open or save, and if there are no errors, the expanded presets will be cached so repeated expansion is not necessary every time getAll{type of preset}Presets() is called.

The only time expansion will happen again is on set preset, which will then also apply the VS developer environment as needed. This is avoided on the initial expansion for performance.

If there are errors in expansion, the errors are shown in the problems panel per file. The presets file will also be set to undefined, which will invalidate that file and not allow any presets in that file to be recognized/selected as valid presets. This is in line with the CMake command line experience.

Some notes:

- The ${generator} macro should not work for packagePresets, but should now expand correctly for all other presets and evaluate conditions correctly
- Tertiary preset cache was added (really its just the original presets cache but used in a new way) to account for included json files that wouldnt be in the original presets files

* better match keybindings to what vscode has (#3928)

* better match keybindings to what vscode has

* update changelog

* Revert "Don't require Ninja or Make on PATH when checking generators (#3927)" (#3938)

This reverts commit bbc74d8.

* check for quick start in select configure preset to prevent second configure (#3933)

Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* ensure we take deep copy of presets for presetsPlusIncluded (#3939)

* update telemetry key (#3944)

* update telemetry key

* typo

* Fix GitHub 1401, diagnostics relative to workspace folder (#3780)

* Fix GitHub 1401, diagnostics relative to workspace folder

 - relative diagnostics files are searched in build_dir and src_dir,
   first existing file is returned
 - defaults to old behavior : `path.resolve(build_dir, file)`
 - `resolveDiagnostics` has been made async to not slow down IDE when
   testing files

* update ChangeLog for #1401

* fix relative file resolution diagnostics test

 - diagnostics paths always use POSIX separators (see `normalizePath` in
   [src/util.ts](src/util.ts))

---------

Co-authored-by: Sylvain Fargier <sylvain.fargier@cern.ch>
Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* Configure precondition handler to return boolean to signal a successful recovery case (#3776)

* Making configure precondition handler return a boolean helps to differentiate the successful recovery cases

* Fix pre-condition handler prototype errors in tests

* Experiment with prototypes to fix linter errors

* Add setting for building whole build dir when clean configure

* Remove anything related to deleteBuildDirOnCleanConfigure since it's in a different PR. Keep proper promise<bool> prototype for pre-configure handler return and fix appropriately compilation and lint errors in tests.

* Forgot one file to remove deleteBuildDirOnCleanConfigure from

* Remove forgotten comment

* Add changelog entry

* remove changes not needed

* removing more bad changes

* add logic to regenerate the driver after selecting cmakelists

* remove unused imports

* keep sanity check in _beforeConfigureOrBuild

* only ensure we set the variable so that on retry, it works

* switch return

* erroneous update

* fix

---------

Co-authored-by: Garrett Campbell <gcampbell@microsoft.com>
Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>

* Localization - Translated Strings (#3932)

* Use template for release pipelines (converted from classic) (#3945)

* try to convert release pipeline to yaml

* ensure trigger

* fix variable expansion

* specify name specifically

* add release and fix powershell setup

* fix name

* uncomment vsce task

* only do release pipeline on release branch

* only allow rel branch for release

* enable trigger always, we can rely on manual verification

* evaluate inherit presets based on presets that should be visible from file (#3941)

* initial changes

* modify other preset flows

* fix unused import

* remove unused import

* check for default preset

* acocunt for userpresets

* remove extra condition

---------

Co-authored-by: Garrett Campbell <gcampbell@microsoft.com>

* fix pipelineArtifact reference (#3948)

* fix pipelineArtifact reference

* update variable update

* try corrected destinationPath

* fix destination typo

* switch to targetPath test

* use correct manual validation task

* Update pipeline (#3952)

* fix validation and pipeline, commented out vsce for testing

* fix indentation for job

* uncomment vsce

* Set usepresets context after manually creating presets file (#3935)

Fixes #3854. Support for watching multiple paths (cmakepresets.json/cmakeuserpresets.json/include files) was broken due to a Chokidar bug. Created a wrapper class to handle this scenario.

* Localization - Translated Strings (#3954)

* Ensure we correctly inherit preset from UserPreset (#3958)

* fix

* analyze user presets first because it's the base if it exists

* more updates to fix include files and telemetry, still needs work and testing

* ensure telemetry and other uses of 'all..Presets' is right

* more fixes

* ensure we don't duplicate cmakepresets in userpresets includes

* remove unnecessary return

* unionWith consistency

* add test

* saving progress (#3960)

* only do special handling of ~ in linux, it breaks windows (#3965)

* Remove popups and update defaults for `configureOnOpen` (#3967)

* update defaults and remove popups

* update changelog

* fix types for configureOnOpen

* fix eslint

* Update vscode-tas-client. (#3981)

* add telemetry for developer environment use (#3975)

* fix node versions in pipelines

* remove item from yml

* Localization - Translated Strings (#3984)

* Update cmake-presets.md (#3992)

Fixing broken links

* fix regression of kit environment variables (#3991)

* rollbar try catch (#3985)

Co-authored-by: Fatima Qarni <fatimaqarni@microsoft.com>

* switch to variable

* switch to variable

* fix env expansion (#3997)

* In short, with our recent updates, we are attempting to expand every
string in the environment. This isn't a problem in most cases, but it
exposed a bug in certain linux distros that use aliasing (environment
variables).

Therefore, we should be wiser about what we attempt to expand and only
expand the presets environment variables the user has in their files.
To do this, we need to be smarter about what we save in our cache and
update by reference.


* updated the other presets so they dont always have to reexpand configure preset. when they do, use plusIncludes which has the dev env cached if its been expanded before. also include the inherited parent envs

* Fix environment expansion so we don't expand unnecessary variables - don't save the process.env or parent environment to the environment field of the cache.

* Don't re-expand configure presets in the associated build/test/etc presets.

* Fix expansion reporting issues with reporting an invalid config preset, and changing for each loop to a traditional for loop to make sure we dont have async issues with reporting.

* fix validation bug for not being able to find a null config preset

---------

Co-authored-by: Garrett Campbell <gcampbell@microsoft.com>

* update third parties (#4001)

* return expandedPreset, not preset (#4008)

* return expandedPreset, not preset

* make sure user presets are considered

* Localization - Translated Strings (#4003)

* add change from rel that I didn't do here (#4014)

* fix presets expansion (#4024)

* fix presets expansion

* missed a change

* update changelog

* if Win64 is at the end of the generator, use platform x64 (#4025)

* fix generator logic (#4033)

* fix generator logic

* fix logic

* fix logic

* fix use of gen.name

* Correctly store cache and update `binaryDir` (#4028)

* fix binary dir

* fixes the issue, but more testing and possible improvement to come

* set expandedPreset.binaryDir if already set too

* properly update caches, ensure we correctly store cached presets

* remove some unnecessary comments

* fix linter errors

* update envOverride with expandedPreset env

* update the changelog

* update parent environment when never

---------

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Co-authored-by: snehara99 <113148726+snehara99@users.noreply.github.com>
Co-authored-by: Andreea Isac <48239328+andreeis@users.noreply.github.com>
Co-authored-by: Garrett Campbell <86264750+gcampbell-msft@users.noreply.github.com>
Co-authored-by: Joan Marcè i Igual <jmigual@users.noreply.github.com>
Co-authored-by: CSIGS@microsoft.com <csigs@users.noreply.github.com>
Co-authored-by: vinocher-bc <160914867+vinocher-bc@users.noreply.github.com>
Co-authored-by: Garrett Campbell <gcampbell@microsoft.com>
Co-authored-by: Bob Brown <bobbrow@users.noreply.github.com>
Co-authored-by: Jeremie Allard <jeremie.allard@insimo.fr>
Co-authored-by: hippo91 <guillaume.peillex@gmail.com>
Co-authored-by: LiuZengqiang <74355935+LiuZengqiang@users.noreply.github.com>
Co-authored-by: Cy 'kkm' Katsnelson <kkm@pobox.com>
Co-authored-by: Jonathan Phippen <30632563+jophippe@users.noreply.github.com>
Co-authored-by: moyo1997 <54333118+moyo1997@users.noreply.github.com>
Co-authored-by: Andrew Shark <ashark@linuxcomp.ru>
Co-authored-by: Yonggang Luo <luoyonggang@gmail.com>
Co-authored-by: stepeos <82703776+stepeos@users.noreply.github.com>
Co-authored-by: fargies <fargies@users.noreply.github.com>
Co-authored-by: Sylvain Fargier <sylvain.fargier@cern.ch>
Co-authored-by: Sean McManus <seanmcm@microsoft.com>
Co-authored-by: Sinem Akinci <99284450+sinemakinci1@users.noreply.github.com>
@i-ky
Copy link
Contributor Author

i-ky commented Sep 25, 2024

Hi @v-frankwang!

The thing is, I reported this issue while working on a closed source commercial project. That's why there aren't too many details in the description. Since then I have switched a couple of workplaces, so I cannot verify if the fix is working for the original use case. I have reached out to my ex-colleague asking to verify and if I get any feedback I will let you know.

From what I see in #3780 the fix should be OK.

Maybe @fargies, the author of #3780, can provide detailed steps to reproduce?

As a last resort you can write a small script pretending to be a compiler and mock error messages using it.

@v-frankwang
Copy link
Collaborator

@i-ky Thank you very much for your reply, I hope you can update the review if you can verify this.

@gcampbell-msft gcampbell-msft closed this as not planned Won't fix, can't repro, duplicate, stale Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement an enhancement to the product that is either not present or an improvement to an existing feature Feature: build help wanted we currently are not planning work on this and would like help from the open source community stale-exempt to use with close-stale-issues and close-old-issues bot
Projects
Status: Completed
Development

No branches or pull requests

6 participants