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

Add another dotnet runtime detector #203

Closed
wants to merge 1 commit into from
Closed

Add another dotnet runtime detector #203

wants to merge 1 commit into from

Conversation

Smaug123
Copy link
Contributor

@Smaug123 Smaug123 commented Mar 4, 2024

When running /path/to/dotnet /path/to/analyzers-cli.dll, the $PATH and so forth need not be set up to contain a .NET installation. We can still ask the runtime what's executing it, though.

I checked manually, and with PublishAot RuntimeEnvironment.GetRuntimeDirectory() just returns the directory which contains the binary, rather than throwing or anything like that. I think that's probably the most pathological case we'll have to deal with.

@baronfel
Copy link
Collaborator

baronfel commented Mar 4, 2024

We likely wouldn't take this, as most other tooling expects dotnet to be set via one of these mechanisms. The spec around this is here: https://github.com/dotnet/designs/blob/main/accepted%2F2021%2Finstall-location-per-architecture.md

IMO Nix should do one of these methods to align better with tooling - the most correct in my opinion is the /etc/.dotnet/install_location method.

@Smaug123
Copy link
Contributor Author

Smaug123 commented Mar 5, 2024

This isn't a Nix problem per se, it's just that Nix is an easy way to get hold of a very empty environment. When I run dotnet exec, where dotnet is literally the dotnet that's in the SDK, I kind of expect the invoked tool to be able to discover that it is in fact running; but it's at worst an annoyance not being able to do this.

(I do greatly object to things requiring global mutation of the system they're installed into, but of course we can't do anything about that if .NET demands it!)

@Smaug123 Smaug123 closed this Mar 5, 2024
@Smaug123 Smaug123 deleted the find-from-self branch March 5, 2024 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants