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

Set DOTNET_CLI_HOME to a repo-local path #5402

Open
2 tasks
Tracked by #6560
dsplaisted opened this issue May 4, 2020 · 17 comments · Fixed by #5775
Open
2 tasks
Tracked by #6560

Set DOTNET_CLI_HOME to a repo-local path #5402

dsplaisted opened this issue May 4, 2020 · 17 comments · Fixed by #5775
Milestone

Comments

@dsplaisted
Copy link
Member

  • This issue is blocking
  • This issue is causing unreasonable pain

By default, the CLI will use a user-specific folder for a few things, including first run sentinels and global tool information. The folder can be overridden with the DOTNET_CLI_HOME environment variable. Arcade should set this variable to a repo-local path, to avoid different builds (ie on CI machines or build servers) sharing this folder. While we should generally keep compatibility, that may not always be true between interim preview builds.

This has broken builds at least twice:

@ViktorHofer
Copy link
Member

@janvorli that's the issue that is tracking the right fix for the issue that you were seeing locally. cc @jaredpar

@riarenas
Copy link
Member

riarenas commented Jul 10, 2020

Running this test build where I set the variable to the build workspace directory: https://dev.azure.com/dnceng/internal/_build/results?buildId=724637&view=results

@riarenas
Copy link
Member

Ahh, forgot that arcade doesn't have a linux build leg. Will test this in arcade-validation instead.

@riarenas
Copy link
Member

PR to set this during CI: #5775

@riarenas
Copy link
Member

riarenas commented Jul 17, 2020

My fix doesn't work for docker containers that are started during the build, as oposed as having the entire leg running inside a container. Reopening.

https://dev.azure.com/dnceng/internal/_build/results?buildId=735034&view=logs&j=b72e85ab-3386-5aa9-6405-3837662d9688&t=f60252b2-6cdd-5047-3d04-b33edb9d8faa

@riarenas
Copy link
Member

Made a better fix, which sets the variable to the root of the repo during CI in #5805

@MattGal MattGal reopened this Jul 20, 2020
@MattGal
Copy link
Member

MattGal commented Jul 20, 2020

Reopening and putting in the backlog. This change was the source for #5813 , but since it has the context I'm reactivating this one.

The latest arcade validation builds were failing to resolve nuget v3 paths, reverting just this change unblocked them, as shown in this build

@riarenas
Copy link
Member

I believe the change is still the correct change, and whoever picks this up next can investigate why this fails runtime's build. My guess is that Runtime is doing something weird and they should react to the change, rather than not making it.

@alexperovich alexperovich self-assigned this Jul 29, 2020
@alexperovich
Copy link
Member

Okay I figured out why this change broke runtime. The build uses a NuGetAuthenticate task (https://github.com/microsoft/azure-pipelines-tasks/blob/d925deb300d85a09f8ed2d5d8a16f74cdb6fa8c5/Tasks/NuGetAuthenticateV0/main.ts#L16) to authenticate to private azure feeds.

That task installs the credential provider into the $HOME directory, if we then set DOTNET_CLI_HOME to something else, that credential provider is lost and the restore can't use private feeds.

I think we just.... can't set DOTNET_CLI_HOME, unless we want to copy the plugins from $HOME into the new location at the same time.

@MattGal
Copy link
Member

MattGal commented Jul 29, 2020

Thanks @alexperovich . I think at this point let's drop it out of FR (remove epic and labels) so we can make sure there's consensus on "won't fix-ing" tomorrow at triage?

@alexperovich
Copy link
Member

Yea, thats probably good.

@ViktorHofer
Copy link
Member

Great finding, thanks Alex. Should we fix https://github.com/microsoft/azure-pipelines-tasks/blob/69bdf79bd5d624cf5f8733cd25636df5008f7cf2/Tasks/Common/artifacts-common/credentialProviderUtils.ts#L96 to respect the environment variable and not blindly read from the hardcoded location? cc @nkolev92

@alexperovich
Copy link
Member

alexperovich commented Jul 30, 2020 via email

@alexperovich
Copy link
Member

Filed issue with azure pipelines: microsoft/azure-pipelines-tasks#13375

@garath
Copy link
Member

garath commented Jul 30, 2020

Triage: For Helix, a Big Improvement would be to recycle machines for every build (hosted pool does this).

@alexperovich alexperovich removed their assignment Aug 4, 2020
@lukas-lansky
Copy link
Contributor

I'm all for better isolation between CI builds – it really makes everything so much simpler – but dotnet/runtime#34994 is a local build problem and is waiting for the resolution of this issue.

@ViktorHofer
Copy link
Member

This issue points to a local build problem, you are right. But we would still see the issue if we wouldn't have disable repo tools being restored in CI temporarily: dotnet/runtime@97d1f96. So this still very much applies and needs to be fixed.

lambdageek added a commit to lambdageek/runtime that referenced this issue May 10, 2021
This was previously disabled due to dotnet/sdk#10938
and its continuation issue dotnet/arcade#5402

But things might be better now?
@missymessa missymessa added this to the Arcade SDK milestone Apr 24, 2024
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 a pull request may close this issue.

9 participants