Skip to content

Commit 26508b3

Browse files
Make changes to detect and require macOS Sierra (#1688)
.NET Core 2.0 only supports Sierra, and it will fall over on older versions of macOS. This adds detection code to let users know what is going on.
1 parent 74e0bd9 commit 26508b3

File tree

5 files changed

+23
-9
lines changed

5 files changed

+23
-9
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ See our [change log](https://github.com/OmniSharp/omnisharp-vscode/blob/v1.10.0/
3131
* Currently, the C# debugger officially supports the following operating systems:
3232

3333
* Windows (64-bit only)
34-
* macOS
34+
* macOS 10.12 (Sierra) and newer
3535
* Ubuntu 14.04+ (and distros based on it)
3636
* Debian 8.7+
3737
* Red Hat Enterprise Linux (RHEL) / CentOS / Oracle Linux 7.3+

debugger.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,6 @@ This page gives you detailed instructions on how to debug code running under .NE
44
#### Your Feedback​
55
File bugs and feature requests [here](https://github.com/OmniSharp/omnisharp-vscode/issues) and [join our insiders group](http://landinghub.visualstudio.com/dotnetcoreinsiders) to help us build great tooling for .NET Core.
66

7-
#### Requirements
8-
* Requires .NET Core 1.0 (rc2 and earlier releases are not supported)
9-
* X64 only
10-
* Supported operating systems:
11-
* macOS: 10.11+ (El Capitan+)
12-
* Linux: Red Hat Enterprise Linux 7.2+, Ubuntu 14.04 LTS, Ubuntu 16.04 LTS, Debian 8.2+, Linux Mint 17+, CentOS 7.1+, Oracle Linux 7.1+, Fedora 23, openSUSE 13.2
13-
* Windows: 7+
14-
157
### First Time setup
168
##### 1: Get Visual Studio Code
179
Install Visual Studio Code (VSC). Pick the latest VSC version from here: https://code.visualstudio.com Make sure it is at least 1.5.

src/coreclr-debug/activate.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
'use strict';
66

77
import * as vscode from 'vscode';
8+
import * as os from 'os';
89
import TelemetryReporter from 'vscode-extension-telemetry';
910
import { CoreClrDebugUtil, DotnetInfo, } from './util';
1011
import * as debugInstall from './install';
@@ -45,6 +46,14 @@ export function activate(thisExtension : vscode.Extension<any>, context: vscode.
4546
function completeDebuggerInstall(logger: Logger, channel: vscode.OutputChannel) : void {
4647
_debugUtil.checkDotNetCli()
4748
.then((dotnetInfo: DotnetInfo) => {
49+
50+
if (os.platform() === "darwin" && !CoreClrDebugUtil.isMacOSSupported()) {
51+
logger.appendLine("[ERROR] The debugger cannot be installed. The debugger requires macOS 10.12 (Sierra) or newer.");
52+
channel.show();
53+
vscode.window.showErrorMessage("The .NET Core debugger cannot be installed. The debugger requires macOS 10.12 (Sierra) or newer.");
54+
return;
55+
}
56+
4857
let installer = new debugInstall.DebugInstaller(_debugUtil);
4958
installer.finishInstall()
5059
.then(() => {

src/coreclr-debug/proxy.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
'use strict';
66

77
import * as path from 'path';
8+
import * as os from 'os';
89
import { DebugProtocol } from 'vscode-debugprotocol';
910
import * as child_process from 'child_process';
1011
import { CoreClrDebugUtil } from './util';
@@ -70,6 +71,11 @@ function proxy() {
7071
//first check if dotnet is on the path and new enough
7172
util.checkDotNetCli()
7273
.then((dotnetInfo) => {
74+
if (os.platform() === "darwin" && !CoreClrDebugUtil.isMacOSSupported()) {
75+
sendErrorMessage("The .NET Core debugger cannot be started. The debugger requires macOS 10.12 (Sierra) or newer.");
76+
return;
77+
}
78+
7379
// next check if we have begun installing packages
7480
common.installFileExists(common.InstallFileType.Begin)
7581
.then((beginExists: boolean) => {

src/coreclr-debug/util.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import * as path from 'path';
88
import * as fs from 'fs';
99
import * as semver from 'semver';
10+
import * as os from 'os';
1011
import { execChildProcess } from './../common';
1112
import { Logger } from './../logger';
1213

@@ -116,6 +117,12 @@ export class CoreClrDebugUtil
116117
});
117118
}
118119

120+
public static isMacOSSupported() : boolean {
121+
// .NET Core 2.0 requires macOS 10.12 (Sierra), which is Darwin 16.0+
122+
// Darwin version chart: https://en.wikipedia.org/wiki/Darwin_(operating_system)
123+
return semver.gte(os.release(), "16.0.0");
124+
}
125+
119126
public static existsSync(path: string) : boolean {
120127
try {
121128
fs.accessSync(path, fs.constants.F_OK);

0 commit comments

Comments
 (0)