Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

realpath in c# - #45637

#45637
Merged
agocke merged 10 commits into
dotnet:maindotnet/sdk:mainfrom
kasperk81:interopkasperk81/sdk:interopCopy head branch name to clipboard
Mar 12, 2026
Merged

realpath in c##45637
agocke merged 10 commits into
dotnet:maindotnet/sdk:mainfrom
kasperk81:interopkasperk81/sdk:interopCopy head branch name to clipboard

Conversation

@kasperk81

Copy link
Copy Markdown
Contributor

.net framework is windows only and current netcore has ResolveLinkTarget

@ghost ghost added Area-Infrastructure untriaged Request triage from a team member labels Dec 27, 2024
@KalleOlaviNiemitalo

Copy link
Copy Markdown
Contributor

In the following scenario, I think Interop.Unix.realpath(dotnetExeFromPath) would return "/stash/homes/myself/bin/dotnet", but info.LinkTarget would be null:

  • PATH includes /home/myself/bin
  • /home is a symbolic link to /stash/homes
  • /stash/homes/myself/bin/dotnet is a regular file

Does that difference cause any problem?

@tmds

tmds commented Jan 15, 2025

Copy link
Copy Markdown
Member

Does that difference cause any problem?

I don't think it matters. Once we located the real dotnet executable, it's parent path can be considered a "dotnet root". Whether that parent path contains links shouldn't matter: the SDK only uses the path for finding stuff beneath it, it doesn't care about the path itself.

Comment thread src/Resolvers/Microsoft.DotNet.NativeWrapper/EnvironmentProvider.cs Outdated
@github-actions

Copy link
Copy Markdown
Contributor

Due to lack of recent activity, this PR has been labeled as 'Stale'. It will be closed if no further activity occurs within 7 more days. Any new comment will remove the label.

@github-actions github-actions Bot added the stale label Oct 25, 2025
@kasperk81

Copy link
Copy Markdown
Contributor Author

@javiercn, @tmat, cleaned up native calls

@dsplaisted

Copy link
Copy Markdown
Member

@agocke @elinor-fung Could you take a look at this PR or suggest who should? I'm not familiar with native interop to be able to review this.

@jkotas jkotas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@agocke
agocke enabled auto-merge (squash) March 12, 2026 02:12
@agocke
agocke merged commit fa5d8d2 into dotnet:main Mar 12, 2026
27 checks passed
@kasperk81
kasperk81 deleted the interop branch March 13, 2026 00:57
javiercn pushed a commit that referenced this pull request Mar 13, 2026
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
@kasperk81

Copy link
Copy Markdown
Contributor Author

there is also an unused import call. removed in #53428.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area-Infrastructure untriaged Request triage from a team member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.