-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
dotnet tool install -a arm64
fails on linux-arm64
#29074
Comments
The set of valid RIDs for the architecture option was chosen in #18832, 16 months ago. I'm unsure the design decision there - @joeloff or @dsplaisted do y'all remember anything about this? Nothing jumps to mind specifically that should block linux RIDs, and we do have host packs for them in NuGet already. |
I'm not sure why the list of RuntimeIdentifiers is hardcoded there. Looking at the code it looks like you can't install global tools at all on Linux, though I may be missing something. Ideally I think the same data that goes in to Microsoft.NETCoreSdk.BundledVersions.props about what RIDs are available for apphosts should be used to drive the tool install too. |
So looking at the .NET 7 apphost declaration in that file, <KnownAppHostPack Include="Microsoft.NETCore.App"
TargetFramework="net7.0"
AppHostPackNamePattern="Microsoft.NETCore.App.Host.**RID**"
AppHostPackVersion="7.0.0"
AppHostRuntimeIdentifiers="linux-arm;linux-arm64;linux-musl-arm64;linux-musl-x64;linux-x64;osx-x64;rhel.6-x64;tizen.4.0.0-armel;tizen.5.0.0-armel;win-arm;win-arm64;win-x64;win-x86;linux-musl-arm;osx-arm64;linux-s390x;linux-bionic-arm;linux-bionic-arm64;linux-bionic-x64;linux-bionic-x86;linux-ppc64le"
ExcludedRuntimeIdentifiers="android"
/> We'd ideally be able to a) read this and b) specifically grab the allowed RIDs from |
Does this mean that global tools are completely broken on linux? We could add linux-x64 and linux-arm64 to the hardcoded list as a stop gap. As Chet noted, the right solution is getting the known app host pack list out of the bundled targets props file but we don't want to be parsing an msbuild file so potentially we could write out that same data some other way in the installer repo (separate xml file?) |
I just tested with Ubuntu 22.04, .NET SDK 7 from the Microsoft feeds with the
And that runs as expected. Am I misreading this and we're looking at x64/arm64 emulation code here instead only? |
I get the same output when cross-building AMD64 / ARM64 Docker images on either host machine architecture, but only when I supply the architecture flag to |
Hi, just to provide additional context. My use case is to install the correct version (architecture) of the diagnostics tools (e.g. dotnet-counters) in a docker multi-plat build (linux/amd64 and linux/arm64). If I add the arch option to the dotnet tool install command, it fails with the message described above. I also considered downloading the pre-built binary of the tool, but I didn't figure out how to specify the version (https://learn.microsoft.com/en-us/dotnet/core/diagnostics/dotnet-counters#install). Thank you for looking at it. |
Came across this same issue today.
When building for However, because the build environment is Not sure what the right solution is here, but typing this out helped me understand the issue. |
Not sure if this is the same issue, but I'm running into this issue:
This is a xamarin app (native macos API), after running |
I am building a Docker container that contains a dotnet tool preinstalled. For reasons of efficiency and layer size, I want to only install the runtime bits that are relevant to the container image. Ideally ``--arch linux-x64` would do just that. For now, my workaround is to install it without specifying |
Ran into the same problem while installing I think we can simplify that code as follow: public async Task<string> ResolveAppHostSourceDirectoryAsync(string archOption, NuGetFramework targetFramework, Architecture arch)
{
string packagePath;
string? rid;
if (string.IsNullOrEmpty(archOption))
{
packagePath = GetDefaultAppHostSourceDirectory();
}
else
{
rid = CommonOptions.ResolveRidShorthandOptionsToRuntimeIdentifier(null, archOption);
packagePath = Path.Combine(_tempDir.Value, "runtimes", rid, "native");
}
if (Path.Exists(packagePath))
return packagePath;
if (rid is null)
throw new GracefulException($"Unable to locate {arch} apphost."); // TODO localize
// download the missing apphost
var packageId = new PackageId($"microsoft.netcore.app.host.{rid}");
NuGetVersion packageVersion = null;
var packagePath = await _nugetPackageDownloader.DownloadPackageAsync(packageId, packageVersion, packageSourceLocation: _packageSourceLocation);
await _nugetPackageDownloader.ExtractPackageAsync(packagePath, _tempDir);
return packagePath;
} |
Describe the bug
dotnet tool install --global <tool-name> --arch arm64
fails reporting that the RIDlinux-arm64
is invalid.To Reproduce
dotnet tool install --global dotnet-sonarscanner --arch arm64
Exceptions (if any)
Further technical details
dotnet --info
The text was updated successfully, but these errors were encountered: