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

Add support for partial clones #1111

Open
sliekens opened this issue Oct 14, 2023 · 7 comments
Open

Add support for partial clones #1111

sliekens opened this issue Oct 14, 2023 · 7 comments

Comments

@sliekens
Copy link

Hello,

I would like to use treeless clones or blobless clones in my GitHub Actions workflow, but Source Link does not support it.

More info https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/

My workflow

steps:
  - name: Checkout
    uses: actions/checkout@v4
    with:
      fetch-depth: 0 # (no history limit)
      filter: tree:0

  - name: Build
    run: dotnet build

My build fails due to Source Link not supporting this configuration.

/github/home/.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. [/__w/gw2sdk/gw2sdk/GW2SDK/GW2SDK.csproj::TargetFramework=netstandard2.0]
/github/home/.nuget/packages/microsoft.build.tasks.git/1.1.1/build/Microsoft.Build.Tasks.Git.targets(25,5): warning : Unable to locate repository with working directory that contains directory '/__w/gw2sdk/gw2sdk/GW2SDK'. [/__w/gw2sdk/gw2sdk/GW2SDK/GW2SDK.csproj::TargetFramework=netstandard2.0]

@slang25
Copy link

slang25 commented Oct 15, 2023

This might be resolved now in the version which now ships with the .NET 8 SDK (in rc2 at the moment)

private const int SupportedGitRepoFormatVersion = 1;

I've yet to test it

@slang25
Copy link

slang25 commented Oct 15, 2023

Ok, just testing it and it works 🚀 (treeless cloned a repo from fresh, built, checked sourcelink data)
So this time next month I can switch everything to .NET 8 and use treeless clones 🎉

@sliekens
Copy link
Author

@slang25 how do you test it? I can only see v1.1.1 on NuGet which is from 2021?

@slang25
Copy link

slang25 commented Oct 15, 2023

In .NET 8 they are shipping sourcelink as part of the SDK, see here:
https://devblogs.microsoft.com/dotnet/announcing-dotnet-8-preview-5/#sdk-source-link-is-part-of-the-net-sdk
So I think that's the last package version that will exist on NuGet, it will just be baked in from .NET 8 onward.
To test it I installed the .NET 8 rc2 SDK, and it was able to read the treeless clone info (with the new repo format version) with no issue.

@sliekens
Copy link
Author

sliekens commented Oct 15, 2023

Okay I suspect I need to uninstall the package, because I tested on net8.0 RC2 and still got the error from the v1.1.1 package. I feel I should raise a separate issue for that somewhere, because that's not very clear.

image

@slang25
Copy link

slang25 commented Oct 15, 2023

Yeah, you will need to remove the package. If you remove it does it work for you?

@sliekens
Copy link
Author

Yes! Works now that I removed the package reference!

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