Skip to content
Draft
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
194 changes: 194 additions & 0 deletions vscode-dotnet-runtime-library/distro-data/distro-support.json
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,200 @@
}
]
},
"Rocky Linux": {
"installCommand": [
{
"runUnderSudo": true,
"commandRoot": "dnf",
"commandParts": [
"install",
"-y",
"{packageName}"
]
}
],
"uninstallCommand": [
{
"runUnderSudo": true,
"commandRoot": "dnf",
"commandParts": [
"remove",
"-y",
"{packageName}"
]
}
],
"updateCommand": [
{
"runUnderSudo": true,
"commandRoot": "dnf",
"commandParts": [
"update",
"-y",
"{packageName}"
]
}
],
"searchCommand": [
{
"runUnderSudo": false,
"commandRoot": "dnf",
"commandParts": [
"search",
"{packageName}",
"-q"
]
}
],
"isInstalledCommand": [
{
"runUnderSudo": true,
"commandRoot": "dnf",
"commandParts": [
"list",
"--installed",
"{packageName}",
"-q"
]
}
],
"packageLookupCommand": [
{
"runUnderSudo": false,
"commandRoot": "dnf",
"commandParts": [
"list",
"install",
"{packageName}",
"-q"
]
}
],
"readSymLinkCommand": [
{
"runUnderSudo": false,
"commandRoot": "readlink",
"commandParts": [
"-f",
"{path}"
]
}
],
"expectedDistroFeedInstallDirectory": "/usr/lib64/dotnet",
"expectedMicrosoftFeedInstallDirectory": "",
"installedSDKVersionsCommand": [
{
"runUnderSudo": false,
"commandRoot": "dotnet",
"commandParts": [
"--list-sdks"
]
}
],
"installedRuntimeVersionsCommand": [
{
"runUnderSudo": false,
"commandRoot": "dotnet",
"commandParts": [
"--list-runtimes"
]
}
],
"currentInstallationVersionCommand": [
{
"runUnderSudo": false,
"commandRoot": "dotnet",
"commandParts": [
"--version"
]
}
],
"currentInstallPathCommand": [
{
"runUnderSudo": false,
"commandRoot": "which",
"commandParts": [
"dotnet"
]
}
],
"packages": [
{
"version": "6.0",
"sdk": [
"dotnet-sdk-6.0"
],
"runtime": [
"dotnet-runtime-6.0"
],
"aspnetcore": [
"aspnetcore-runtime-6.0"
]
},
{
"version": "7.0",
"sdk": [
"dotnet-sdk-7.0"
],
"runtime": [
"dotnet-runtime-7.0"
],
"aspnetcore": [
"aspnetcore-runtime-7.0"
]
},
{
"version": "8.0",
"sdk": [
"dotnet-sdk-8.0"
],
"runtime": [
"dotnet-runtime-8.0"
],
"aspnetcore": [
"aspnetcore-runtime-8.0"
]
},
{
"version": "9.0",
"sdk": [
"dotnet-sdk-9.0"
],
"runtime": [
"dotnet-runtime-9.0"
],
"aspnetcore": [
"aspnetcore-runtime-9.0"
]
},
{
"version": "10.0",
"sdk": [
"dotnet-sdk-10.0"
],
"runtime": [
"dotnet-runtime-10.0"
],
"aspnetcore": [
"aspnetcore-runtime-10.0"
]
}
],
"versions": [
{
"version": "8.0"
},
{
"version": "9.0"
},
{
"version": "10.0"
},
{
"version": "11.0"
}
]
},
"Red Hat Enterprise Linux": {
"installCommand": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,8 @@ If you would like to contribute to the list of supported distros, please visit:

for (const command of sudoCommands)
{
if (command.commandParts.slice(-1)[0] !== this.missingPackageNameKey)
if (!command.commandParts.some(part => part.includes(this.missingPackageNameKey)) &&
!command.commandRoot.includes(this.missingPackageNameKey))
{
validCommands.push(`"${CommandExecutor.prettifyCommandExecutorCommand(command, false)}"`);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ import { GenericDistroSDKProvider } from './GenericDistroSDKProvider';
import { IAcquisitionWorkerContext } from './IAcquisitionWorkerContext';
import { IDistroDotnetSDKProvider } from './IDistroDotnetSDKProvider';
import { RedHatDistroSDKProvider } from './RedHatDistroSDKProvider';
import { DEBIAN_DISTRO_INFO_KEY, RED_HAT_DISTRO_INFO_KEY, UBUNTU_DISTRO_INFO_KEY } from './StringConstants';
import { RockyLinuxDistroSDKProvider } from './RockyLinuxDistroSDKProvider';
import { DEBIAN_DISTRO_INFO_KEY, RED_HAT_DISTRO_INFO_KEY, ROCKY_LINUX_DISTRO_INFO_KEY, UBUNTU_DISTRO_INFO_KEY } from './StringConstants';
import { VersionResolver } from './VersionResolver';
import * as versionUtils from './VersionUtilities';

Expand Down Expand Up @@ -236,6 +237,8 @@ If you experience issues, please reach out on https://github.com/dotnet/vscode-d
return new RedHatDistroSDKProvider(distroAndVersion, this.workerContext, this.utilityContext);
case DEBIAN_DISTRO_INFO_KEY:
return new DebianDistroSDKProvider(distroAndVersion, this.workerContext, this.utilityContext);
case ROCKY_LINUX_DISTRO_INFO_KEY:
return new RockyLinuxDistroSDKProvider(distroAndVersion, this.workerContext, this.utilityContext);
default:
return new GenericDistroSDKProvider(distroAndVersion, this.workerContext, this.utilityContext);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* --------------------------------------------------------------------------------------------
* Licensed to the .NET Foundation under one or more agreements.
* The .NET Foundation licenses this file to you under the MIT license.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
import { ICommandExecutor } from '../Utils/ICommandExecutor';
import { IUtilityContext } from '../Utils/IUtilityContext';
import { IAcquisitionWorkerContext } from './IAcquisitionWorkerContext';
import { DistroVersionPair } from './LinuxVersionResolver';
import { RedHatDistroSDKProvider } from './RedHatDistroSDKProvider';

/**
* Rocky Linux is binary-compatible with Red Hat Enterprise Linux, uses the same dnf package manager,
* and ships .NET SDK packages in its AppStream repository. Version parsing mirrors RHEL behaviour:
* the major version component (e.g. "8" from "8.10") is used to look up the matching entry in
* distro-support.json.
*/
export class RockyLinuxDistroSDKProvider extends RedHatDistroSDKProvider
{
constructor(distroVersion : DistroVersionPair, context : IAcquisitionWorkerContext, utilContext : IUtilityContext, executor : ICommandExecutor | null = null)
{
super(distroVersion, context, utilContext, executor);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const UNABLE_TO_ACQUIRE_GLOBAL_LOCK_ERR = '898998';
export const UBUNTU_DISTRO_INFO_KEY = 'Ubuntu';
export const RED_HAT_DISTRO_INFO_KEY = 'Red Hat Enterprise Linux';
export const DEBIAN_DISTRO_INFO_KEY = 'Debian GNU/Linux';
export const ROCKY_LINUX_DISTRO_INFO_KEY = 'Rocky Linux';

export const BAD_VERSION = '0.0';

Expand Down
13 changes: 8 additions & 5 deletions vscode-dotnet-runtime-library/src/Utils/CommandExecutor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,11 +315,14 @@ ${stderr}`));
// Let the rejected promise get handled below. This is required to not make an error from the checking if this promise is alive
});

commandOutputJson = {
stdout: (await (this.fileUtil as FileUtilities).read(stdoutFile)).trim(),
stderr: (await (this.fileUtil as FileUtilities).read(stderrFile)).trim(),
status: (await (this.fileUtil as FileUtilities).read(statusFile)).trim()
} as CommandExecutorResult;
if (fs.existsSync(outputFile))
{
commandOutputJson = {
stdout: (await this.fileUtil.exists(stdoutFile) ? (await (this.fileUtil as FileUtilities).read(stdoutFile)).trim() : ''),
stderr: (await this.fileUtil.exists(stderrFile) ? (await (this.fileUtil as FileUtilities).read(stderrFile)).trim() : ''),
status: (await this.fileUtil.exists(statusFile) ? (await (this.fileUtil as FileUtilities).read(statusFile)).trim() : noStatusCodeErrorCode)
} as CommandExecutorResult;
}

this.context?.eventStream.post(new SudoProcCommandExchangeEnd(`Finished or timed out with master process. ${new Date().toISOString()}`));

Expand Down
Loading