Skip to content

[SBRP] generate.sh --csv does not supporting multiple versions of a package #3977

@MichaelSimons

Description

@MichaelSimons

Steps to reproduce:

  1. Create a packages.csv file with the following content:
Microsoft.Build,16.10.0
Microsoft.Build,17.3.2
  1. Run the generate script with the following options:
./generate.sh --csv <location of csv created in step 1>/packages.csv -x

Results:

  Determining projects to restore...
  Restored /root/.nuget/packages/microsoft.dotnet.arcade.sdk/9.0.0-beta.23628.1/tools/Tools.proj (in 130 ms).
  Determining projects to restore...
/repos/source-build-reference-packages/src/packageSourceGenerator/PackageSourceGenerator.proj : warning NU1505: Duplicate 'PackageDownload' items found. Remove the duplicate items or use the Update functionality to ensure a consistent restore behavior. The duplicate 'PackageDownload' items are: Microsoft.Build [16.10.0], Microsoft.Build [17.3.2].
  Restored /repos/source-build-reference-packages/src/packageSourceGenerator/PackageSourceGenerator.proj (in 16 ms).
  Restored /repos/source-build-reference-packages/src/packageSourceGenerator/PackageSourceGeneratorTask/PackageSourceGeneratorTask.csproj (in 114 ms).
  PackageSourceGeneratorTask -> /repos/source-build-reference-packages/artifacts/bin/PackageSourceGeneratorTask/Debug/net9.0/PackageSourceGeneratorTask.dll
  
  PackageSourceGenerator -> Generating package source for Microsoft.Build (v16.10.0)...
  Excluding target frameworks: net472.
  Determining projects to restore...
  Restored /repos/source-build-reference-packages/artifacts/bin/PackageSourceGenerator/microsoft.build/16.10.0/microsoft.build.16.10.0.csproj (in 48 ms).
  Generated reference assembly source code: /repos/source-build-reference-packages/src/referencePackages/src/microsoft.build/16.10.0/lib/net5.0
  PackageSourceGenerator -> /repos/source-build-reference-packages/src/referencePackages/src/microsoft.build/16.10.0/Microsoft.Build.16.10.0.csproj
  PackageSourceGenerator -> /repos/source-build-reference-packages/src/referencePackages/src/microsoft.build/16.10.0/microsoft.build.nuspec
  PackageSourceGenerator -> Package source successfully generated for Microsoft.Build (v16.10.0).
  
  PackageSourceGenerator -> Generating package source for Microsoft.Build (v17.3.2)...
/repos/source-build-reference-packages/src/packageSourceGenerator/PackageSourceGenerator.proj(106,5): error MSB4018: The "GetPackageItems" task failed unexpectedly.
/repos/source-build-reference-packages/src/packageSourceGenerator/PackageSourceGenerator.proj(106,5): error MSB4018: System.IO.InvalidDataException: The file is not a valid nupkg. File path: /root/.nuget/packages/microsoft.build/17.3.2/microsoft.build.17.3.2.nupkg
/repos/source-build-reference-packages/src/packageSourceGenerator/PackageSourceGenerator.proj(106,5): error MSB4018:  ---> System.IO.DirectoryNotFoundException: Could not find a part of the path '/root/.nuget/packages/microsoft.build/17.3.2/microsoft.build.17.3.2.nupkg'.
/repos/source-build-reference-packages/src/packageSourceGenerator/PackageSourceGenerator.proj(106,5): error MSB4018:    at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirError)
/repos/source-build-reference-packages/src/packageSourceGenerator/PackageSourceGenerator.proj(106,5): error MSB4018:    at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags flags, Int32 mode, Boolean failForSymlink, Boolean& wasSymlink, Func`4 createOpenException)
/repos/source-build-reference-packages/src/packageSourceGenerator/PackageSourceGenerator.proj(106,5): error MSB4018:    at Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String fullPath, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, UnixFileMode openPermissions, Int64& fileLength, UnixFileMode& filePermissions, Boolean failForSymlink, Boolean& wasSymlink, Func`4 createOpenException)
/repos/source-build-reference-packages/src/packageSourceGenerator/PackageSourceGenerator.proj(106,5): error MSB4018:    at System.IO.Strategies.OSFileStreamStrategy..ctor(String path, FileMode mode, FileAccess access, FileShare share, FileOptions options, Int64 preallocationSize, Nullable`1 unixCreateMode)
/repos/source-build-reference-packages/src/packageSourceGenerator/PackageSourceGenerator.proj(106,5): error MSB4018:    at System.IO.File.OpenRead(String path)
/repos/source-build-reference-packages/src/packageSourceGenerator/PackageSourceGenerator.proj(106,5): error MSB4018:    at NuGet.Packaging.PackageArchiveReader..ctor(String filePath, IFrameworkNameProvider frameworkProvider, IFrameworkCompatibilityProvider compatibilityProvider)
/repos/source-build-reference-packages/src/packageSourceGenerator/PackageSourceGenerator.proj(106,5): error MSB4018:    --- End of inner exception stack trace ---
/repos/source-build-reference-packages/src/packageSourceGenerator/PackageSourceGenerator.proj(106,5): error MSB4018:    at NuGet.Packaging.PackageArchiveReader..ctor(String filePath, IFrameworkNameProvider frameworkProvider, IFrameworkCompatibilityProvider compatibilityProvider)
/repos/source-build-reference-packages/src/packageSourceGenerator/PackageSourceGenerator.proj(106,5): error MSB4018:    at Microsoft.DotNet.SourceBuild.Tasks.GetPackageItems.Execute() in /repos/source-build-reference-packages/src/packageSourceGenerator/PackageSourceGeneratorTask/GetPackageItems.cs:line 81
/repos/source-build-reference-packages/src/packageSourceGenerator/PackageSourceGenerator.proj(106,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
/repos/source-build-reference-packages/src/packageSourceGenerator/PackageSourceGenerator.proj(106,5): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask(ITaskExecutionHost taskExecutionHost, TaskLoggingContext taskLoggingContext, TaskHost taskHost, ItemBucket bucket, TaskExecutionMode howToExecuteTask)

Build FAILED.

Metadata

Metadata

Assignees

Labels

area-sbrpSource build reference packages

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions