dotnet / reproducible-builds

Contains the DotNet.ReproducibleBuilds package
MIT License
168 stars 18 forks source link

Old version of Microsoft.Build.Tasks.Git cannot read git repo (GitHub) #39

Open chklauser opened 2 weeks ago

chklauser commented 2 weeks ago

Our project references DotNet.ReproducibleBuild in version 1.1.1. This package pulls in a rather old version of Microsoft.Build.Tasks.Git (1.1.1). With this version, our build fails on GitHub in combination with the default options of the actions/checkout@v4 action

Our GH actions pipeline

on:
  release:
    types:
    - published

# ...

jobs:
  release:
    steps:
    - uses: actions/checkout@v4

The error message

/root/.nuget/packages/microsoft.build.tasks.git/1.1.1/build/Microsoft.Build.Tasks.Git.targets(25,5): error : Error reading git repository information: Unsupported repository version 1. Only versions up to 0 are supported.

Workaround

Explicitly reference a more recent version of Microsoft.Build.Tasks.Git

<PackageVersion Include="Microsoft.Build.Tasks.Git" Version="8.0.0" PrivateAssets="All" />
MattKotsenas commented 3 days ago

Thanks for the issue @chklauser . We released a new version today that includes a newer version of SourceLink, and thus a newer version of Microsoft.Build.Tasks.Git. If you update to the latest version you should be able to remove your workaround.

If you run into issues, please let us know. Thanks!