dotnet / source-build

A repository to track efforts to produce a source tarball of the .NET Core SDK and all its components
MIT License
261 stars 127 forks source link

Stop setting RestoreConfigFile environment variable #4081

Open NikolaMilosavljevic opened 5 months ago

NikolaMilosavljevic commented 5 months ago

As part of nuget.config file mutations work (https://github.com/dotnet/installer/pull/18478) we've added a new env.var RestoreConfigFile to support various tool projects in aspnetcore, fsharp and source-build-externals. Those projects do not automatically get RestoreConfigFile MSBuild property.

Consider removing this env.var and fixing build infra in those repos, to properly pass the MSBuild property to all miscellaneous projects.

Without this variable, NuGet would restore packages from feeds in repo's root, instead of one that we supply with RestoreConfigFile property. Offline source-build is the perfect repro scenario.

ViktorHofer commented 4 months ago

We had a discussion with the NuGet team recently about https://github.com/dotnet/source-build/issues/3781. We discussed that NuGet (both the nuget sdk resolver and NuGet common code) would honor two new environment variables: NUGET_CONFIG and GLOBAL_JSON. We will implement this in the coming months.

Given that, we actually want to set an env var and won't need the properties then anymore. We need an env var over a property solution as sdk resolver don't have access to (global) msbuild properties.