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

realpath in c# #45637

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

realpath in c# #45637

wants to merge 10 commits into from

Conversation

kasperk81
Copy link
Contributor

.net framework is windows only and current netcore has ResolveLinkTarget

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Infrastructure untriaged Request triage from a team member labels Dec 27, 2024
@KalleOlaviNiemitalo
Copy link
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?

@kasperk81
Copy link
Contributor Author

it now walks the parent up to the first link, combine with returnFinalTarget: true of ResolveLinkTarget

@kasperk81
Copy link
Contributor Author

@nagilson, @tmds

@tmds
Copy link
Member

tmds commented Jan 15, 2025

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.

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.

3 participants