From 76509d6a0c79d2a3c64b1220b8dae22e5c9f3821 Mon Sep 17 00:00:00 2001 From: Bob Brown Date: Wed, 27 Mar 2024 14:07:28 -0700 Subject: [PATCH 1/6] Component Governance pipeline for vscode-cpptools (#12148) --- Build/cg/cg.yml | 106 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 Build/cg/cg.yml diff --git a/Build/cg/cg.yml b/Build/cg/cg.yml new file mode 100644 index 0000000000..eacefa99ce --- /dev/null +++ b/Build/cg/cg.yml @@ -0,0 +1,106 @@ +name: $(date:yyyyMMdd)$(rev:.r) +trigger: + branches: + include: + - main + - release + +schedules: +- cron: 30 5 * * 0 + branches: + include: + - main + always: true + +resources: + repositories: + - repository: MicroBuildTemplate + type: git + name: 1ESPipelineTemplates/MicroBuildTemplate + ref: refs/tags/release + +extends: + template: azure-pipelines/MicroBuild.1ES.Official.yml@MicroBuildTemplate + parameters: + pool: + name: AzurePipelines-EO + image: AzurePipelinesWindows2022compliantGPT + os: windows + sdl: + sourceAnalysisPool: + name: AzurePipelines-EO + image: AzurePipelinesWindows2022compliantGPT + os: windows + tsa: + enabled: true + tsaVersion: TsaV2 + codebase: NewOrUpdate + codebaseName: vscode-cpptools + tsaStamp: $(TsaProjectName) + tsaEnvironment: PROD + notificationAlias: $(TsaNotificationAlias) + codebaseAdmins: $(TsaCodebaseAdmins) + instanceUrl: $(TsaInstanceUrl) + projectName: $(TsaProjectName) + areaPath: $(TsaAreaPath) + iterationPath: $(TsaIterationPath) + alltools: true + repositoryName: vscode-cpptools + + stages: + - stage: build + jobs: + - job: Phase_1 + displayName: Build cpptools.vsix + timeoutInMinutes: 60 + cancelTimeoutInMinutes: 1 + templateContext: + outputs: + - output: pipelineArtifact + displayName: 'cpptools.vsix' + condition: succeeded() + targetPath: $(Build.ArtifactStagingDirectory)\Extension + artifactName: cpptools.vsix + + steps: + - checkout: self + + - task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@3 + displayName: Use Yarn 1.x + + - task: UseNode@1 + displayName: Use Node 16.x + inputs: + version: 16.x + + - task: CmdLine@2 + displayName: Delete .npmrc if it exists + inputs: + script: IF EXIST %SYSTEMDRIVE%\Users\%USERNAME%\.npmrc del %SYSTEMDRIVE%\Users\%USERNAME%\.npmrc + + - task: Npm@0 + name: NpmInstall_2 + displayName: Install vsce + inputs: + arguments: --global @vscode/vsce + + - task: CmdLine@1 + name: ProcessRunner_11 + displayName: Create Extension Staging Directory + inputs: + filename: mkdir + arguments: $(Build.ArtifactStagingDirectory)\Extension + + - task: CmdLine@1 + name: ProcessRunner_12 + displayName: Run VSCE to package vsix + inputs: + filename: vsce + arguments: package --yarn -o $(Build.ArtifactStagingDirectory)\Extension\cpptools.vsix + workingFolder: $(Build.SourcesDirectory)\Extension + + - task: Npm@0 + displayName: Uninstall vsce + inputs: + command: uninstall + arguments: --global @vscode/vsce \ No newline at end of file From f3cbf1237d44a92e626ed9e3048fe3fd609356e9 Mon Sep 17 00:00:00 2001 From: Bob Brown Date: Wed, 27 Mar 2024 17:32:41 -0700 Subject: [PATCH 2/6] clean up the pipeline runs (#12151) --- Build/cg/cg.yml | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/Build/cg/cg.yml b/Build/cg/cg.yml index eacefa99ce..b9e53efbd6 100644 --- a/Build/cg/cg.yml +++ b/Build/cg/cg.yml @@ -32,20 +32,9 @@ extends: image: AzurePipelinesWindows2022compliantGPT os: windows tsa: - enabled: true - tsaVersion: TsaV2 - codebase: NewOrUpdate - codebaseName: vscode-cpptools - tsaStamp: $(TsaProjectName) - tsaEnvironment: PROD - notificationAlias: $(TsaNotificationAlias) - codebaseAdmins: $(TsaCodebaseAdmins) - instanceUrl: $(TsaInstanceUrl) - projectName: $(TsaProjectName) - areaPath: $(TsaAreaPath) - iterationPath: $(TsaIterationPath) - alltools: true - repositoryName: vscode-cpptools + enabled: false + featureFlags: + autoBaseline: false stages: - stage: build From d2bd18acf1511907a291320c82732b25db03acd5 Mon Sep 17 00:00:00 2001 From: Bob Brown Date: Mon, 1 Apr 2024 14:04:46 -0700 Subject: [PATCH 3/6] don't strip underscores when demangling (#12159) --- Extension/src/LanguageServer/extension.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Extension/src/LanguageServer/extension.ts b/Extension/src/LanguageServer/extension.ts index 0e00635728..f46f25cf5d 100644 --- a/Extension/src/LanguageServer/extension.ts +++ b/Extension/src/LanguageServer/extension.ts @@ -144,7 +144,6 @@ function sendActivationTelemetry(): void { * activate: set up the extension for language services */ export async function activate(): Promise { - sendActivationTelemetry(); const checkForConflictingExtensions: PersistentState = new PersistentState("CPP." + util.packageJson.version + ".checkForConflictingExtensions", true); if (checkForConflictingExtensions.Value) { @@ -1156,7 +1155,10 @@ async function handleCrashFileRead(crashDirectory: string, crashFile: string, er const startPos2: number = startPos + 1; let funcStr: string = line.substring(startPos2, offsetPos); if (filtPath) { - const ret: util.ProcessReturnType | undefined = await util.spawnChildProcess(filtPath, [funcStr], undefined, true).catch(logAndReturn.undefined); + let ret: util.ProcessReturnType | undefined = await util.spawnChildProcess(filtPath, ["--no-strip-underscore", funcStr], undefined, true).catch(logAndReturn.undefined); + if (ret?.output === funcStr) { + ret = await util.spawnChildProcess(filtPath, [funcStr], undefined, true).catch(logAndReturn.undefined); + } if (ret !== undefined) { funcStr = ret.output; funcStr = funcStr.replace(/std::(?:__1|__cxx11)/g, "std"); // simplify std namespaces. From 92a049479608f02f284e6c2c7e37be196dccd1ab Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Mon, 8 Apr 2024 16:13:36 -0700 Subject: [PATCH 4/6] Update for libexecinfo crash handler change. (#12158) * Update for libexecinfo crash handler change. * Update ThirdPartyNotices.txt --- Extension/ThirdPartyNotices.txt | 37 +++++++++++++++++++++-- Extension/src/LanguageServer/client.ts | 4 +-- Extension/src/LanguageServer/extension.ts | 14 ++++----- Extension/src/main.ts | 2 ++ 4 files changed, 46 insertions(+), 11 deletions(-) diff --git a/Extension/ThirdPartyNotices.txt b/Extension/ThirdPartyNotices.txt index c12b458cbb..eda8e401a8 100644 --- a/Extension/ThirdPartyNotices.txt +++ b/Extension/ThirdPartyNotices.txt @@ -1793,7 +1793,7 @@ THE SOFTWARE. --------------------------------------------------------- -follow-redirects 1.15.5 - MIT +follow-redirects 1.15.6 - MIT https://github.com/follow-redirects/follow-redirects Copyright 2014-present Olivier Lalonde , James Talmage , Ruben Verborgh @@ -3003,9 +3003,10 @@ The notices below are from non-npm sources. - ANTLR (http://www.antlr2.org/) - C++11 Sublime Text Snippets (https://github.com/Rapptz/cpp-sublime-snippet) - Clang (https://clang.llvm.org/) -- gcc-9/libgcc (https://packages.ubuntu.com/focal/gcc-9-base) +- gcc-11/libgcc (https://packages.ubuntu.com/jammy/gcc-11-base) - Guidelines Support Library (https://github.com/Microsoft/GSL) - libc++ (https://libcxx.llvm.org/index.html) +- libexecinfo (https://github.com/ronchaine/libexecinfo) - libuv (https://github.com/libuv/libuv) - LLDB (https://lldb.llvm.org/) - LLVM (http://llvm.org/) @@ -3850,6 +3851,38 @@ obstacle to adoption, that text has been removed. ========================================= END OF musl NOTICES AND INFORMATION +%% libexecinfo NOTICES AND INFORMATION BEGIN HERE +========================================= +libexecinfo is licensed for use as follows: + +==== +Copyright (c) 2003 Maxim Sobolev +All rights reserved. + * +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * +THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + +========================================= +END OF libexecinfo NOTICES AND INFORMATION + %% libuv NOTICES AND INFORMATION BEGIN HERE ========================================= libuv is licensed for use as follows: diff --git a/Extension/src/LanguageServer/client.ts b/Extension/src/LanguageServer/client.ts index e379855e71..a53f918a1e 100644 --- a/Extension/src/LanguageServer/client.ts +++ b/Extension/src/LanguageServer/client.ts @@ -1489,8 +1489,8 @@ export class DefaultClient implements Client { } const serverName: string = this.getName(this.rootFolder); const serverOptions: ServerOptions = { - run: { command: serverModule, options: { detached: false } }, - debug: { command: serverModule, args: [serverName], options: { detached: true } } + run: { command: serverModule, options: { detached: false, cwd: util.getExtensionFilePath("bin") } }, + debug: { command: serverModule, args: [serverName], options: { detached: true, cwd: util.getExtensionFilePath("bin") } } }; // The IntelliSense process should automatically detect when AutoPCH is diff --git a/Extension/src/LanguageServer/extension.ts b/Extension/src/LanguageServer/extension.ts index f46f25cf5d..1bf4065353 100644 --- a/Extension/src/LanguageServer/extension.ts +++ b/Extension/src/LanguageServer/extension.ts @@ -959,7 +959,7 @@ function reportMacCrashes(): void { } export function watchForCrashes(crashDirectory: string): void { - if (process.platform !== "win32") { + if (process.platform !== "win32" && (process.platform === "darwin" || os.arch() === "x64")) { prevCrashFile = ""; fs.stat(crashDirectory, (err) => { const crashObject: Record = {}; @@ -1124,9 +1124,9 @@ async function handleCrashFileRead(crashDirectory: string, crashFile: string, er data = crashFile + "\n"; const filtPath: string | null = which.sync("c++filt", { nothrow: true }); const isMac: boolean = process.platform === "darwin"; - const startStr: string = isMac ? " _" : "("; - const offsetStr: string = isMac ? " + " : "+0x"; - const endOffsetStr: string = isMac ? " " : ")"; + const startStr: string = isMac ? " _" : "<"; + const offsetStr: string = isMac ? " + " : "+"; + const endOffsetStr: string = isMac ? " " : " <"; const dotStr: string = "…"; data += lines[0]; // signal type for (let lineNum: number = 2; lineNum < lines.length - 3; ++lineNum) { // skip first/last lines @@ -1136,7 +1136,7 @@ async function handleCrashFileRead(crashDirectory: string, crashFile: string, er } const line: string = lines[lineNum]; const startPos: number = line.indexOf(startStr); - if (startPos === -1 || line[startPos + 1] === "+") { + if (startPos === -1 || line[startPos + (isMac ? 1 : 4)] === "+") { data += dotStr; const startAddressPos: number = line.indexOf("0x"); const endAddressPos: number = line.indexOf(endOffsetStr, startAddressPos + 2); @@ -1181,9 +1181,9 @@ async function handleCrashFileRead(crashDirectory: string, crashFile: string, er } addressData += `${line.substring(startAddressPos, startPos)}`; } else { - const endPos: number = line.indexOf(")", offsetPos2); + const endPos: number = line.indexOf(">", offsetPos2); if (endPos === -1) { - data += ""; + data += " >"; continue; // unexpected } data += line.substring(offsetPos2, endPos); diff --git a/Extension/src/main.ts b/Extension/src/main.ts index a99437aa04..37106aab49 100644 --- a/Extension/src/main.ts +++ b/Extension/src/main.ts @@ -188,6 +188,8 @@ async function makeBinariesExecutable(): Promise { ]; oldMacBinaries.forEach(binary => promises.push(util.allowExecution(util.getExtensionFilePath(binary)))); } + } else if (os.arch() === "x64") { + promises.push(util.allowExecution(util.getExtensionFilePath("./bin/libc.so"))); } } await Promise.all(promises); From 35cda7ebb012376be64d208443411e87531daada Mon Sep 17 00:00:00 2001 From: Sean McManus Date: Tue, 9 Apr 2024 13:09:25 -0700 Subject: [PATCH 5/6] Update changelog for 1.20.1 (#12182) * Update changelog for 1.20.1 --- Extension/CHANGELOG.md | 6 ++++++ Extension/package.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Extension/CHANGELOG.md b/Extension/CHANGELOG.md index dd7f0dbc4c..b6aa2c328b 100644 --- a/Extension/CHANGELOG.md +++ b/Extension/CHANGELOG.md @@ -1,5 +1,11 @@ # C/C++ for Visual Studio Code Changelog +## Version 1.20.1: April 9, 2024 +### Bug Fixes +* Fix 'Add #include' code actions for code scoped by a namespace or class. [#11541](https://github.com/microsoft/vscode-cpptools/issues/11541) +* Fix the IntelliSense server not starting when a completion, signature help, or document highlight occurs from external commands. [#12143](https://github.com/microsoft/vscode-cpptools/issues/12143) +* Fix the IntelliSense configuration not falling back to the `c_cpp_properties.json` configuration for a file not handled by a configuration provider. [#12144](https://github.com/microsoft/vscode-cpptools/issues/12144) + ## Version 1.20.0: March 26, 2024 ### Enhancements * Add support for C++ modules IFC version 0.43. [#10843](https://github.com/microsoft/vscode-cpptools/issues/10843) diff --git a/Extension/package.json b/Extension/package.json index e793fdf9be..f15688f437 100644 --- a/Extension/package.json +++ b/Extension/package.json @@ -2,7 +2,7 @@ "name": "cpptools", "displayName": "C/C++", "description": "C/C++ IntelliSense, debugging, and code browsing.", - "version": "1.20.0-main", + "version": "1.20.1-main", "publisher": "ms-vscode", "icon": "LanguageCCPP_color_128x.png", "readme": "README.md", From 4650cfeeb91bc75e761f4a1434f6f98339f98378 Mon Sep 17 00:00:00 2001 From: Bob Brown Date: Tue, 9 Apr 2024 14:43:42 -0700 Subject: [PATCH 6/6] Update CHANGELOG.md (#12186) --- Extension/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Extension/CHANGELOG.md b/Extension/CHANGELOG.md index b6aa2c328b..48c2bf5c2e 100644 --- a/Extension/CHANGELOG.md +++ b/Extension/CHANGELOG.md @@ -11,7 +11,7 @@ * Add support for C++ modules IFC version 0.43. [#10843](https://github.com/microsoft/vscode-cpptools/issues/10843) * Add support for `${userHome}` in `c_cpp_properties.json`. [#11756](https://github.com/microsoft/vscode-cpptools/issues/11756) * Reduce the default max workspace symbol search results and add `C_Cpp.maxSymbolSearchResults`. [PR #12131](https://github.com/microsoft/vscode-cpptools/pull/12131) -* Update to `clang-format`/`clang-tidy` 18.1.2. [PR #12135](https://github.com/microsoft/vscode-cpptools/pull/12135) +* Update `clang-format`/`clang-tidy` to 18.1.2. [PR #12135](https://github.com/microsoft/vscode-cpptools/pull/12135) * Update IntelliSense engine. ### Bug Fixes