Build from source - windows

Hi,
I’ve followed these instructions to build anki on windows.

  • Setup a python interpreter, rustc and ninja
  • git clone anki.git
  • .\run.bat

The command fails with this error:

[7/36; 14 active; 3.217s] qt:aqt:data:web:js:vendor:mathjax
FAILED: out/qt/_aqt/data/web/js/vendor/mathjax/a11y/assistive-mml.js out/qt/_aqt/data/web/js/vendor/mathjax/a11y/complexity.js out/qt/_aqt/data/web/js/vendor/mathjax/a11y/explorer.js out/qt/_aqt/data/web/js/vendor/mathjax/a11y/semantic-enrich.js out/qt/_aqt/data/web/js/vendor/mathjax/output/chtml/fonts/woff-v2/MathJax_AMS-Regular.woff out/qt/_aqt/data/web/js/vendor/mathjax/output/chtml/fonts/woff-v2/MathJax_Calligraphic-Bold.woff out/qt/_aqt/data/web/js/vendor/mathjax/output/chtml/fonts/woff-v2/MathJax_Calligraphic-Regular.woff out/qt/_aqt/data/web/js/vendor/mathjax/output/chtml/fonts/woff-v2/MathJax_Fraktur-Bold.woff out/qt/_aqt/data/web/js/vendor/mathjax/output/chtml/fonts/woff-v2/MathJax_Fraktur-Regular.woff out/qt/_aqt/data/web/js/vendor/mathjax/output/chtml/fonts/woff-v2/MathJax_Main-Bold.woff out/qt/_aqt/data/web/js/vendor/mathjax/output/chtml/fonts/woff-v2/MathJax_Main-Italic.woff out/qt/_aqt/data/web/js/vendor/mathjax/output/chtml/fonts/woff-v2/MathJax_Main-Regular.woff out/qt/_aqt/data/web/js/vendor/mathjax/output/chtml/fonts/woff-v2/MathJax_Math-BoldItalic.woff out/qt/_aqt/data/web/js/vendor/mathjax/output/chtml/fonts/woff-v2/MathJax_Math-Italic.woff out/qt/_aqt/data/web/js/vendor/mathjax/output/chtml/fonts/woff-v2/MathJax_Math-Regular.woff out/qt/_aqt/data/web/js/vendor/mathjax/output/chtml/fonts/woff-v2/MathJax_SansSerif-Bold.woff out/qt/_aqt/data/web/js/vendor/mathjax/output/chtml/fonts/woff-v2/MathJax_SansSerif-Italic.woff out/qt/_aqt/data/web/js/vendor/mathjax/output/chtml/fonts/woff-v2/MathJax_SansSerif-Regular.woff out/qt/_aqt/data/web/js/vendor/mathjax/output/chtml/fonts/woff-v2/MathJax_Script-Regular.woff out/qt/_aqt/data/web/js/vendor/mathjax/output/chtml/fonts/woff-v2/MathJax_Size1-Regular.woff out/qt/_aqt/data/web/js/vendor/mathjax/output/chtml/fonts/woff-v2/MathJax_Size2-Regular.woff out/qt/_aqt/data/web/js/vendor/mathjax/output/chtml/fonts/woff-v2/MathJax_Size3-Regular.woff out/qt/_aqt/data/web/js/vendor/mathjax/output/chtml/fonts/woff-v2/MathJax_Size4-Regular.woff out/qt/_aqt/data/web/js/vendor/mathjax/output/chtml/fonts/woff-v2/MathJax_Typewriter-Regular.woff out/qt/_aqt/data/web/js/vendor/mathjax/output/chtml/fonts/woff-v2/MathJax_Vector-Bold.woff out/qt/_aqt/data/web/js/vendor/mathjax/output/chtml/fonts/woff-v2/MathJax_Vector-Regular.woff out/qt/_aqt/data/web/js/vendor/mathjax/output/chtml/fonts/woff-v2/MathJax_Zero.woff out/qt/_aqt/data/web/js/vendor/mathjax/sre/mathmaps/de.json out/qt/_aqt/data/web/js/vendor/mathjax/sre/mathmaps/en.json out/qt/_aqt/data/web/js/vendor/mathjax/sre/mathmaps/es.json out/qt/_aqt/data/web/js/vendor/mathjax/sre/mathmaps/fr.json out/qt/_aqt/data/web/js/vendor/mathjax/sre/mathmaps/hi.json out/qt/_aqt/data/web/js/vendor/mathjax/sre/mathmaps/it.json out/qt/_aqt/data/web/js/vendor/mathjax/sre/mathmaps/nemeth.json out/qt/_aqt/data/web/js/vendor/mathjax/tex-chtml-full.js
out/rust/release/runner.exe rsync  --prefix out/node_modules/mathjax/es5 --inputs a11y\assistive-mml.js a11y\complexity.js a11y\explorer.js a11y\semantic-enrich.js output\chtml\fonts\woff-v2\MathJax_AMS-Regular.woff output\chtml\fonts\woff-v2\MathJax_Calligraphic-Bold.woff output\chtml\fonts\woff-v2\MathJax_Calligraphic-Regular.woff output\chtml\fonts\woff-v2\MathJax_Fraktur-Bold.woff output\chtml\fonts\woff-v2\MathJax_Fraktur-Regular.woff output\chtml\fonts\woff-v2\MathJax_Main-Bold.woff output\chtml\fonts\woff-v2\MathJax_Main-Italic.woff output\chtml\fonts\woff-v2\MathJax_Main-Regular.woff output\chtml\fonts\woff-v2\MathJax_Math-BoldItalic.woff output\chtml\fonts\woff-v2\MathJax_Math-Italic.woff output\chtml\fonts\woff-v2\MathJax_Math-Regular.woff output\chtml\fonts\woff-v2\MathJax_SansSerif-Bold.woff output\chtml\fonts\woff-v2\MathJax_SansSerif-Italic.woff output\chtml\fonts\woff-v2\MathJax_SansSerif-Regular.woff output\chtml\fonts\woff-v2\MathJax_Script-Regular.woff output\chtml\fonts\woff-v2\MathJax_Size1-Regular.woff output\chtml\fonts\woff-v2\MathJax_Size2-Regular.woff output\chtml\fonts\woff-v2\MathJax_Size3-Regular.woff output\chtml\fonts\woff-v2\MathJax_Size4-Regular.woff output\chtml\fonts\woff-v2\MathJax_Typewriter-Regular.woff output\chtml\fonts\woff-v2\MathJax_Vector-Bold.woff output\chtml\fonts\woff-v2\MathJax_Vector-Regular.woff output\chtml\fonts\woff-v2\MathJax_Zero.woff tex-chtml-full.js sre\mathmaps\de.json sre\mathmaps\en.json sre\mathmaps\es.json sre\mathmaps\fr.json sre\mathmaps\hi.json sre\mathmaps\it.json sre\mathmaps\nemeth.json --output-dir out/qt/_aqt/data/web/js/vendor/mathjax
rsync: [Receiver] mkdir "/C/Users/antonio/Projects/github/anki/out/qt/_aqt/data/web/js/vendor/mathjax" failed: No such file or directory (2)
rsync error: error in file IO (code 11) at main.c(789) [Receiver=3.2.7]
Failed with code Some(11): rsync --relative a11y/assistive-mml.js a11y/complexity.js a11y/explorer.js a11y/semantic-enrich.js output/chtml/fonts/woff-v2/MathJax_AMS-Regular.woff output/chtml/fonts/woff-v2/MathJax_Calligraphic-Bold.woff output/chtml/fonts/woff-v2/MathJax_Calligraphic-Regular.woff output/chtml/fonts/woff-v2/MathJax_Fraktur-Bold.woff output/chtml/fonts/woff-v2/MathJax_Fraktur-Regular.woff output/chtml/fonts/woff-v2/MathJax_Main-Bold.woff output/chtml/fonts/woff-v2/MathJax_Main-Italic.woff output/chtml/fonts/woff-v2/MathJax_Main-Regular.woff output/chtml/fonts/woff-v2/MathJax_Math-BoldItalic.woff output/chtml/fonts/woff-v2/MathJax_Math-Italic.woff output/chtml/fonts/woff-v2/MathJax_Math-Regular.woff output/chtml/fonts/woff-v2/MathJax_SansSerif-Bold.woff output/chtml/fonts/woff-v2/MathJax_SansSerif-Italic.woff output/chtml/fonts/woff-v2/MathJax_SansSerif-Regular.woff output/chtml/fonts/woff-v2/MathJax_Script-Regular.woff output/chtml/fonts/woff-v2/MathJax_Size1-Regular.woff output/chtml/fonts/woff-v2/MathJax_Size2-Regular.woff output/chtml/fonts/woff-v2/MathJax_Size3-Regular.woff output/chtml/fonts/woff-v2/MathJax_Size4-Regular.woff output/chtml/fonts/woff-v2/MathJax_Typewriter-Regular.woff output/chtml/fonts/woff-v2/MathJax_Vector-Bold.woff output/chtml/fonts/woff-v2/MathJax_Vector-Regular.woff output/chtml/fonts/woff-v2/MathJax_Zero.woff tex-chtml-full.js sre/mathmaps/de.json sre/mathmaps/en.json sre/mathmaps/es.json sre/mathmaps/fr.json sre/mathmaps/hi.json sre/mathmaps/it.json sre/mathmaps/nemeth.json /C/Users/antonio/Projects/github/anki/out/qt/_aqt/data/web/js/vendor/mathjax
1 Like

Do you have MSYS in your path?

1 Like

Yes, under C:\msys64 (from msys2).
I’ve got this error now:

FAILED: out\qt\_aqt\data\qt\icons\anki.png out\qt\_aqt\data\qt\icons\card-state.svg out\qt\_aqt\data\qt\icons\clock.svg out\qt\_aqt\data\qt\icons\collection.svg out\qt\_aqt\data\qt\icons\deck.svg out\qt\_aqt\data\qt\icons\heart.svg out\qt\_aqt\data\qt\icons\media-record.png out\qt\_aqt\data\qt\icons\notetype.svg out\qt\_aqt\data\qt\icons\tag.svg
out/rust/release/runner.exe run cp -fr 'qt\aqt\data\qt\icons\anki.png' 'qt\aqt\data\qt\icons\card-state.svg' 'qt\aqt\data\qt\icons\clock.svg' 'qt\aqt\data\qt\icons\collection.svg' 'qt\aqt\data\qt\icons\deck.svg' 'qt\aqt\data\qt\icons\heart.svg' 'qt\aqt\data\qt\icons\media-record.png' 'qt\aqt\data\qt\icons\notetype.svg' 'qt\aqt\data\qt\icons\tag.svg' out/qt/_aqt/data/qt/icons
cp: target 'out/qt/_aqt/data/qt/icons' is not a directory
Failed with code Some(1): cp -fr qt\aqt\data\qt\icons\anki.png qt\aqt\data\qt\icons\card-state.svg qt\aqt\data\qt\icons\clock.svg qt\aqt\data\qt\icons\collection.svg qt\aqt\data\qt\icons\deck.svg qt\aqt\data\qt\icons\heart.svg qt\aqt\data\qt\icons\media-record.png qt\aqt\data\qt\icons\notetype.svg qt\aqt\data\qt\icons\tag.svg out/qt/_aqt/data/qt/icons

