Skip to content

Commit

Permalink
Merge pull request #5205 from microsoft/seanmcm/0_27_0_release_merge
Browse files Browse the repository at this point in the history
Seanmcm/0 27 0 release merge
  • Loading branch information
sean-mcmanus authored Mar 26, 2020
2 parents 6c40808 + e8080fc commit c5be0b5
Show file tree
Hide file tree
Showing 7 changed files with 78 additions and 39 deletions.
10 changes: 10 additions & 0 deletions Extension/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# C/C++ for Visual Studio Code Change Log

## Version 0.27.0-insiders5: March 26, 2019
* Fix the configuration UI showing errors when an older version of `cl.exe` is set in the `compilerPath`. [#5151](https://github.com/microsoft/vscode-cpptools/issues/5151)
* Fix tag parsing not working on Windows 7 without SP1. [#5155](https://github.com/microsoft/vscode-cpptools/issues/5155)
* Fix debugger not working until the extension is reinstalled after macOS High Sierra or older is upgraded to a newer OS. [#5171](https://github.com/microsoft/vscode-cpptools/issues/5171)
* Fix the `Open File…` scenario without a workspace showing "Tag Parser initializing" (all symbol operations fail). [#5176](https://github.com/microsoft/vscode-cpptools/issues/5176)
* Fix `updateChannel` being settable per-workspace. [PR #5185](https://github.com/microsoft/vscode-cpptools/pull/5185)
* Fix opened files external to the workspace folder being removed from the database during loading. [#5190](https://github.com/microsoft/vscode-cpptools/issues/5190)
* Fix crash for workspaces with no workspace folders. [#5192](https://github.com/microsoft/vscode-cpptools/issues/5192)
* Fix environment variables used for the RunInTerminal Request. [MIEngine#979](https://github.com/microsoft/MIEngine/issues/979)

## Version 0.27.0-insiders4: March 23, 2019
### Bug Fixes
* Fix `Go to Symbol in Workspace` not applying `search.exclude` settings. [#5099](https://github.com/microsoft/vscode-cpptools/issues/5099)
Expand Down
2 changes: 1 addition & 1 deletion Extension/i18n/jpn/src/platform.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
{
"unknown.os.platform": "不明な OS プラットフォーム",
"missing.plist.productversion": "SystemVersion.plist から ProduceVersion を取得できませんでした",
"missing.darwin.systemversion.file": "{0} で SystemVersion plist が見つかりませんでした。"
"missing.darwin.systemversion.file": "{0} で SystemVersion.plist が見つかりませんでした。"
}
8 changes: 5 additions & 3 deletions Extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@
],
"default": "Default",
"description": "%c_cpp.configuration.updateChannel.description%",
"scope": "window"
"scope": "application"
},
"C_Cpp.experimentalFeatures": {
"type": "string",
Expand Down Expand Up @@ -1717,7 +1717,7 @@
"https-proxy-agent": "^2.2.4",
"jsonc-parser": "^2.1.1",
"minimatch": "^3.0.4",
"minimist": "^1.2.2",
"minimist": "^1.2.5",
"mkdirp": "^0.5.1",
"parse5": "^5.1.0",
"parse5-traverse": "^1.0.3",
Expand Down Expand Up @@ -1745,7 +1745,9 @@
"webpack/acorn": "^6.4.1",
"gulp-sourcemaps/acorn": "^5.7.4",
"eslint/acorn": "^7.1.1",
"gulp-eslint/acorn": "^7.1.1"
"gulp-eslint/acorn": "^7.1.1",
"**/mkdirp/minimist": "^0.2.1",
"yargs-parser": "^13.1.2"
},
"runtimeDependencies": [
{
Expand Down
4 changes: 2 additions & 2 deletions Extension/src/LanguageServer/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,7 @@ export class DefaultClient implements Client {
}

if (!storagePath) {
storagePath = path.join(this.RootPath, "/.vscode");
storagePath = this.RootPath ? path.join(this.RootPath, "/.vscode") : "";
}
if (workspaceFolder && vscode.workspace.workspaceFolders && vscode.workspace.workspaceFolders.length > 1) {
storagePath = path.join(storagePath, util.getUniqueWorkspaceStorageName(workspaceFolder));
Expand Down Expand Up @@ -1072,7 +1072,7 @@ export class DefaultClient implements Client {
let settings: CppSettings[] = [];
let otherSettings: OtherSettings[] = [];

if (vscode.workspace.workspaceFolders) {
if (vscode.workspace.workspaceFolders && vscode.workspace.workspaceFolders.length > 0) {
for (let workspaceFolder of vscode.workspace.workspaceFolders) {
settings.push(new CppSettings(workspaceFolder.uri));
otherSettings.push(new OtherSettings(workspaceFolder.uri));
Expand Down
5 changes: 3 additions & 2 deletions Extension/src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -847,9 +847,9 @@ export function extractCompilerPathAndArgs(inputCompilerPath?: string, inputComp
let additionalArgs: string[] = [];
let isWindows: boolean = os.platform() === 'win32';
if (compilerPath) {
if (compilerPath === "cl.exe") {
if (compilerPath.endsWith("\\cl.exe") || compilerPath.endsWith("/cl.exe") || compilerPath === "cl.exe") {
// Input is only compiler name, this is only for cl.exe
compilerName = compilerPath;
compilerName = path.basename(compilerPath);

} else if (compilerPath.startsWith("\"")) {
// Input has quotes around compiler path
Expand Down Expand Up @@ -881,6 +881,7 @@ export function extractCompilerPathAndArgs(inputCompilerPath?: string, inputComp
additionalArgs = additionalArgs.filter((arg: string) => arg.trim().length !== 0); // Remove empty args.
compilerPath = potentialCompilerPath;
}
compilerName = path.basename(compilerPath);
}
// Get compiler name if there are no args but path is valid or a valid path was found with args.
if (compilerPath === "cl.exe" || checkFileExistsSync(compilerPath)) {
Expand Down
57 changes: 45 additions & 12 deletions Extension/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import * as Telemetry from './telemetry';
import * as util from './common';
import * as vscode from 'vscode';
import * as nls from 'vscode-nls';
import { PersistentState } from './LanguageServer/persistentState';

import { CppToolsApi, CppToolsExtension } from 'vscode-cpptools';
import { getTemporaryCommandRegistrarInstance, initializeTemporaryCommandRegistrar } from './commands';
Expand Down Expand Up @@ -69,17 +70,44 @@ export function deactivate(): Thenable<void> {
async function processRuntimeDependencies(): Promise<void> {
const installLockExists: boolean = await util.checkInstallLockFile();

if (installLockExists) {
setInstallationStage('getPlatformInfo');
const info: PlatformInformation = await PlatformInformation.GetPlatformInformation();

let forceOnlineInstall: boolean = false;
if (info.platform === "darwin" && info.version) {
const darwinVersion: PersistentState<string | undefined> = new PersistentState("Cpp.darwinVersion", info.version);

// macOS version has changed
if (darwinVersion.Value !== info.version) {
const highSierraOrLowerRegex: RegExp = new RegExp('10\\.(1[0-3]|[0-9])(\\..*)*$');
const lldbMiFolderPath: string = util.getExtensionFilePath('./debugAdapters/lldb-mi');

// For macOS and if a user has upgraded their OS, check to see if we are on Mojave or later
// and that the debugAdapters/lldb-mi folder exists. This will force a online install to get the correct binaries.
if (!highSierraOrLowerRegex.test(info.version) &&
!fs.existsSync(lldbMiFolderPath)) {

forceOnlineInstall = true;

setInstallationStage('cleanUpUnusedBinaries');
await cleanUpUnusedBinaries(info);
}
}
}

const doOfflineInstall: boolean = installLockExists && !forceOnlineInstall;

if (doOfflineInstall) {
// Offline Scenario: Lock file exists but package.json has not had its activationEvents rewritten.
if (util.packageJson.activationEvents && util.packageJson.activationEvents.length === 1) {
try {
await offlineInstallation();
await offlineInstallation(info);
} catch (error) {
getOutputChannelLogger().showErrorMessage(localize('initialization.failed', 'The installation of the C/C++ extension failed. Please see the output window for more information.'));
showOutputChannel();

// Send the failure telemetry since postInstall will not be called.
sendTelemetry(await PlatformInformation.GetPlatformInformation());
sendTelemetry(info);
}
} else {
// The extension has been installed and activated before.
Expand All @@ -88,20 +116,21 @@ async function processRuntimeDependencies(): Promise<void> {
} else {
// No lock file, need to download and install dependencies.
try {
await onlineInstallation();
await onlineInstallation(info);
} catch (error) {
handleError(error);

// Send the failure telemetry since postInstall will not be called.
sendTelemetry(await PlatformInformation.GetPlatformInformation());
sendTelemetry(info);
}
}
}

async function offlineInstallation(): Promise<void> {
setInstallationStage('getPlatformInfo');
async function offlineInstallation(info: PlatformInformation): Promise<void> {
setInstallationType(InstallationType.Offline);
const info: PlatformInformation = await PlatformInformation.GetPlatformInformation();

setInstallationStage('cleanUpUnusedBinaries');
await cleanUpUnusedBinaries(info);

setInstallationStage('cleanUpUnusedBinaries');
await cleanUpUnusedBinaries(info);
Expand All @@ -122,10 +151,8 @@ async function offlineInstallation(): Promise<void> {
await postInstall(info);
}

async function onlineInstallation(): Promise<void> {
setInstallationStage('getPlatformInfo');
async function onlineInstallation(info: PlatformInformation): Promise<void> {
setInstallationType(InstallationType.Online);
const info: PlatformInformation = await PlatformInformation.GetPlatformInformation();

await downloadAndInstallPackages(info);

Expand Down Expand Up @@ -177,6 +204,12 @@ function packageMatchesPlatform(pkg: IPackage, info: PlatformInformation): boole
VersionsMatch(pkg, info);
}

function invalidPackageVersion(pkg: IPackage, info: PlatformInformation): boolean {
return PlatformsMatch(pkg, info) &&
(pkg.architectures === undefined || ArchitecturesMatch(pkg, info)) &&
!VersionsMatch(pkg, info);
}

function makeOfflineBinariesExecutable(info: PlatformInformation): Promise<void> {
let promises: Thenable<void>[] = [];
let packages: IPackage[] = util.packageJson["runtimeDependencies"];
Expand All @@ -196,7 +229,7 @@ function cleanUpUnusedBinaries(info: PlatformInformation): Promise<void> {

packages.forEach(p => {
if (p.binaries && p.binaries.length > 0 &&
!packageMatchesPlatform(p, info)) {
invalidPackageVersion(p, info)) {
p.binaries.forEach(binary => {
const path: string = util.getExtensionFilePath(binary);
if (fs.existsSync(path)) {
Expand Down
31 changes: 12 additions & 19 deletions Extension/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3678,15 +3678,15 @@ [email protected], minimatch@^3.0.4:
dependencies:
brace-expansion "^1.1.7"

[email protected]:
version "0.0.8"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"
integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=
[email protected], minimist@^0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.2.1.tgz#827ba4e7593464e7c221e8c5bed930904ee2c455"
integrity sha512-GY8fANSrTMfBVfInqJAY41QkOM+upUTytK1jZ0c8+3HdHrJxBJ3rF5i9moClXTE8uUSnUo8cAsCoxDXvSY4DHg==

minimist@^1.2.0, minimist@^1.2.2:
version "1.2.2"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.2.tgz#b00a00230a1108c48c169e69a291aafda3aacd63"
integrity sha512-rIqbOrKb8GJmx/5bc2M0QchhUouMXSpd1RTclXsB41JdL+VtnojfaJR+h7F9k18/4kHUsBFgk80Uk+q569vjPA==
minimist@^1.2.0, minimist@^1.2.5:
version "1.2.5"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==

mississippi@^3.0.0:
version "3.0.0"
Expand Down Expand Up @@ -6136,21 +6136,14 @@ yallist@^3.0.2:
resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd"
integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==

[email protected], yargs-parser@^13.1.0, yargs-parser@^13.1.1:
version "13.1.1"
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.1.tgz#d26058532aa06d365fe091f6a1fc06b2f7e5eca0"
integrity sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==
[email protected], yargs-parser@^13.1.0, yargs-parser@^13.1.1, yargs-parser@^13.1.2, yargs-parser@^5.0.0:
version "13.1.2"
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.2.tgz#130f09702ebaeef2650d54ce6e3e5706f7a4fb38"
integrity sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==
dependencies:
camelcase "^5.0.0"
decamelize "^1.2.0"

yargs-parser@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-5.0.0.tgz#275ecf0d7ffe05c77e64e7c86e4cd94bf0e1228a"
integrity sha1-J17PDX/+Bcd+ZOfIbkzZS/DhIoo=
dependencies:
camelcase "^3.0.0"

[email protected]:
version "1.6.0"
resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-1.6.0.tgz#ef25c2c769ff6bd09e4b0f9d7c605fb27846ea9f"
Expand Down

0 comments on commit c5be0b5

Please sign in to comment.