Skip to content

Commit 73653f8

Browse files
authored
Fixes for Windows ARM64 (#6337)
* Fixes for Windows ARM64 * Update node types version.
1 parent 12feb81 commit 73653f8

File tree

8 files changed

+48
-8
lines changed

8 files changed

+48
-8
lines changed

Extension/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ The extension has platform-specific binary dependencies, therefore installation
5656
`cpptools-linux-aarch64.vsix` | Linux ARM 64-bit
5757
`cpptools-osx.vsix` | macOS
5858
`cpptools-win32.vsix` | Windows 64-bit & 32-bit
59+
`cpptools-win-arm64.vsix` | Windows ARM64
5960
`cpptools-linux32.vsix` | Linux 32-bit ([available up to version 0.27.0](https://github.com/microsoft/vscode-cpptools/issues/5346))
6061

6162
## Contribution

Extension/package.json

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2273,7 +2273,7 @@
22732273
"@types/minimatch": "^3.0.3",
22742274
"@types/mkdirp": "^0.5.2",
22752275
"@types/mocha": "^5.2.7",
2276-
"@types/node": "^12.7.2",
2276+
"@types/node": "^14.14.0",
22772277
"@types/plist": "^3.0.2",
22782278
"@types/semver": "^7.1.0",
22792279
"@types/tmp": "^0.1.0",
@@ -2405,6 +2405,27 @@
24052405
"platforms": [
24062406
"win32"
24072407
],
2408+
"architectures": [
2409+
"x86_64",
2410+
"x86",
2411+
"i686",
2412+
"i386"
2413+
],
2414+
"binaries": [
2415+
"./bin/cpptools.exe",
2416+
"./bin/cpptools-srv.exe"
2417+
],
2418+
"integrity": "BA67FC5F787552BE73F6613E08D1374FE3E3C3501417CF03E1D871A46DE4224A"
2419+
},
2420+
{
2421+
"description": "C/C++ language components (Windows ARM64)",
2422+
"url": "https://go.microsoft.com/fwlink/?linkid=2144139",
2423+
"platforms": [
2424+
"win32"
2425+
],
2426+
"architectures": [
2427+
"arm64"
2428+
],
24082429
"binaries": [
24092430
"./bin/cpptools.exe",
24102431
"./bin/cpptools-srv.exe"
@@ -2573,6 +2594,12 @@
25732594
"platforms": [
25742595
"win32"
25752596
],
2597+
"architectures": [
2598+
"x86_64",
2599+
"x86",
2600+
"i686",
2601+
"i386"
2602+
],
25762603
"binaries": [
25772604
"./debugAdapters/vsdbg/bin/vsdbg.exe"
25782605
],

Extension/src/common.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,7 @@ export function readFileText(filePath: string, encoding: string = "utf8"): Promi
581581
}
582582

583583
/** Writes content to a text file */
584-
export function writeFileText(filePath: string, content: string, encoding: string = "utf8"): Promise<void> {
584+
export function writeFileText(filePath: string, content: string, encoding: BufferEncoding = "utf8"): Promise<void> {
585585
const folders: string[] = filePath.split(path.sep).slice(0, -1);
586586
if (folders.length) {
587587
// create folder path if it doesn't exist

Extension/src/githubAPI.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,15 @@ function getArrayOfBuilds(input: any): Build[] {
114114
export function vsixNameForPlatform(info: PlatformInformation): string {
115115
const vsixName: string | undefined = function(platformInfo): string | undefined {
116116
switch (platformInfo.platform) {
117-
case 'win32': return 'cpptools-win32.vsix';
117+
case 'win32':
118+
switch (platformInfo.architecture) {
119+
case 'x86_64': return 'cpptool-win32.vsix'; // TODO: Change to cpptools-win64?
120+
case 'x86':
121+
case 'i386':
122+
case 'i686': return 'cpptools-win32.vsix';
123+
case 'arm64': return 'cpptools-win-arm64.vsix';
124+
default: throw new Error(`Unexpected Windows architecture: ${platformInfo.architecture}`);
125+
}
118126
case 'darwin': return 'cpptools-osx.vsix';
119127
default: {
120128
switch (platformInfo.architecture) {

Extension/src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const disposables: vscode.Disposable[] = [];
3535

3636
export async function activate(context: vscode.ExtensionContext): Promise<CppToolsApi & CppToolsExtension> {
3737
let errMsg: string = "";
38-
if (process.arch !== 'x64' && (process.platform !== 'win32' || process.arch !== 'ia32') && (process.platform !== 'linux' || (process.arch !== 'x64' && process.arch !== 'arm' && process.arch !== 'arm64' && process.arch !== 'aarch64'))) {
38+
if (process.arch !== 'x64' && (process.platform !== 'win32' || (process.arch !== 'ia32' && process.arch !== 'arm64')) && (process.platform !== 'linux' || (process.arch !== 'x64' && process.arch !== 'arm' && process.arch !== 'arm64' && process.arch !== 'aarch64'))) {
3939
errMsg = localize("architecture.not.supported", "Architecture {0} is not supported. ", String(process.arch));
4040
} else if (process.platform === 'linux' && fs.existsSync('/etc/alpine-release')) {
4141
errMsg = localize("apline.containers.not.supported", "Alpine containers are not supported.");

Extension/src/platform.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ export class PlatformInformation {
6969

7070
// Note: This string can be localized. So, we'll just check to see if it contains 32 or 64.
7171
if (arch.indexOf('64') >= 0) {
72+
if (arch.indexOf('ARM') >= 0) {
73+
return "arm64";
74+
}
7275
return "x86_64";
7376
} else if (arch.indexOf('32') >= 0) {
7477
return "x86";

Extension/yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,10 @@
162162
resolved "https://registry.yarnpkg.com/@types/node/-/node-13.7.4.tgz#76c3cb3a12909510f52e5dc04a6298cdf9504ffd"
163163
integrity sha512-oVeL12C6gQS/GAExndigSaLxTrKpQPxewx9bOcwfvJiJge4rr7wNaph4J+ns5hrmIV2as5qxqN8YKthn9qh0jw==
164164

165-
"@types/node@^12.7.2":
166-
version "12.12.28"
167-
resolved "https://registry.yarnpkg.com/@types/node/-/node-12.12.28.tgz#3a2b5f8d21f96ace690a8832ae9779114612575f"
168-
integrity sha512-g73GJYJDXgf0jqg+P9S8h2acWbDXNkoCX8DLtJVu7Fkn788pzQ/oJsrdJz/2JejRf/SjfZaAhsw+3nd1D5EWGg==
165+
"@types/node@^14.14.0":
166+
version "14.14.0"
167+
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.0.tgz#f1091b6ad5de18e8e91bdbd43ec63f13de372538"
168+
integrity sha512-BfbIHP9IapdupGhq/hc+jT5dyiBVZ2DdeC5WwJWQWDb0GijQlzUFAeIQn/2GtvZcd2HVUU7An8felIICFTC2qg==
169169

170170
"@types/plist@^3.0.2":
171171
version "3.0.2"

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ The extension has platform-specific binary dependencies, therefore installation
5656
`cpptools-linux-aarch64.vsix` | Linux ARM 64-bit
5757
`cpptools-osx.vsix` | macOS
5858
`cpptools-win32.vsix` | Windows 64-bit & 32-bit
59+
`cpptools-win-arm64.visix` | Windows ARM64
5960
`cpptools-linux32.vsix` | Linux 32-bit ([available up to version 0.27.0](https://github.com/microsoft/vscode-cpptools/issues/5346))
6061

6162
## Contribution

0 commit comments

Comments
 (0)