And the out tree looks like:

tree -L 2 out
out
β”œβ”€β”€ build.ninja
β”œβ”€β”€ buildhash
β”œβ”€β”€ env
β”œβ”€β”€ pycache
β”‚   β”œβ”€β”€ ProgramData
β”‚   └── Users
└── rust
    β”œβ”€β”€ CACHEDIR.TAG
    β”œβ”€β”€ debug
    └── release

7 directories, 4 files
1 Like

You could try running bash tools/install-n2, removing the out/ folder, and then attempting to build again. Does that help?

I sometimes also have to delete the top level node_modules folder. Sometimes when things are being particularly stubborn, I clobber the whole thing with git clean -fdx --exclude=".vscode" but be careful running that command. I exclude my .vscode symlink since I have things rigged up to not use msys.

Good point, removing node_modules can help on Windows, since it’s stored outside of out/.

Ok, thanks all (*). This is the way I solved this:

  • clean ank checkout from ank github
  • Installed Node.js, rust from fresh
  • moved ninja into %USERPROFILE%.cargo\bin
    Set the path to:

SET PATH=^
%USERPROFILE%.cargo\bin^
;C:\WINDOWS;C:\WINDOWS\System32\OpenSSH^
;C:\WINDOWS\System32\Wbem^
;C:\WINDOWS\System32\WindowsPowerShell\v1.0^
;C:\WINDOWS\system32^
;Q:\Program Files\nodejs^
;Q:\Program Files\Git\cmd

And it did work.

(*) This forum seems have few quirks eg. no links allowed and limit to 2 name mentions.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.