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

Fix home calculation Fixes #46821 #46836

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

Conversation

Forgind
Copy link
Member

@Forgind Forgind commented Feb 13, 2025

Fixes #46821

#46349 was part of a set of changes to support containers that don't have HOME set to anything. Unfortunately, DOTNET_CLI_HOME (which is what we use instead) may not be set to things in other environments, notably with a zip install. Since Path.Combine is used, this led to a null pointer exception.

This changes it to use DOTNET_CLI_HOME by preference and HOME if that's undefined. If neither of those is defined, we skip copying the nuget.config to avoid an error. It's fine to not error in this case since it's best effort anyway.

/cc: @kasperk81 and @baronfel

@Copilot Copilot bot review requested due to automatic review settings February 13, 2025 19:48
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Infrastructure untriaged Request triage from a team member labels Feb 13, 2025

Choose a reason for hiding this comment

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

Copilot reviewed 1 out of 1 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

src/Cli/dotnet/SudoEnvironmentDirectoryOverride.cs:48

  • The word 'directoy' should be 'directory'.
/// Copying instead of using the file directoy to avoid existing file being set higher permission

src/Cli/dotnet/SudoEnvironmentDirectoryOverride.cs:39

  • The new behavior introduced here is not covered by tests. Please add a test to ensure that CopyUserNuGetConfigToOverriddenHome is only called when homeBeforeOverride is not null.
if (homeBeforeOverride is not null)
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.

[NETSDKE2E][Mac][Linux][Regression]With .net 10 preview 2 SDK installed, workload installation failed.
2 participants