From 9d8d1e6bf7ce1d202527c83e96b7dba53ee07117 Mon Sep 17 00:00:00 2001 From: "Brandon Waterloo [MSFT]" <36966225+bwateratmsft@users.noreply.github.com> Date: Thu, 6 Jun 2024 13:26:50 -0400 Subject: [PATCH] Fetch arm64 debugger anytime on an arm64 OS --- src/debugging/netcore/NetCoreDebugHelper.ts | 15 ++------------- src/utils/osUtils.ts | 4 ++-- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/src/debugging/netcore/NetCoreDebugHelper.ts b/src/debugging/netcore/NetCoreDebugHelper.ts index d06456f7f9..3b37f51f49 100644 --- a/src/debugging/netcore/NetCoreDebugHelper.ts +++ b/src/debugging/netcore/NetCoreDebugHelper.ts @@ -12,7 +12,7 @@ import { ext } from '../../extensionVariables'; import { NetCoreTaskHelper, NetCoreTaskOptions } from '../../tasks/netcore/NetCoreTaskHelper'; import { ContainerTreeItem } from '../../tree/containers/ContainerTreeItem'; import { getNetCoreProjectInfo } from '../../utils/netCoreUtils'; -import { getDockerOSType, isArm64Mac } from '../../utils/osUtils'; +import { getDockerOSType, isArm64 } from '../../utils/osUtils'; import { pathNormalize } from '../../utils/pathNormalize'; import { PlatformOS } from '../../utils/platform'; import { unresolveWorkspaceFolder } from '../../utils/resolveVariables'; @@ -237,18 +237,7 @@ export class NetCoreDebugHelper implements DebugHelper { { runtime: 'linux-musl-x64', version: 'latest' }, ]; - // - // NOTE: As OmniSharp doesn't yet support arm64 in general, we only install arm64 debuggers when - // on an arm64 Mac (e.g. M1), even though there may be other platforms that could theoretically - // run arm64 images. We are often asked to install the debugger before images are created or - // pulled, which means we don't know a-priori the architecture of the image, so we install all - // of them, just in case. Because we do not have a good way to distinguish between a Mac attached - // to its local (Linux-based) Docker host (where arm64/amd64 are valid) or a Mac attached to a - // remote (Linux-based) Docker host (where arm64 may *not* be valid), installing every debugger - // is really our only choice. - // - - if (isArm64Mac()) { + if (isArm64()) { debuggers.push( { runtime: 'linux-arm64', version: 'latest' }, { runtime: 'linux-musl-arm64', version: 'latest' }); diff --git a/src/utils/osUtils.ts b/src/utils/osUtils.ts index 2662f873be..875356574e 100644 --- a/src/utils/osUtils.ts +++ b/src/utils/osUtils.ts @@ -36,8 +36,8 @@ export function isMac(): boolean { return os.platform() === 'darwin'; } -export function isArm64Mac(): boolean { - return isMac() && os.arch() === 'arm64'; +export function isArm64(): boolean { + return os.arch() === 'arm64'; } export function isLinux(): boolean {