Issue running Anki from source on Windows

After following the instructions on the GitHub readme for Windows, I am encountering an error when executing the .\run command. Was hoping someone may be able to shed some light as there didn’t appear to be anything obviously wrong with the set up.

I am guessing something to do with failing to assemble c/blake3_avx512_x86-64_windows_msvc.asm?

The powershell output:

PS C:\dev\git\anki> .\run --verbose_failures

C:\dev\git\anki>set PYTHONWARNINGS=default

C:\dev\git\anki>call .\bazel.bat run  //qt:runanki -k -- --verbose_failures

C:\dev\git\anki>\bazel\bazel  --output_user_root=\bazel\anki run  //qt:runanki -k -- --verbose_failures
INFO: Analyzed target //qt:runanki (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
ERROR: C:/bazel/anki/yweeidlu/external/raze__blake3__1_1_0/BUILD.bazel:40:19: CargoBuildScriptRun external/raze__blake3__1_1_0/blake3_build_script.out_dir failed: (Exit 1): cargo_build_script_runner.exe failed: error executing command bazel-out/x64_windows-opt-exec-2B5CBBC6/bin/external/rules_rust/cargo/cargo_build_script_runner/cargo_build_script_runner.exe ... (remaining 9 argument(s) skipped)
Build script process failed with exit code 1
--stdout:
cargo:rerun-if-env-changed=CARGO_FEATURE_PURE
cargo:rerun-if-env-changed=CARGO_FEATURE_NO_NEON
TARGET = Some("x86_64-pc-windows-msvc")
HOST = Some("x86_64-pc-windows-msvc")
CC_x86_64-pc-windows-msvc = None
CC_x86_64_pc_windows_msvc = None
HOST_CC = None
CC = Some("C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29333/bin/HostX64/x64/cl.exe")
CFLAGS_x86_64-pc-windows-msvc = None
CFLAGS_x86_64_pc_windows_msvc = None
HOST_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
cargo:rerun-if-env-changed=CARGO_FEATURE_PREFER_INTRINSICS
cargo:rerun-if-env-changed=CARGO_FEATURE_PURE
cargo:rustc-cfg=blake3_sse2_ffi
cargo:rustc-cfg=blake3_sse41_ffi
cargo:rustc-cfg=blake3_avx2_ffi
TARGET = Some("x86_64-pc-windows-msvc")
OPT_LEVEL = Some("0")
HOST = Some("x86_64-pc-windows-msvc")
CC_x86_64-pc-windows-msvc = None
CC_x86_64_pc_windows_msvc = None
HOST_CC = None
CC = Some("C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29333/bin/HostX64/x64/cl.exe")
CFLAGS_x86_64-pc-windows-msvc = None
CFLAGS_x86_64_pc_windows_msvc = None
HOST_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
DEBUG = None
running: "C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\VC\\bin\\amd64\\ml64.exe" "-nologo" "-FoC:\\bazel\\anki\\yweeidlu\\execroot\\ankidesktop\\bazel-out/x64_windows-fastbuild/bin/external/raze__blake3__1_1_0/blake3_build_script.out_dir\\c/blake3_sse2_x86-64_windows_msvc.o" "-c" "c/blake3_sse2_x86-64_windows_msvc.asm"
 Assembling: c/blake3_sse2_x86-64_windows_msvc.asm
exit code: 0
running: "C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\VC\\bin\\amd64\\ml64.exe" "-nologo" "-FoC:\\bazel\\anki\\yweeidlu\\execroot\\ankidesktop\\bazel-out/x64_windows-fastbuild/bin/external/raze__blake3__1_1_0/blake3_build_script.out_dir\\c/blake3_sse41_x86-64_windows_msvc.o" "-c" "c/blake3_sse41_x86-64_windows_msvc.asm"
 Assembling: c/blake3_sse41_x86-64_windows_msvc.asm
exit code: 0
running: "C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\VC\\bin\\amd64\\ml64.exe" "-nologo" "-FoC:\\bazel\\anki\\yweeidlu\\execroot\\ankidesktop\\bazel-out/x64_windows-fastbuild/bin/external/raze__blake3__1_1_0/blake3_build_script.out_dir\\c/blake3_avx2_x86-64_windows_msvc.o" "-c" "c/blake3_avx2_x86-64_windows_msvc.asm"
 Assembling: c/blake3_avx2_x86-64_windows_msvc.asm
exit code: 0
AR_x86_64-pc-windows-msvc = None
AR_x86_64_pc_windows_msvc = None
HOST_AR = None
AR = Some("C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29333/bin/HostX64/x64/lib.exe")
running: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29333/bin/HostX64/x64/lib.exe" "-out:C:\\bazel\\anki\\yweeidlu\\execroot\\ankidesktop\\bazel-out/x64_windows-fastbuild/bin/external/raze__blake3__1_1_0/blake3_build_script.out_dir\\libblake3_sse2_sse41_avx2_assembly.a" "-nologo" "C:\\bazel\\anki\\yweeidlu\\execroot\\ankidesktop\\bazel-out/x64_windows-fastbuild/bin/external/raze__blake3__1_1_0/blake3_build_script.out_dir\\c/blake3_sse2_x86-64_windows_msvc.o" "C:\\bazel\\anki\\yweeidlu\\execroot\\ankidesktop\\bazel-out/x64_windows-fastbuild/bin/external/raze__blake3__1_1_0/blake3_build_script.out_dir\\c/blake3_sse41_x86-64_windows_msvc.o" "C:\\bazel\\anki\\yweeidlu\\execroot\\ankidesktop\\bazel-out/x64_windows-fastbuild/bin/external/raze__blake3__1_1_0/blake3_build_script.out_dir\\c/blake3_avx2_x86-64_windows_msvc.o"
exit code: 0
cargo:rustc-link-lib=static=blake3_sse2_sse41_avx2_assembly
cargo:rustc-link-search=native=C:\bazel\anki\yweeidlu\execroot\ankidesktop\bazel-out/x64_windows-fastbuild/bin/external/raze__blake3__1_1_0/blake3_build_script.out_dir
cargo:rerun-if-env-changed=CARGO_FEATURE_PURE
cargo:rerun-if-env-changed=CARGO_FEATURE_PREFER_INTRINSICS
cargo:rustc-cfg=blake3_avx512_ffi
TARGET = Some("x86_64-pc-windows-msvc")
OPT_LEVEL = Some("0")
HOST = Some("x86_64-pc-windows-msvc")
CC_x86_64-pc-windows-msvc = None
CC_x86_64_pc_windows_msvc = None
HOST_CC = None
CC = Some("C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29333/bin/HostX64/x64/cl.exe")
CFLAGS_x86_64-pc-windows-msvc = None
CFLAGS_x86_64_pc_windows_msvc = None
HOST_CFLAGS = None
CFLAGS = None
CRATE_CC_NO_DEFAULTS = None
CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
DEBUG = None
running: "C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\VC\\bin\\amd64\\ml64.exe" "-nologo" "-FoC:\\bazel\\anki\\yweeidlu\\execroot\\ankidesktop\\bazel-out/x64_windows-fastbuild/bin/external/raze__blake3__1_1_0/blake3_build_script.out_dir\\c/blake3_avx512_x86-64_windows_msvc.o" "-c" "c/blake3_avx512_x86-64_windows_msvc.asm"
 Assembling: c/blake3_avx512_x86-64_windows_msvc.asm
c/blake3_avx512_x86-64_windows_msvc.asm(41)pecified size
c/blake3_avx512_x86-64_windows_msvc.asm(41) : error A2008:sc/blake3_avx512_x86-64_windows_msvc.asm(51)pecified size
c/blake3_avx512_x86-64_windows_msvc.asm(51) : error A2008:sc/blake3_avx512_x86-64_windows_msvc.asm(52)pecified size
c/blake3_avx512_x86-64_windows_msvc.asm(52) : error A2008:sc/blake3_avx512_x86-64_windows_msvc.asm(59)pecified size
c/blake3_avx512_x86-64_windows_msvc.asm(59) : error A2008:syntc/blake3_avx512_x86-64_windows_msvc.asm(60)pecified size
c/blake3_avx512_x86-64_windows_msvc.asm(60) : error A2008:sync/blake3_avx512_x86-64_windows_msvc.asm(61)pecified size
c/blake3_avx512_x86-64_windows_msvc.asm(61) : error A2008:sync/blake3_avx512_x86-64_windows_msvc.asm(62)pecified size
c/blake3_avx512_x86-64_windows_msvc.asm(62) : error A2008:sync/blake3_avx512_x86-64_windows_msvc.asm(63)pecified size
c/blake3_avx512_x86-64_windows_msvc.asm(63) : error A2008:sync/blake3_avx512_x86-64_windows_msvc.asm(101)specified size
c/blake3_avx512_x86-64_windows_msvc.asm(101) : error A2008:sync/blake3_avx512_x86-64_windows_msvc.asm(102)specified size
c/blake3_avx512_x86-64_windows_msvc.asm(102) : error A2008:sync/blake3_avx512_x86-64_windows_msvc.asm(103)specified size
c/blake3_avx512_x86-64_windows_msvc.asm(103) : error A2008:sync/blake3_avx512_x86-64_windows_msvc.asm(104)specified size
c/blake3_avx512_x86-64_windows_msvc.asm(104) : error A2008:sync/blake3_avx512_x86-64_windows_msvc.asm(107)specified size
c/blake3_avx512_x86-64_windows_msvc.asm(107) : error A2008:sync/blake3_avx512_x86-64_windows_msvc.asm(108)specified size
c/blake3_avx512_x86-64_windows_msvc.asm(108) : error A2008:sync/blake3_avx512_x86-64_windows_msvc.asm(109)specified size
c/blake3_avx512_x86-64_windows_msvc.asm(109) : error A2008:sync/blake3_avx512_x86-64_windows_msvc.asm(110)specified size
c/blake3_avx512_x86-64_windows_msvc.asm(110) : error A2008:sync/blake3_avx512_x86-64_windows_msvc.asm(121)specified size
c/blake3_avx512_x86-64_windows_msvc.asm(121) : error A2008:sync/blake3_avx512_x86-64_windows_msvc.asm(122)specified size
c/blake3_avx512_x86-64_windows_msvc.asm(122) : error A2008:sync/blake3_avx512_x86-64_windows_msvc.asm(123)specified size
c/blake3_avx512_x86-64_windows_msvc.asm(123) : error A2008:sync/blake3_avx512_x86-64_windows_msvc.asm(124)specified size
c/blake3_avx512_x86-64_windows_msvc.asm(124) : error A2008:sync/blake3_avx512_x86-64_windows_msvc.asm(127)specified size
c/blake3_avx512_x86-64_windows_msvc.asm(127) : error A2008:sync/blake3_avx512_x86-64_windows_msvc.asm(128)specified size
c/blake3_avx512_x86-64_windows_msvc.asm(128) : error A2008:sync/blake3_avx512_x86-64_windows_msvc.asm(129)specified size
c/blake3_avx512_x86-64_windows_msvc.asm(129) : error A2008:sync/blake3_avx512_x86-64_windows_msvc.asm(130)specified size
c/blake3_avx512_x86-64_windows_msvc.asm(130) : error A2008:sync/blake3_avx512_x86-64_windows_msvc.asm(133)specified size
c/blake3_avx512_x86-64_windows_msvc.asm(133) : error A2008:sync/blake3_avx512_x86-64_windows_msvc.asm(134)specified size
c/blake3_avx512_x86-64_windows_msvc.asm(134) : error A2008:sync/blake3_avx512_x86-64_windows_msvc.asm(137)specified size
c/blake3_avx512_x86-64_windows_msvc.asm(137) : error A2008:syntax c/blake3_avx512_x86-64_windows_msvc.asm(138)specified size
c/blake3_avx512_x86-64_windows_msvc.asm(138) : error A2008:syntaxc/blake3_avx512_x86-64_windows_msvc.asm(139)specified size
c/blake3_avx512_x86-64_windows_msvc.asm(139) : error A2008:syntaxc/blake3_avx512_x86-64_windows_msvc.asm(142)specified size
c/blake3_avx512_x86-64_windows_msvc.asm(142) : error A2008:syntax c/blake3_avx512_x86-64_windows_msvc.asm(143)specified size
c/blake3_avx512_x86-64_windows_msvc.asm(143) : error A2008:syntaxc/blake3_avx512_x86-64_windows_msvc.asm(144)specified size
c/blake3_avx512_x86-64_windows_msvc.asm(144) : error A2008:syntaxc/blake3_avx512_x86-64_windows_msvc.asm(147)specified size
c/blake3_avx512_x86-64_windows_msvc.asm(147) : error A2008:syntax c/blake3_avx512_x86-64_windows_msvc.asm(148)specified size
c/blake3_avx512_x86-64_windows_msvc.asm(148) : error A2008:syntaxc/blake3_avx512_x86-64_windows_msvc.asm(149)specified size
c/blake3_avx512_x86-64_windows_msvc.asm(149) : error A2008:syntaxc/blake3_avx512_x86-64_windows_msvc.asm(152)specified size
c/blake3_avx512_x86-64_windows_msvc.asm(152) : error A2008:syntax c/blake3_avx512_x86-64_windows_msvc.asm(153)specified size
c/blake3_avx512_x86-64_windows_msvc.asm(153) : error A2008:syntaxc/blake3_avx512_x86-64_windows_msvc.asm(154)specified size
c/blake3_avx512_x86-64_windows_msvc.asm(154) : error A2008:syntaxc/blake3_avx512_x86-64_windows_msvc.asm(163)specified size
c/blake3_avx512_x86-64_windows_msvc.asm(163) : error A2008:sync/blake3_avx512_x86-64_windows_msvc.asm(164)specified size
c/blake3_avx512_x86-64_windows_msvc.asm(164) : error A2008:sync/blake3_avx512_x86-64_windows_msvc.asm(165)specified size
c/blake3_avx512_x86-64_windows_msvc.asm(165) : error A2008:sync/blake3_avx512_x86-64_windows_msvc.asm(166)specified size
c/blake3_avx512_x86-64_windows_msvc.asm(166) : error A2008:sync/blake3_avx512_x86-64_windows_msvc.asm(169)specified size
c/blake3_avx512_x86-64_windows_msvc.asm(169) : error A2008:sync/blake3_avx512_x86-64_windows_msvc.asm(170)specified size
c/blake3_avx512_x86-64_windows_msvc.asm(170) : error A2008:sync/blake3_avx512_x86-64_windows_msvc.asm(171)specified size
c/blake3_avx512_x86-64_windows_msvc.asm(171) : error A2008:sync/blake3_avx512_x86-64_windows_msvc.asm(172)specified size
c/blake3_avx512_x86-64_windows_msvc.asm(172) : error A2008:sync/blake3_avx512_x86-64_windows_msvc.asm(191)specified size
c/blake3_avx512_x86-64_windows_msvc.asm(191) : error A2008:sync/blake3_avx512_x86-64_windows_msvc.asm(192)specified size
c/blake3_avx512_x86-64_windows_msvc.asm(192) : error A2008:sync/blake3_avx512_x86-64_windows_msvc.asm(193)specified size
c/blake3_avx512_x86-64_windows_msvc.asm(193) : error A2008:sync/blake3_avx512_x86-64_windows_msvc.asm(194)0; stopping assembly
exit code: 1

--stderr:


error occurred: Command "C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\VC\\bin\\amd64\\ml64.exe" "-nologo" "-FoC:\\bazel\\anki\\yweeidlu\\execroot\\ankidesktop\\bazel-out/x64_windows-fastbuild/bin/external/raze__blake3__1_1_0/blake3_build_script.out_dir\\c/blake3_avx512_x86-64_windows_msvc.o" "-c" "c/blake3_avx512_x86-64_windows_msvc.asm" with args "ml64.exe" did not execute successfully (status code exit code: 1).



Target //qt:runanki failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 1.497s, Critical Path: 0.33s
INFO: 2 processes: 2 internal.
FAILED: Build did NOT complete successfully
FAILED: Build did NOT complete successfully

It looks like you may have an older version of Visual Studio installed that is getting used instead of the newer tools.

Thanks, it did appear I had old folders with residual files for vs 11, 12 and also had 13 fully installed.

After removing all three of those, .\run then seemingly picked up to correctly use vs 2019, but throwing errors such as:

ERROR: C:/bazel/anki/yweeidlu/external/rules_rust/util/process_wrapper/BUILD.bazel:3:10: Compiling util/process_wrapper/utils.cc failed: (Exit -1): cl.exe failed: error executing command C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.28.29333/bin/HostX64/x64/cl.exe /nologo /DCOMPILER_MSVC /DNOMINMAX /D_WIN32_WINNT=0x0601 /D_CRT_SECURE_NO_DEPRECATE ... (remaining 28 argument(s) skipped)
Action failed to execute: java.io.IOException: ERROR: src/main/native/windows/process.cc(202): CreateProcessW("C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333\bin\HostX64\x64\cl.exe" /nologo /DCOMPILER_MSVC /DNOMINMAX /D_WIN32_WINNT=0x0601 /D_CRT_SECURE_NO_DEPRECATE /D_CRT_SECURE_NO_WARNINGS /bigobj /Zm500 /EHsc /wd4351 /wd4291 /wd4250 /wd4996 /Iexternal/rules_rust /Ibazel-out/x64_windows-opt-exec-2B5CBBC6/bin/external/rules_rust /Iexternal/bazel_tools /Ibazel-out/x64_windows-opt-exec-2B5CBBC6/bin/external/bazel_tools /DUNICODE /D_UNICODE /showIncludes /MD /O(...)): The system cannot find the file specified.
 (error: 2)

I found I was missing C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.28.29333 as I only had a newer version, so installed that from the vs installer.

Anki now seems to run from source, although it may have corrupted my profile, so made a second one just for development.

I don’t suppose you have a backup of your prefs21.db file from before the trouble? We’ll need to fix any corruption issues, but I can’t seem to reproduce them locally. If you do happen to have a copy, please send it privately, as it contains a sync key inside it.