Skip to content

Commit

Permalink
Add support for new Linux distros in the debugger (#1000)
Browse files Browse the repository at this point in the history
This adds support for Ubuntu 16.10, Fedora 24 and openSUSE 42.1. To do this we are moving the debugger packages to .NET Core 1.1.
  • Loading branch information
gregg-miskelly authored Nov 30, 2016
1 parent cca5ca3 commit 425dd6b
Show file tree
Hide file tree
Showing 3 changed files with 177 additions and 27 deletions.
85 changes: 62 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "csharp",
"publisher": "ms-vscode",
"version": "1.6.0-beta2",
"version": "1.6.0-beta3",
"description": "C# for Visual Studio Code (powered by OmniSharp).",
"displayName": "C#",
"author": "Microsoft Corporation",
Expand Down Expand Up @@ -136,17 +136,17 @@
},
{
"description": ".NET Core Debugger (Windows / x64)",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-5-0/coreclr-debug-win7-x64.zip",
"fallbackUrl": "https://vsdebugger.blob.core.windows.net/coreclr-debug-1-5-0/coreclr-debug-win7-x64.zip",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-6-0/coreclr-debug-win7-x64.zip",
"fallbackUrl": "https://vsdebugger.blob.core.windows.net/coreclr-debug-1-6-0/coreclr-debug-win7-x64.zip",
"installPath": ".debugger",
"runtimeIds": [
"win7-x64"
]
},
{
"description": ".NET Core Debugger (macOS / x64)",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-5-0/coreclr-debug-osx.10.11-x64.zip",
"fallbackUrl": "https://vsdebugger.blob.core.windows.net/coreclr-debug-1-5-0/coreclr-debug-osx.10.11-x64.zip",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-6-0/coreclr-debug-osx.10.11-x64.zip",
"fallbackUrl": "https://vsdebugger.blob.core.windows.net/coreclr-debug-1-6-0/coreclr-debug-osx.10.11-x64.zip",
"installPath": ".debugger",
"runtimeIds": [
"osx.10.11-x64"
Expand All @@ -158,8 +158,8 @@
},
{
"description": ".NET Core Debugger (CentOS / x64)",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-5-0/coreclr-debug-centos.7-x64.zip",
"fallbackUrl": "https://vsdebugger.blob.core.windows.net/coreclr-debug-1-5-0/coreclr-debug-centos.7-x64.zip",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-6-0/coreclr-debug-centos.7-x64.zip",
"fallbackUrl": "https://vsdebugger.blob.core.windows.net/coreclr-debug-1-6-0/coreclr-debug-centos.7-x64.zip",
"installPath": ".debugger",
"runtimeIds": [
"centos.7-x64"
Expand All @@ -171,8 +171,8 @@
},
{
"description": ".NET Core Debugger (Debian / x64)",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-5-0/coreclr-debug-debian.8-x64.zip",
"fallbackUrl": "https://vsdebugger.blob.core.windows.net/coreclr-debug-1-5-0/coreclr-debug-debian.8-x64.zip",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-6-0/coreclr-debug-debian.8-x64.zip",
"fallbackUrl": "https://vsdebugger.blob.core.windows.net/coreclr-debug-1-6-0/coreclr-debug-debian.8-x64.zip",
"installPath": ".debugger",
"runtimeIds": [
"debian.8-x64"
Expand All @@ -183,9 +183,9 @@
]
},
{
"description": ".NET Core Debugger (Fedora / x64)",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-5-0/coreclr-debug-fedora.23-x64.zip",
"fallbackUrl": "https://vsdebugger.blob.core.windows.net/coreclr-debug-1-5-0/coreclr-debug-fedora.23-x64.zip",
"description": ".NET Core Debugger (Fedora 23 / x64)",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-6-0/coreclr-debug-fedora.23-x64.zip",
"fallbackUrl": "https://vsdebugger.blob.core.windows.net/coreclr-debug-1-6-0/coreclr-debug-fedora.23-x64.zip",
"installPath": ".debugger",
"runtimeIds": [
"fedora.23-x64"
Expand All @@ -196,9 +196,22 @@
]
},
{
"description": ".NET Core Debugger (OpenSUSE / x64)",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-5-0/coreclr-debug-opensuse.13.2-x64.zip",
"fallbackUrl": "https://vsdebugger.blob.core.windows.net/coreclr-debug-1-5-0/coreclr-debug-opensuse.13.2-x64.zip",
"description": ".NET Core Debugger (Fedora 24 / x64)",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-6-0/coreclr-debug-fedora.24-x64.zip",
"fallbackUrl": "https://vsdebugger.blob.core.windows.net/coreclr-debug-1-6-0/coreclr-debug-fedora.24-x64.zip",
"installPath": ".debugger",
"runtimeIds": [
"fedora.24-x64"
],
"binaries": [
"./OpenDebugAD7",
"./clrdbg"
]
},
{
"description": ".NET Core Debugger (OpenSUSE 13 / x64)",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-6-0/coreclr-debug-opensuse.13.2-x64.zip",
"fallbackUrl": "https://vsdebugger.blob.core.windows.net/coreclr-debug-1-6-0/coreclr-debug-opensuse.13.2-x64.zip",
"installPath": ".debugger",
"runtimeIds": [
"opensuse.13.2-x64"
Expand All @@ -208,10 +221,23 @@
"./clrdbg"
]
},
{
"description": ".NET Core Debugger (OpenSUSE 42 / x64)",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-6-0/coreclr-debug-opensuse.42.1-x64.zip",
"fallbackUrl": "https://vsdebugger.blob.core.windows.net/coreclr-debug-1-6-0/coreclr-debug-opensuse.42.1-x64.zip",
"installPath": ".debugger",
"runtimeIds": [
"opensuse.42.1-x64"
],
"binaries": [
"./OpenDebugAD7",
"./clrdbg"
]
},
{
"description": ".NET Core Debugger (RHEL / x64)",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-5-0/coreclr-debug-rhel.7.2-x64.zip",
"fallbackUrl": "https://vsdebugger.blob.core.windows.net/coreclr-debug-1-5-0/coreclr-debug-rhel.7.2-x64.zip",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-6-0/coreclr-debug-rhel.7.2-x64.zip",
"fallbackUrl": "https://vsdebugger.blob.core.windows.net/coreclr-debug-1-6-0/coreclr-debug-rhel.7.2-x64.zip",
"installPath": ".debugger",
"runtimeIds": [
"rhel.7-x64"
Expand All @@ -222,9 +248,9 @@
]
},
{
"description": ".NET Core Debugger (Ubuntu 14 / x64)",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-5-0/coreclr-debug-ubuntu.14.04-x64.zip",
"fallbackUrl": "https://vsdebugger.blob.core.windows.net/coreclr-debug-1-5-0/coreclr-debug-ubuntu.14.04-x64.zip",
"description": ".NET Core Debugger (Ubuntu 14.04 / x64)",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-6-0/coreclr-debug-ubuntu.14.04-x64.zip",
"fallbackUrl": "https://vsdebugger.blob.core.windows.net/coreclr-debug-1-6-0/coreclr-debug-ubuntu.14.04-x64.zip",
"installPath": ".debugger",
"runtimeIds": [
"ubuntu.14.04-x64"
Expand All @@ -235,9 +261,9 @@
]
},
{
"description": ".NET Core Debugger (Ubuntu 16 / x64)",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-5-0/coreclr-debug-ubuntu.16.04-x64.zip",
"fallbackUrl": "https://vsdebugger.blob.core.windows.net/coreclr-debug-1-5-0/coreclr-debug-ubuntu.16.04-x64.zip",
"description": ".NET Core Debugger (Ubuntu 16.04 / x64)",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-6-0/coreclr-debug-ubuntu.16.04-x64.zip",
"fallbackUrl": "https://vsdebugger.blob.core.windows.net/coreclr-debug-1-6-0/coreclr-debug-ubuntu.16.04-x64.zip",
"installPath": ".debugger",
"runtimeIds": [
"ubuntu.16.04-x64"
Expand All @@ -246,6 +272,19 @@
"./OpenDebugAD7",
"./clrdbg"
]
},
{
"description": ".NET Core Debugger (Ubuntu 16.10 / x64)",
"url": "https://vsdebugger.azureedge.net/coreclr-debug-1-6-0/coreclr-debug-ubuntu.16.10-x64.zip",
"fallbackUrl": "https://vsdebugger.blob.core.windows.net/coreclr-debug-1-6-0/coreclr-debug-ubuntu.16.10-x64.zip",
"installPath": ".debugger",
"runtimeIds": [
"ubuntu.16.10-x64"
],
"binaries": [
"./OpenDebugAD7",
"./clrdbg"
]
}
],
"engines": {
Expand Down
26 changes: 22 additions & 4 deletions src/platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,20 +269,26 @@ export class PlatformInformation {
const centos_7 = 'centos.7-x64';
const debian_8 = 'debian.8-x64';
const fedora_23 = 'fedora.23-x64';
const fedora_24 = 'fedora.24-x64';
const opensuse_13_2 = 'opensuse.13.2-x64';
const opensuse_42_1 = 'opensuse.42.1-x64';
const rhel_7 = 'rhel.7-x64';
const ubuntu_14_04 = 'ubuntu.14.04-x64';
const ubuntu_16_04 = 'ubuntu.16.04-x64';
const ubuntu_16_10 = 'ubuntu.16.10-x64';

switch (distributionName) {
case 'ubuntu':
if (distributionVersion.startsWith("14")) {
if (distributionVersion === "14.04") {
// This also works for Linux Mint
return ubuntu_14_04;
}
else if (distributionVersion.startsWith("16")) {
else if (distributionVersion === "16.04") {
return ubuntu_16_04;
}
else if (distributionVersion === "16.10") {
return ubuntu_16_10;
}

break;
case 'elementary':
Expand All @@ -309,9 +315,21 @@ export class PlatformInformation {
// Oracle Linux is binary compatible with CentOS
return centos_7;
case 'fedora':
return fedora_23;
if (distributionVersion === "23") {
return fedora_23;
} else if (distributionVersion === "24") {
return fedora_24;
}
break;

case 'opensuse':
return opensuse_13_2;
if (distributionVersion.startsWith("13.")) {
return opensuse_13_2;
} else if (distributionVersion.startsWith("42.")) {
return opensuse_42_1;
}
break;

case 'rhel':
return rhel_7;
case 'debian':
Expand Down
93 changes: 93 additions & 0 deletions test/platform.tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,18 @@ suite("Platform", () => {
platformInfo.runtimeId.should.equal('ubuntu.14.04-x64');
})

test("Compute correct RID for Ubuntu 16.04", () => {
const platformInfo = new PlatformInformation('linux', 'x86_64', distro_ubuntu_16_04());

platformInfo.runtimeId.should.equal('ubuntu.16.04-x64');
})

test("Compute correct RID for Ubuntu 16.10", () => {
const platformInfo = new PlatformInformation('linux', 'x86_64', distro_ubuntu_16_10());

platformInfo.runtimeId.should.equal('ubuntu.16.10-x64');
})

test("Compute correct RID for Fedora 23", () => {
const platformInfo = new PlatformInformation('linux', 'x86_64', distro_fedora_23());

Expand All @@ -97,6 +109,18 @@ suite("Platform", () => {
platformInfo.runtimeId.should.equal('ubuntu.16.04-x64');
})

test("Compute correct RID for openSUSE 13", () => {
const platformInfo = new PlatformInformation('linux', 'x86_64', distro_openSUSE_13_2());

platformInfo.runtimeId.should.equal('opensuse.13.2-x64');
})

test("Compute correct RID for openSUSE 42", () => {
const platformInfo = new PlatformInformation('linux', 'x86_64', distro_openSUSE_42_1());

platformInfo.runtimeId.should.equal('opensuse.42.1-x64');
})

test("Compute no RID for CentOS 7 with 32-bit architecture", () => {
const platformInfo = new PlatformInformation('linux', 'x86', distro_centos_7());

Expand Down Expand Up @@ -126,6 +150,43 @@ BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"`;
return LinuxDistribution.FromReleaseInfo(input, '\n');
}

function distro_ubuntu_16_04(): LinuxDistribution {
// Copied from /etc/os-release on Ubuntu 16.04 server
const input = `
NAME="Ubuntu"
VERSION="16.04.1 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.1 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial`;

return LinuxDistribution.FromReleaseInfo(input, '\n');
}

function distro_ubuntu_16_10(): LinuxDistribution {
// Copied from /etc/os-release on Ubuntu 16.10 server
const input = `
NAME="Ubuntu"
VERSION="16.10 (Yakkety Yak)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.10"
VERSION_ID="16.10"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="http://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=yakkety
UBUNTU_CODENAME=yakkety`;

return LinuxDistribution.FromReleaseInfo(input, '\n');
}

function distro_fedora_23(): LinuxDistribution {
// Copied from /etc/os-release on Fedora 23
const input = `
Expand Down Expand Up @@ -204,6 +265,38 @@ UBUNTU_CODENAME=xenial`;
return LinuxDistribution.FromReleaseInfo(input, '\n');
}

function distro_openSUSE_13_2(): LinuxDistribution {
const input = `
NAME=openSUSE
VERSION="13.2 (Harlequin)"
VERSION_ID="13.2"
PRETTY_NAME="openSUSE 13.2 (Harlequin) (x86_64)"
ID=opensuse
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:opensuse:13.2"
BUG_REPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://opensuse.org/"
ID_LIKE="suse"`;

return LinuxDistribution.FromReleaseInfo(input, '\n');
}

function distro_openSUSE_42_1(): LinuxDistribution {
const input = `
NAME="openSUSE Leap"
VERSION="42.1"
VERSION_ID="42.1"
PRETTY_NAME="openSUSE Leap 42.1 (x86_64)"
ID=opensuse
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:opensuse:42.1"
BUG_REPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://opensuse.org/"
ID_LIKE="suse"`;

return LinuxDistribution.FromReleaseInfo(input, '\n');
}

function distro_unknown_no_id_like(): LinuxDistribution {
const input = `
PRETTY_NAME="Make believe 1.0"
Expand Down

0 comments on commit 425dd6b

Please sign in to comment.