Skip to content

[BUG] 2.9.0 added Microsoft.SourceLink.GitHub as a _runtime_ dependency #991

@stephentoub

Description

@stephentoub

Describe the bug

2.8.0:
Image

2.9.0:
Image

This is not only a deployment issue, it also breaks builds.

In PR #890, the migration to Central Package Management moved PrivateAssets="All" from the PackageReference in src/OpenAI.csproj to the PackageVersion in Directory.Packages.props. However, NuGet does not honor PrivateAssets on PackageVersion when generating the nuspec for packing — it must be on the PackageReference itself.

As a result, Microsoft.SourceLink.GitHub 10.0.102 (and its transitive dependencies Microsoft.SourceLink.Common and Microsoft.Build.Tasks.Git) appear as regular dependencies of the OpenAI package. Any project that consumes OpenAI 2.9.0 gets SourceLink's MSBuild targets injected into its build. These targets attempt to generate source link metadata and fail with:

error : Source control information is not available - the generated source link is empty.

cc: @jsquire, @joseharriaga

Steps to reproduce

Use the OpenAI library as a dependency.

Code snippets

OS

All

.NET version

Any

Library version

2.9.0

Metadata

Metadata

Labels

area: architectureThis item is related to general architecture of the OpenAI client library.bugCategory: Something isn't working and appears to be a defect in the client library.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions