Rust / Tauri build error (failed to determine package fingerprint for build script for app v0.1.0) That seems to be caused by .git directory

I have been facing the following error, which I believe is thrown some of the time when my rust code is to built. (I have been able to run my Rust tests, but for some reason have been unable to run cargo check, and cargo check fails when my IDE runs it on startup.)

I am also getting this error when running tauri-dev / tauri-build. (sometimes am able to run tauri-dev, but never tauri-build)

This is the error message I receive when running any command (npm run tauri-dev/tauri build, cargo check/build)

error: failed to determine package fingerprint for build script for app v0.1.0 (C:{project path}src-tauri)
An I/O error happened. Please make sure you can access the file.

By default, if your project contains a build script, cargo scans all files in
it to determine whether a rebuild is needed. If you don't expect to access the
file, specify `rerun-if-changed` in your build script.
See https://doc.rust-lang.org/cargo/reference/build-scripts.html#rerun-if-changed for more information.

Caused by:
  failed to determine the most recently modified file in C:{project path}src-tauri

Caused by:
  failed to determine list of files in C:{project path}src-tauri

Caused by:
  Could not read repository exclude

Caused by:
  The filename, directory name, or volume label syntax is incorrect. (os error 123)

Versions for anything that could matter:

  • Node.js version: 21.5.0
  • NPM version: 10.2.4
  • git version: 2.46.0.windows.1
  • rustup: 1.27.1
  • rustc: 1.81.0
  • tauri-build: 1.5.3
  • tauri-apps/cli: 1.6.0
  • tauri-apps/api: 1

I would be happy to provide any other logs, although none have been notable, for instance my NPM logs are completely standard.

An important thing to note is that the actual code in this project does not matter. It will not build regardless of the content (as long as I have the basic tauri main, & build script, along with boilerplate tauri frontend) and the file structure is the same. Additionally, if I copy the project out of its original directory to another, with no changes to the code itself, everything is able to be ran as normal.

The final observation I have made before coming to Stack Overflow, is that I am able to “fix” this error by deleting any of the integral .git files (HEAD/INDEX/..etc). This lasts only as long as I don’t commit my changes, and breaks the moment I link back to remote, create a new repository or pull/push. (Presumably because it “fixes” my .git directory)

I AM able to continue working on this project, although having to fix my .git directory every time will be more than a slight annoyance, and I would prefer to continue using GitHub. (Please don’t recommend using other repository solutions, thanks!)

I have solved my own problem – it was a problem specific to my own git setup, although I will post the answer here just in case anyone else has this problem;

As I had thought, the problem I was facing was an issue with my git configuration, which stuck around even when I uninstalled and reinstalled.

I had tried to set up a wildcard git ignore for .env files, which created an impossible match for regex.

I added this in my %USERPROFILE%.gitconfig core.excludesFile section with this command:

git config --global core.excludesFile "%USERPROFILE%.gitignore"

I noticed this when reinstalling the repository, as it was complaining about the impossible match.

Presumably the reason my project is building without a proper .git is that It does not link back to %USERPROFILE%.gitignore , and thus has no link to the impossible match. Regardless, deleting the problematic line has fixed this problem.

If you’re in my position and have not set global variables, I could recommend deleting everything in your own .gitignore folder, as I noted when running tauri dev –verbose, it will parse each expression when building your project.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật