Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetch arm64 debugger anytime on any arm64 OS #4319

Merged
merged 1 commit into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading