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

Build warning: "Source control information is not available - the generated source link is empty" #13

Open
nathan-alden-hp opened this issue Oct 21, 2021 · 2 comments

Comments

@nathan-alden-hp
Copy link

nathan-alden-hp commented Oct 21, 2021

This warning message isn't very informative, so I don't know what conditions to resolve.

I borrowed a method for referencing packages in SDK-style from Tanner Gooding to prevent developers from accidentally removing important package references. I have a solution with cascading Directory.Build.props and Directory.Build.targets files. In my repo's source/Directory.Build.props file, I initially define the NuGet package reference in SDK style:

<ItemGroup Condition="'$(Configuration)' == 'Release'">
  <!-- IsImplicitlyDefined causes Visual Studio to treat this package as an SDK package, meaning developers cannot accidentally remove it -->
  <PackageReference Include="DotNet.ReproducibleBuilds" IsImplicitlyDefined="true" PrivateAssets="all" IncludeAssets="runtime; build; native; contentfiles; analyzers" />
</ItemGroup>

Then, in source/Directory.Build.targets, I define the version numbers used by the package:

<ItemGroup Condition="'$(Configuration)' == 'Release'">
  <PackageReference Update="DotNet.ReproducibleBuilds" Version="0.1.66" />
</ItemGroup>

I originally defined <RepositoryUrl> myself in the root Directory.Build.props (imported before source/Directory.Build.props), but I took that out thinking its presence might have been causing the problem. It didn't help.

I also unsuccessfully tried referencing the package as normal inside source/Directory.Build.props:

<PackageReference Include="DotNet.ReproducibleBuilds" Version="0.1.66" />

Git shows the correct origin URL:

> git remote get-url origin
https://redacted/redacted.git

I am not sure what else to try.

@nathan-alden-hp
Copy link
Author

Investigating this: dotnet/sourcelink#488

@MattKotsenas
Copy link
Member

Hi @nathan-alden-hp! As suggested in your later comment, this appears to be a SourceLink issue. We recently released a new version of reproducible-builds that includes a newer version of SourceLink. Would you mind updating and seeing if this issue still repos?

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

No branches or pull requests

2 participants