Can't build Anki on VS Code (w/Cursor)

Tried with Ninja, n2, followed the instructions for msys2 and rsync. Deleted the project file and recloned the repo multiple times, and same output. Not sure what to do. Would appreciate any help.

Cursor seems to think that

The error appears to be related to the Ninja build system configuration. The specific error is:

n2: error: parse error: unexpected variable “hide_success”

out\build.ninja:13: hide_success = 1

This suggests that there’s an issue in your build.ninja file where the variable hide_success is not being recognized as valid. This could be because:

  • The variable name is not supported in your version of Ninja

  • There’s a syntax error in how the variable is being defined

  • The variable is being used in an incorrect context

To fix this, you could try:

  • Remove the hide_success = 1 line from your build.ninja file
    Full error output below
Compiling windows_x86_64_msvc v0.52.6
   Compiling proc-macro2 v1.0.88
   Compiling unicode-ident v1.0.13
   Compiling jobserver v0.1.32
   Compiling shlex v1.3.0
   Compiling version_check v0.9.5
   Compiling cfg-if v1.0.0
   Compiling pin-project-lite v0.2.14
   Compiling bytes v1.7.2
   Compiling pkg-config v0.3.31
   Compiling futures-core v0.3.31
   Compiling once_cell v1.20.2
   Compiling itoa v1.0.11
   Compiling rustls-pki-types v1.10.0
   Compiling fnv v1.0.7
   Compiling cc v1.1.31
   Compiling pin-utils v0.1.0
   Compiling typenum v1.17.0
   Compiling futures-task v0.3.31
   Compiling getrandom v0.2.15
   Compiling futures-util v0.3.31
   Compiling spin v0.9.8
   Compiling untrusted v0.9.0
   Compiling unicase v2.6.0
   Compiling generic-array v0.14.7
   Compiling http v1.1.0
   Compiling httparse v1.9.5
   Compiling windows-targets v0.52.6
   Compiling windows-sys v0.52.0
   Compiling windows-sys v0.59.0
   Compiling heck v0.5.0
   Compiling try-lock v0.2.5
   Compiling rustls v0.23.15
   Compiling quote v1.0.37
   Compiling tinyvec_macros v0.1.1
   Compiling either v1.13.0
   Compiling windows_x86_64_msvc v0.48.5
   Compiling syn v2.0.82
   Compiling serde v1.0.210
   Compiling tinyvec v1.8.0
   Compiling http-body v1.0.1
   Compiling want v0.3.1
   Compiling tracing-core v0.1.32
   Compiling futures-channel v0.3.31
   Compiling thiserror v1.0.64
   Compiling zeroize v1.8.1
   Compiling anstyle v1.0.8
   Compiling subtle v2.6.1
   Compiling smallvec v1.13.2
   Compiling percent-encoding v2.3.1
   Compiling utf8parse v0.2.2
   Compiling libc v0.2.161
   Compiling form_urlencoded v1.2.1
   Compiling anstyle-parse v0.2.5
   Compiling unicode-normalization v0.1.24
   Compiling tracing v0.1.40
   Compiling mime_guess v2.0.5
   Compiling ring v0.17.8
   Compiling zstd-sys v2.0.13+zstd.1.5.6
   Compiling lzma-sys v0.1.20
   Compiling windows-result v0.2.0
   Compiling rustls-pemfile v2.2.0
   Compiling zstd-safe v7.2.1
   Compiling tower-service v0.3.3
   Compiling serde_json v1.0.132
   Compiling camino v1.1.9
   Compiling powerfmt v0.2.0
   Compiling adler2 v2.0.0
   Compiling is_terminal_polyfill v1.70.1
   Compiling colorchoice v1.0.2
   Compiling ryu v1.0.18
   Compiling rustix v0.38.37
   Compiling unicode-bidi v0.3.17
   Compiling miniz_oxide v0.8.0
   Compiling deranged v0.3.11
   Compiling windows-strings v0.1.0
   Compiling idna v0.5.0
   Compiling mio v1.0.2
   Compiling socket2 v0.5.7
   Compiling anstyle-wincon v3.0.4
   Compiling schannel v0.1.26
   Compiling anstyle-query v1.1.1
   Compiling errno v0.3.9
   Compiling anstream v0.6.15
   Compiling rustls-native-certs v0.8.0
   Compiling windows-targets v0.48.5
   Compiling crypto-common v0.1.6
   Compiling block-buffer v0.10.4
   Compiling webpki-roots v0.26.6
   Compiling crc32fast v1.4.2
   Compiling num-conv v0.1.0
   Compiling bitflags v2.6.0
   Compiling tokio-macros v2.4.0
   Compiling thiserror-impl v1.0.64
   Compiling snafu-derive v0.8.5
   Compiling strsim v0.11.1
   Compiling time-core v0.1.2
   Compiling futures-sink v0.3.31
   Compiling memchr v2.7.4
   Compiling mime v0.3.17
   Compiling anyhow v1.0.90
   Compiling clap_lex v0.7.2
   Compiling fastrand v2.1.1
   Compiling tokio v1.40.0
   Compiling tempfile v3.13.0
   Compiling clap_builder v4.5.20
   Compiling rustls-webpki v0.102.8
   Compiling time v0.3.36
   Compiling clap_derive v4.5.18
   Compiling flate2 v1.0.34
   Compiling snafu v0.8.5
   Compiling digest v0.10.7
   Compiling windows-sys v0.48.0
   Compiling serde_urlencoded v0.7.1
   Compiling winapi-util v0.1.9
   Compiling filetime v0.2.25
   Compiling url v2.5.2
   Compiling home v0.5.9
   Compiling windows-registry v0.2.0
   Compiling http-body-util v0.1.2
   Compiling itertools v0.13.0
   Compiling hyper v1.5.0
   Compiling tokio-util v0.7.12
   Compiling tokio-socks v0.5.2
   Compiling sync_wrapper v1.0.1
   Compiling base64 v0.22.1
   Compiling scopeguard v1.2.0
   Compiling tokio-rustls v0.26.0
   Compiling ipnet v2.10.1
   Compiling cpufeatures v0.2.14
   Compiling byteorder v1.5.0
   Compiling log v0.4.22
   Compiling hyper-util v0.1.9
   Compiling runner v0.0.0 (C:\Users\jbeli\.cursor-tutor\AnkiDory\build\runner)
   Compiling zip v0.6.6
   Compiling sha2 v0.10.8
   Compiling anki_process v0.0.0 (C:\Users\jbeli\.cursor-tutor\AnkiDory\rslib\process)
   Compiling hyper-rustls v0.27.3
   Compiling reqwest v0.12.8
   Compiling junction v1.2.0
   Compiling clap v4.5.20
   Compiling anki_io v0.0.0 (C:\Users\jbeli\.cursor-tutor\AnkiDory\rslib\io)
   Compiling which v5.0.0
   Compiling tar v0.4.42
   Compiling termcolor v1.4.1
   Compiling xz2 v0.1.7
   Compiling zstd v0.13.2
    Finished `release` profile [optimized] target(s) in 55.28s
   Compiling windows_x86_64_msvc v0.52.6
   Compiling proc-macro2 v1.0.88
   Compiling unicode-ident v1.0.13
   Compiling windows_x86_64_msvc v0.48.5
   Compiling memchr v2.7.4
   Compiling once_cell v1.20.2
   Compiling rustix v0.38.37
   Compiling heck v0.5.0
   Compiling camino v1.1.9
   Compiling regex-syntax v0.8.5
   Compiling either v1.13.0
   Compiling fastrand v2.1.1
   Compiling bitflags v2.6.0
   Compiling anyhow v1.0.90
   Compiling cfg-if v1.0.0
   Compiling log v0.4.22
   Compiling itertools v0.13.0
   Compiling windows-targets v0.52.6
   Compiling windows-sys v0.59.0
   Compiling windows-sys v0.52.0
   Compiling windows-targets v0.48.5
   Compiling aho-corasick v1.1.3
   Compiling windows-sys v0.48.0
   Compiling bstr v1.10.0
   Compiling dunce v1.0.5
   Compiling quote v1.0.37
   Compiling winapi-util v0.1.9
   Compiling regex-automata v0.4.8
   Compiling syn v2.0.82
   Compiling same-file v1.0.6
   Compiling tempfile v3.13.0
   Compiling maplit v1.0.2
   Compiling walkdir v2.5.0
   Compiling num_cpus v1.16.0
   Compiling errno v0.3.9
   Compiling home v0.5.9
   Compiling which v5.0.0
   Compiling globset v0.4.15
   Compiling snafu-derive v0.8.5
   Compiling snafu v0.8.5
   Compiling anki_io v0.0.0 (C:\Users\jbeli\.cursor-tutor\AnkiDory\rslib\io)
   Compiling ninja_gen v0.0.0 (C:\Users\jbeli\.cursor-tutor\AnkiDory\build\ninja_gen)
   Compiling configure v0.0.0 (C:\Users\jbeli\.cursor-tutor\AnkiDory\build\configure)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 35.58s
     Running `tools\\..\out\rust\debug\configure.exe`
n2: error: parse error: unexpected variable "hide_success"
out\build.ninja:13:   hide_success = 1
                                  ^

    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.36s
     Running `tools\\..\out\rust\debug\configure.exe`
n2: error: parse error: unexpected variable "hide_success"
out\build.ninja:13:   hide_success = 1
                                  ^


Build failed.
1 Like

Did you install n2 using the included tools/install-n2 script? Anki needs this patch: Add hide_success and hide_last_line options · ankitects/n2@3b725cf · GitHub

2 Likes