Skip to content

Unable to build projects after updating to 1.46.0 when our repo is using sparse-checkouts #8746

Closed

Description

Problem
Since updating to 1.46.0, for some reason we can't build our application if a git clone is using sparse checkouts.

Steps

c:\projects>cargo init foo

c:\projects>cd foo\                                                                                                                                                                                                                                                                                                                         

c:\projects\foo>git init                                                                                                                                              Initialized empty Git repository in C:/projects/foo/.git/                                                                                                                                                                                                                                                                                   

c:\projects\foo>mkdir bar                                                                                                                                                                                                                                                                                                                   

c:\projects\foo>touch bar/test.txt                                                                                                                                                                                                                                                                                                          

c:\projects\foo>echo fn main() { () } > build.rs                                                                                                                                                                                                                                                                                          

c:\projects\foo>vim build.rs

c:\projects\foo>ls
bar  build.rs  Cargo.toml  src                                                                                                                                                                                                                                                                                                              

c:\projects\foo>cargo run
   Compiling foo v0.1.0 (C:\projects\foo)
    Finished dev [unoptimized + debuginfo] target(s) in 1.31s
     Running `target\x86_64-pc-windows-msvc\debug\foo.exe`
Hello, world!


c:\projects\foo>git sparse-checkout init --cone

c:\projects\foo>git sparse-checkout add src

c:\projects\foo>cargo run
error: failed to determine package fingerprint for build script for foo v0.1.0 (C:\projects\foo)

Caused by:
  failed to determine the most recently modified file in c:\projects\foo

Caused by:
  failed to determine list of files in c:\projects\foo

Caused by:
  did not expect repo at c:/projects/foo/.git/ to be bare

c:\projects\foo>

Possible Solution(s)
I have no idea. Sorry!

Notes

Output of cargo version: cargo 1.46.0 (149022b 2020-07-17)

As far as I can tell this really breaks things in a solid way. Just disabling sparse-checkout after this isn't enough to recover.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

A-gitArea: anything dealing with gitC-bugCategory: bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions