to be honest, until I encountered this problem, I didn't know about gix, but it seems to cause problem when I build docs. below is the commands to reproduce this error:
❯ echo $env.PROCESSOR_ARCHITECTURE
AMD64
❯ ver
Microsoft Windows [Version 10.0.19045.4412]
❯ cargo --version
cargo 1.80.0-nightly (4de0094ac 2024-05-09)
❯ cargo new --lib dummy
Creating library `dummy` package
note: see more `Cargo.toml` keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
❯ cd dummy\
❯ git add .
❯ cargo doc
error: failed to determine package fingerprint for documenting dummy v0.1.0 (Y:\dummy)
Caused by:
failed to determine the most recently modified file in Y:\dummy
Caused by:
failed to determine list of files in Y:\dummy
Caused by:
The value for `core.excludesFile` could not be read from configuration
Caused by:
path is missing
by grepping through the code base for the error messages and some experiments, I managed to pinpoint the failed code is at this line, where the repo.walkdir_iter() method returns Err:
|
.dirwalk_iter(index.clone(), pathspec, Default::default(), options)? |
I did some investigation of the gix code, and it turns out my git config file contains a blank value for core.excludesfile which gix treats differently than a missing core.excludesfile entry.
I opened an issue for gix GitoxideLabs/gitoxide#1370, but I want to at least mention it here, in case someone else enountered similar problem and want to search for reasons.
also, I'm not sure if this is considered a bug for gix or not, but at least it behaves differently from libgit2. when I browse the source code of cargo here:
|
if self |
|
.gctx |
|
.get_env("__CARGO_GITOXIDE_DISABLE_LIST_FILES") |
|
.ok() |
|
.as_deref() |
|
== Some("1") |
|
{ |
|
self.discover_git_repo(root)?.map(Git2OrGixRepository::Git2) |
|
} else { |
|
self.discover_gix_repo(root)?.map(Git2OrGixRepository::Gix) |
|
} |
I discovered this __CARGO_GITOXIDE_DISABLE_LIST_FILES environment variable )(undocumented anywhere) so I tried to set it, and then cargo doc runs without showing any errors.
to be honest, until I encountered this problem, I didn't know about
gix, but it seems to cause problem when I build docs. below is the commands to reproduce this error:by grepping through the code base for the error messages and some experiments, I managed to pinpoint the failed code is at this line, where the
repo.walkdir_iter()method returnsErr:cargo/src/cargo/sources/path.rs
Line 519 in 8d68ed4
I did some investigation of the
gixcode, and it turns out my git config file contains a blank value forcore.excludesfilewhich gix treats differently than a missingcore.excludesfileentry.I opened an issue for gix GitoxideLabs/gitoxide#1370, but I want to at least mention it here, in case someone else enountered similar problem and want to search for reasons.
also, I'm not sure if this is considered a bug for gix or not, but at least it behaves differently from
libgit2. when I browse the source code ofcargohere:cargo/src/cargo/sources/path.rs
Lines 145 to 155 in 8d68ed4
I discovered this
__CARGO_GITOXIDE_DISABLE_LIST_FILESenvironment variable )(undocumented anywhere) so I tried to set it, and thencargo docruns without showing any errors.