Skip to content

Commit

Permalink
Fetch arm64 debugger anytime on an arm64 OS
Browse files Browse the repository at this point in the history
  • Loading branch information
bwateratmsft committed Jun 6, 2024
1 parent 9f86395 commit 9d8d1e6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
15 changes: 2 additions & 13 deletions src/debugging/netcore/NetCoreDebugHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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' });
Expand Down
4 changes: 2 additions & 2 deletions src/utils/osUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 9d8d1e6

Please sign in to comment.