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

Building VMR on a machine that sets NUGET_PACKAGES env variable fails #4737

Open
ericstj opened this issue Nov 14, 2024 · 1 comment
Open

Comments

@ericstj
Copy link
Member

ericstj commented Nov 14, 2024

I have a DevBox VM that comes with NUGET_PACKAGES=c:\.tools\.nuget\packages

When building the VMR it fails with the following error:

C:\src\dotnet\dotnet\repo-projects\Directory.Build.targets(487,5): error MSB3073: The command "C:\src\dotnet\dotnet\
src\arcade\eng\common\build.cmd -restore -build -pack -publish  -configuration Release -bl /p:DotNetBuildRepo=true /
p:DotNetBuildOrchestrator=true /p:RestoreConfigFile=C:\src\dotnet\dotnet\artifacts\obj\arcade\NuGet.config /p:Source
BuiltAssetsDir=C:\src\dotnet\dotnet\artifacts\assets\Release\ /p:SourceBuiltAssetManifestsDir=C:\src\dotnet\dotnet\a
rtifacts\manifests\arcade\ /p:OfficialBuildId=20241105.1 -msbuildEngine dotnet /p:SourceBuiltShippingPackagesDir=C:\
src\dotnet\dotnet\artifacts\packages\Release\Shipping\arcade\ /p:SourceBuiltNonShippingPackagesDir=C:\src\dotnet\dot
net\artifacts\packages\Release\NonShipping\arcade /p:PortableBuild=true /p:RuntimeOS=win /p:BaseOS=win-x64 /v:minima
l > C:\src\dotnet\dotnet\artifacts\log\Release\arcade\arcade.log 2>&1" exited with code 1. [C:\src\dotnet\dotnet\rep
o-projects\arcade.proj]
  C:\src\dotnet\dotnet\src\arcade\artifacts\toolset\restore.proj : error MSB4242: SDK Resolver Failure: "The SDK res
  olver "UnifiedBuildSdkResolver" failed while attempting to resolve the SDK "Microsoft.DotNet.Arcade.Sdk". Exceptio
  n: "System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\src\dotnet\dotnet\.packages\micros
  oft.dotnet.arcade.sdk\10.0.0-beta.24551.1'.
  C:\src\dotnet\dotnet\src\arcade\artifacts\toolset\restore.proj : error MSB4242:    at System.IO.Enumeration.FileSy
  stemEnumerator`1.CreateDirectoryHandle(String path, Boolean ignoreNotFound)
  C:\src\dotnet\dotnet\src\arcade\artifacts\toolset\restore.proj : error MSB4242:    at System.IO.Enumeration.FileSy
  stemEnumerator`1.Init()
  C:\src\dotnet\dotnet\src\arcade\artifacts\toolset\restore.proj : error MSB4242:    at System.IO.Enumeration.FileSy
  stemEnumerable`1..ctor(String directory, FindTransform transform, EnumerationOptions options, Boolean isNormalized
  )
  C:\src\dotnet\dotnet\src\arcade\artifacts\toolset\restore.proj : error MSB4242:    at System.IO.Enumeration.FileSy
  stemEnumerableFactory.UserDirectories(String directory, String expression, EnumerationOptions options)
  C:\src\dotnet\dotnet\src\arcade\artifacts\toolset\restore.proj : error MSB4242:    at System.IO.Directory.Internal
  EnumeratePaths(String path, String searchPattern, SearchTarget searchTarget, EnumerationOptions options)
  C:\src\dotnet\dotnet\src\arcade\artifacts\toolset\restore.proj : error MSB4242:    at Microsoft.DotNet.UnifiedBuil
  d.Tasks.UnifiedBuildSdkResolver.SourceBuiltSdkOverride.Create(DictionaryEntry entry) in C:\src\dotnet\dotnet\eng\t
  ools\tasks\Microsoft.DotNet.UnifiedBuild.MSBuildSdkResolver\UnifiedBuildSdkResolver.cs:line 141
  C:\src\dotnet\dotnet\src\arcade\artifacts\toolset\restore.proj : error MSB4242:    at System.Linq.Enumerable.Itera
  torSelectIterator`2.MoveNext()
  C:\src\dotnet\dotnet\src\arcade\artifacts\toolset\restore.proj : error MSB4242:    at System.Linq.Enumerable.IEnum
  erableWhereIterator`1.ToArray()
  C:\src\dotnet\dotnet\src\arcade\artifacts\toolset\restore.proj : error MSB4242:    at Microsoft.DotNet.UnifiedBuil
  d.Tasks.UnifiedBuildSdkResolver.Resolve(SdkReference sdkReference, SdkResolverContext resolverContext, SdkResultFa
  ctory factory) in C:\src\dotnet\dotnet\eng\tools\tasks\Microsoft.DotNet.UnifiedBuild.MSBuildSdkResolver\UnifiedBui
  ldSdkResolver.cs:line 49
  C:\src\dotnet\dotnet\src\arcade\artifacts\toolset\restore.proj : error MSB4242:    at Microsoft.Build.BackEnd.SdkR
  esolution.SdkResolverService.TryResolveSdkUsingSpecifiedResolvers(IReadOnlyList`1 resolvers, Int32 submissionId, S
  dkReference sdk, LoggingContext loggingContext, ElementLocation sdkReferenceLocation, String solutionPath, String
  projectPath, Boolean interactive, Boolean isRunningInVisualStudio, SdkResult& sdkResult, IEnumerable`1& errors, IE
  numerable`1& warnings)""
  Build failed with exit code 1. Check errors above.
  See log: C:\src\dotnet\dotnet\src\arcade\artifacts\log\Release\ToolsetRestore.binlog

I found that this was because some of the packages were being restored to c:\.tools\.nuget\packages while others were going to C:\src\dotnet\dotnet\.packages. It seems that whatever failed here didn't read the package folder from the project, but instead assumed the repo local package folder.

@mmitche
Copy link
Member

mmitche commented Nov 18, 2024

Dupe of #4598

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

3 participants