Skip to content

Conversation

@jander-msft
Copy link
Contributor

@jander-msft jander-msft commented Jun 16, 2023

Add the GetProcessInfo3 command to the diagnostic server. This allows for retrieving the portable runtime identifier which informs diagnostic tools which variants of native libraries may be loaded into the target process. The portable runtime identifier is statically calculated at compile time based on the build target information for the libraries that link in the diagnostic server.

Corresponding diagnostics change: dotnet/diagnostics#3985

closes #74476

@ghost ghost added area-Diagnostics-coreclr community-contribution Indicates that the PR has been added by a community member labels Jun 16, 2023
@ghost
Copy link

ghost commented Jun 16, 2023

Tagging subscribers to this area: @tommcdon
See info in area-owners.md if you want to be subscribed.

Issue Details

Add the GetProcessInfo3 command to the diagnostic server. This allows for retrieving the portable runtime identifier which informs diagnostic tools which variants of native libraries may be loaded into the target process. The portable runtime identifier is statically calculated at compile time based on the build target information for the libraries that link in the diagnostic server.

Author: jander-msft
Assignees: -
Labels:

area-Diagnostics-coreclr

Milestone: -

@jander-msft
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Commenter does not have sufficient privileges for PR 87707 in repo dotnet/runtime

@jkotas
Copy link
Member

jkotas commented Jun 21, 2023

/azp run

@jander-msft
Copy link
Contributor Author

Could I get a new build ("/azp run") for the current set of changes? Seems some Azure service hiccupped while this one was starting.

@azure-pipelines
Copy link

You have several pipelines (over 10) configured to build pull requests in this repository. Specify which pipelines you would like to run by using /azp run [pipelines] command. You can specify multiple pipelines using a comma separated list.

@jkotas
Copy link
Member

jkotas commented Jun 21, 2023

/azp run runtime

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jander-msft
Copy link
Contributor Author

With the prior change, all jobs and tests were green except one where the new test was erroneously included. That was fixed in the latest commit. With that, I think this is ready for review.

@jander-msft
Copy link
Contributor Author

@tommcdon could I get someone from diagnostics to review this?

@tommcdon tommcdon requested a review from davmason June 26, 2023 18:34
@davmason davmason requested a review from lateralusX June 27, 2023 08:02
Copy link
Contributor

@davmason davmason left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but I want to give @lateralusX a chance to look before mergin

@davmason davmason merged commit 7ab6fd1 into dotnet:main Jun 28, 2023
davmason pushed a commit to dotnet/diagnostics that referenced this pull request Jun 30, 2023
Implement the ProcessInfo3 command as described in #3476

Corresponding runtime change:
dotnet/runtime#87707
@lateralusX
Copy link
Member

Sorry, was out on vacation but changes LGTM! One thought I had is that the portable rid will not be as specific as the OS where Mono will give you different identifiers for iOS/tvOS and Android, the portable rid will place all of them under each platforms inherited rid, so iOS/tvOS will present itself as unix and Android as linux-bionic, but I guess is fine, and it is always possible to take a look at the OS parameter to get more details around the specific OS. One platform that might not give you the right portable rid with current change is maccatalyst that should present itself similar to iOS (https://github.com/dotnet/runtime/blob/main/src/libraries/Microsoft.NETCore.Platforms/src/runtime.json#L2296), but will with current change present itself as osx, so that probably needs to be adjusted. Having that said, maccatalyst is not currently included as an OS either, so when adjusting that we should probably also adjust that in https://github.com/dotnet/runtime/blob/main/src/native/eventpipe/ep-event-source.c#L15.

@jander-msft
Copy link
Contributor Author

The intent of this portable RID is to provide a mechanism to differentiate the C library types (e.g. gnu, musl, bionic for Linux) for the target without having to know the specifics of the target so that native libraries with a portable notion could be loaded and executed in the target process; portable meaning not taking a hard dependency on specific distribution or version. We could have reported the literal C library type instead, but then we'd have to make up monikers or completely ignore other targets. Additionally, there seems to be support via library systems (e.g. NuGet) for providing libraries using this generic portable RID notion.

That being said, if something that is targeting a maccatalyst target needs to build a native library that is more specific than iOS-x64 or iOS-arm64 in order for it to be loaded and excitable, then these specifically can be carved out but should be done so in the most generic terms. For example, it seems that Void Linux supports both musl and gnu libc, but by default has gnu libc; it's RID in this scheme should not be void-x64 but should be linux-x64 or linux-musl-x64.

@ghost ghost locked as resolved and limited conversation to collaborators Aug 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-Diagnostics-coreclr community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add ProcessInfo3 diagnostic IPC command to include libc type or equivalent

4 participants