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

Rationalize short and long RIDs #30041

Open
richlander opened this issue Jan 20, 2023 · 2 comments
Open

Rationalize short and long RIDs #30041

richlander opened this issue Jan 20, 2023 · 2 comments
Assignees
Labels
untriaged Request triage from a team member

Comments

@richlander
Copy link
Member

We use two different styles of RIDs in the SDK.

% dotnet --info | grep RID
 RID:         osx.13-arm64
% dotnet build --help | grep runtime
  --use-current-runtime                Use current runtime as the target 
                                       runtime.

The dotnet --info RID includes an OS version and the --use-current-runtime one does not. That is asymmetric and confusing.

I don't have a proposal to offer right now, but want to record this issue. It should be resolved as part of dotnet/designs#260. If others have ideas, please share them.

@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Request triage from a team member label Jan 20, 2023
@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@am11
Copy link
Member

am11 commented Jan 20, 2023

I think the overarching issue is that we have multiple places that compute RID, and those implementations are out of sync. They are covering different use-cases and corner-cases; sometimes by design and sometimes by accident.

RID calculated for dotnet --info is a heuristic written in C#: read a magic version file or fallback to System.Runtime.InteropServices.RuntimeInformation.RuntimeIdentifier API. That API in turn uses an AppContext switch: RUNTIME_IDENTIFIER which, if remained unset during the build of runtime package, can return "unknown"... case in point: https://godbolt.org/z/sar14E4PG)

Therefore, dotnet --info | grep RID is not the reliable source of information. e.g. for linux binaries downloaded from https://dot.net/core, one would think it would report portable RID such as linux-x64, but instead it reports non-portable RID such as ubuntu.22.04-x64 (as long as /etc/os-release file is intact). This not how that package was built, how this package is used to build apps and how this package is used to run the apps ('run' has 'similar' but not the 'same' implementation in C++ with a hardcoded fallback, which makes a difference between portable and non-portable builds behavior at application launch).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
untriaged Request triage from a team member
Projects
None yet
Development

No branches or pull requests

3 participants