Error 'git failed' when building on Win10

Tried to run anki-2.1.55 from source on Windows, error message:

  Finished dev [unoptimized + debuginfo] target(s) in 2m 14s
thread 'main' panicked at 'git failed', build\runner\src\build.rs:154:5

I tried to follow the instructions under “Building from source”. I’m running Windows 10 Home Version 21H2, and Developer Mode is enabled.

Did you install msys2, and git inside it?

MSYS2 was installed to C:\msys64\. C:\msys64\usr\bin was added to the path variable. The command pacman -S git rsync in MSYS2 returns warning: git-2.39.0-1 is up to date and warning: rsync-3.2.7-1 is up to date.

“Build Tools for Visual Studio 2019” was uninstalled, replaced with “Visual Studio 2022”.


By the way, I tried build bc6975973e and got the same error message.

In addition, .\tools\runopt no longer works on Windows, because the .bat file no longer exists in 2.1.55.

Is there any text around the error message that may indicate the problem? If you look up the mentioned build.rs:154 you’ll see the command it invokes - what happens when you invoke it manually?

Oops, I made a dumb mistake. I forgot to initialize the git repository in the project directory.

Thank you for your time. Anki 2.1.55 build successful.


PS: .\tools\runopt.bat doesn’t exist in 2.1.55, so Windows users have to set variables manually.

Nobody’s got around to adding it yet - a PR would be welcome.