latex-lsp / texlab

An implementation of the Language Server Protocol for LaTeX
GNU General Public License v3.0
1.54k stars 52 forks source link

aarch64 Linux build failure #1236

Closed doronbehar closed 1 week ago

doronbehar commented 1 week ago

Hello, on NixOS, we distribute Texlab for aarch64 and x86_64-linux, and we encountered this build error on CI when updating to 5.20.0:

++ env CC_AARCH64_UNKNOWN_LINUX_GNU=/nix/store/q1bas0gp3flgciliddhcwbz3ps1pdnb2-gcc-wrapper-13.3.0/bin/cc CXX_AARCH64_UNKNOWN_LINUX_GNU=/nix/store/q1bas0gp3flgciliddhcwbz3ps1pdnb2-gcc-wrapper-13.3.0/bin/c++ CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=/nix/store/q1bas0gp3flgciliddhcwbz3ps1pdnb2-gcc-wrapper-13.3.0/bin/cc CC_AARCH64_UNKNOWN_LINUX_GNU=/nix/store/q1bas0gp3flgciliddhcwbz3ps1pdnb2-gcc-wrapper-13.3.0/bin/cc CXX_AARCH64_UNKNOWN_LINUX_GNU=/nix/store/q1bas0gp3flgciliddhcwbz3ps1pdnb2-gcc-wrapper-13.3.0/bin/c++ CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=/nix/store/q1bas0gp3flgciliddhcwbz3ps1pdnb2-gcc-wrapper-13.3.0/bin/cc CARGO_BUILD_TARGET=aarch64-unknown-linux-gnu HOST_CC=/nix/store/q1bas0gp3flgciliddhcwbz3ps1pdnb2-gcc-wrapper-13.3.0/bin/cc HOST_CXX=/nix/store/q1bas0gp3flgciliddhcwbz3ps1pdnb2-gcc-wrapper-13.3.0/bin/c++ cargo build -j 80 --target aarch64-unknown-linux-gnu --offline --profile release
warning: `/build/.cargo/config` is deprecated in favor of `config.toml`
note: if you need to support cargo 1.38 or earlier, you can symlink `config` to `config.toml`
warning: `/build/.cargo/config` is deprecated in favor of `config.toml`
note: if you need to support cargo 1.38 or earlier, you can symlink `config` to `config.toml`
   Compiling proc-macro2 v1.0.76
   Compiling unicode-ident v1.0.12
   Compiling cfg-if v1.0.0
   Compiling autocfg v1.1.0
   Compiling serde v1.0.210
   Compiling libc v0.2.159
   Compiling memchr v2.7.1
   Compiling crossbeam-utils v0.8.19
   Compiling serde_json v1.0.128
   Compiling itoa v1.0.9
   Compiling either v1.9.0
   Compiling ryu v1.0.15
   Compiling tinyvec_macros v0.1.1
   Compiling rustc-hash v2.0.0
   Compiling rand_core v0.6.4
   Compiling log v0.4.22
   Compiling siphasher v0.3.11
   Compiling regex-syntax v0.8.5
   Compiling text-size v1.1.1
   Compiling rustversion v1.0.15
   Compiling rustc-hash v1.1.0
   Compiling hashbrown v0.14.3
   Compiling smallvec v1.11.1
   Compiling countme v3.0.1
   Compiling once_cell v1.20.2
   Compiling rustix v0.38.37
   Compiling bitflags v1.3.2
   Compiling unicode-case-mapping v0.4.0
   Compiling fnv v1.0.7
   Compiling beef v0.5.2
   Compiling lazy_static v1.4.0
   Compiling anyhow v1.0.89
   Compiling linux-raw-sys v0.4.14
   Compiling unicode-bidi v0.3.13
   Compiling option-ext v0.2.0
   Compiling static_assertions v1.1.0
   Compiling minimal-lexical v0.2.1
   Compiling bitflags v2.4.0
   Compiling same-file v1.0.6
   Compiling percent-encoding v2.3.1
   Compiling unidecode v0.3.0
   Compiling fastrand v2.1.1
   Compiling unicode-segmentation v1.10.1
   Compiling pathdiff v0.2.1
   Compiling scopeguard v1.2.0
   Compiling thiserror v1.0.64
   Compiling crc32fast v1.3.2
   Compiling adler2 v2.0.0
   Compiling parking_lot_core v0.9.8
   Compiling utf8parse v0.2.1
   Compiling rayon-core v1.12.1
   Compiling anstyle v1.0.8
   Compiling anstyle-query v1.0.0
   Compiling colorchoice v1.0.0
   Compiling heck v0.5.0
   Compiling strsim v0.11.0
   Compiling clap_lex v0.7.0
   Compiling file-id v0.2.1
   Compiling encoding_rs v0.8.34
   Compiling tinyvec v1.6.0
   Compiling anstyle-parse v0.2.1
   Compiling line-index v0.0.0 (/build/source/crates/line-index)
   Compiling form_urlencoded v1.2.1
   Compiling rand v0.8.5
   Compiling miniz_oxide v0.8.0
   Compiling walkdir v2.4.0
   Compiling itertools v0.13.0
   Compiling phf_shared v0.11.2
   Compiling fern v0.6.2
   Compiling num-traits v0.2.16
   Compiling memoffset v0.9.0
   Compiling crossbeam-epoch v0.9.15
   Compiling lock_api v0.4.10
   Compiling thread_local v1.1.7
   Compiling anstream v0.6.11
   Compiling fuzzy-matcher v0.3.7
   Compiling phf v0.11.2
   Compiling uds_windows v1.1.0
   Compiling aho-corasick v1.1.1
   Compiling nom v7.1.3
   Compiling clap_builder v4.5.19
   Compiling distro v0.0.0 (/build/source/crates/distro)
   Compiling flate2 v1.0.34
   Compiling crossbeam-channel v0.5.13
   Compiling phf_generator v0.11.2
   Compiling castaway v0.2.2
   Compiling quote v1.0.35
   Compiling phf_codegen v0.11.2
   Compiling rowan v0.15.16
   Compiling syn v2.0.48
   Compiling crossbeam-deque v0.8.3
   Compiling unicode-normalization v0.1.24
   Compiling inotify-sys v0.1.5
   Compiling dirs-sys v0.4.1
   Compiling filetime v0.2.22
   Compiling mio v0.8.11
   Compiling num_cpus v1.16.0
   Compiling inotify v0.9.6
   Compiling dirs v5.0.1
   Compiling threadpool v1.8.1
   Compiling shellexpand v3.1.0
   Compiling parking_lot v0.12.3
   Compiling encoding_rs_io v0.1.7
   Compiling notify v6.1.1
   Compiling idna v0.5.0
   Compiling chrono v0.4.38
   Compiling notify-debouncer-full v0.3.1
   Compiling rayon v1.10.0
   Compiling syntax v0.0.0 (/build/source/crates/syntax)
   Compiling regex-automata v0.4.8
   Compiling bibfmt v0.0.0 (/build/source/crates/bibfmt)
   Compiling versions v6.3.2
   Compiling tempfile v3.13.0
   Compiling logos-codegen v0.14.2
   Compiling serde_derive v1.0.210
   Compiling thiserror-impl v1.0.64
   Compiling serde_repr v0.1.19
   Compiling clap_derive v4.5.18
   Compiling logos-derive v0.14.2
   Compiling logos v0.14.2
   Compiling regex v1.11.0
   Compiling bstr v1.10.0
   Compiling clap v4.5.19
   Compiling parser v0.0.0 (/build/source/crates/parser)
   Compiling titlecase v3.3.0
   Compiling compact_str v0.7.1
   Compiling url v2.5.2
   Compiling isocountry v0.3.2
   Compiling multimap v0.10.0
   Compiling serde_regex v1.1.0
   Compiling human_name v2.0.3
   Compiling completion-data v0.0.0 (/build/source/crates/completion-data)
   Compiling lsp-types v0.95.1
   Compiling lsp-server v0.7.7
   Compiling ipc v0.0.0 (/build/source/crates/ipc)
   Compiling bibtex-utils v0.0.0 (/build/source/crates/bibtex-utils)
   Compiling base-db v0.0.0 (/build/source/crates/base-db)
   Compiling citeproc v0.0.0 (/build/source/crates/citeproc)
   Compiling symbols v0.0.0 (/build/source/crates/symbols)
   Compiling diagnostics v0.0.0 (/build/source/crates/diagnostics)
   Compiling links v0.0.0 (/build/source/crates/links)
   Compiling references v0.0.0 (/build/source/crates/references)
   Compiling highlights v0.0.0 (/build/source/crates/highlights)
   Compiling definition v0.0.0 (/build/source/crates/definition)
   Compiling inlay-hints v0.0.0 (/build/source/crates/inlay-hints)
   Compiling commands v0.0.0 (/build/source/crates/commands)
   Compiling rename v0.0.0 (/build/source/crates/rename)
   Compiling folding v0.0.0 (/build/source/crates/folding)
   Compiling completion v0.0.0 (/build/source/crates/completion)
   Compiling test-utils v0.0.0 (/build/source/crates/test-utils)
   Compiling hover v0.0.0 (/build/source/crates/hover)
   Compiling texlab v5.20.0 (/build/source/crates/texlab)
    Finished `release` profile [optimized] target(s) in 51.47s
Executing cargoInstallPostBuildHook
Finished cargoInstallPostBuildHook
Finished cargoBuildHook
buildPhase completed in 52 seconds
Running phase: checkPhase
Executing cargoCheckHook
++ cargo test -j 80 --profile release --target aarch64-unknown-linux-gnu --offline -- --test-threads=80
warning: `/build/.cargo/config` is deprecated in favor of `config.toml`
note: if you need to support cargo 1.38 or earlier, you can symlink `config` to `config.toml`
warning: `/build/.cargo/config` is deprecated in favor of `config.toml`
note: if you need to support cargo 1.38 or earlier, you can symlink `config` to `config.toml`
   Compiling proc-macro2 v1.0.76
   Compiling unicode-ident v1.0.12
   Compiling cfg-if v1.0.0
   Compiling autocfg v1.1.0
   Compiling memchr v2.7.1
   Compiling serde v1.0.210
   Compiling either v1.9.0
   Compiling libc v0.2.159
   Compiling serde_json v1.0.128
   Compiling crossbeam-utils v0.8.19
   Compiling rustc-hash v2.0.0
   Compiling itoa v1.0.9
   Compiling ryu v1.0.15
   Compiling text-size v1.1.1
   Compiling once_cell v1.20.2
   Compiling log v0.4.22
   Compiling regex-syntax v0.8.5
   Compiling countme v3.0.1
   Compiling rustc-hash v1.1.0
   Compiling hashbrown v0.14.3
   Compiling rustix v0.38.37
   Compiling lazy_static v1.4.0
   Compiling siphasher v0.3.11
   Compiling beef v0.5.2
   Compiling tinyvec_macros v0.1.1
   Compiling rand_core v0.6.4
   Compiling fnv v1.0.7
   Compiling linux-raw-sys v0.4.14
   Compiling rustversion v1.0.15
   Compiling bitflags v2.4.0
   Compiling minimal-lexical v0.2.1
   Compiling fastrand v2.1.1
   Compiling smallvec v1.11.1
   Compiling pathdiff v0.2.1
   Compiling unicode-case-mapping v0.4.0
   Compiling static_assertions v1.1.0
   Compiling same-file v1.0.6
   Compiling bitflags v1.3.2
   Compiling anyhow v1.0.89
   Compiling unicode-bidi v0.3.13
   Compiling unicode-segmentation v1.10.1
   Compiling unidecode v0.3.0
   Compiling option-ext v0.2.0
   Compiling percent-encoding v2.3.1
   Compiling dissimilar v1.0.7
   Compiling scopeguard v1.2.0
   Compiling thiserror v1.0.64
   Compiling crc32fast v1.3.2
   Compiling adler2 v2.0.0
   Compiling utf8parse v0.2.1
   Compiling rayon-core v1.12.1
   Compiling colorchoice v1.0.0
   Compiling anstyle v1.0.8
   Compiling anstyle-query v1.0.0
   Compiling plotters-backend v0.3.5
   Compiling parking_lot_core v0.9.8
   Compiling heck v0.5.0
   Compiling strsim v0.11.0
   Compiling half v1.8.2
   Compiling ciborium-io v0.2.1
   Compiling clap_lex v0.7.0
   Compiling cast v0.3.0
   Compiling anes v0.1.6
   Compiling oorandom v11.1.3
   Compiling file-id v0.2.1
   Compiling encoding_rs v0.8.34
error: linker `aarch64-linux-gnu-gcc` not found
  |
  = note: No such file or directory (os error 2)
error: could not compile `serde_json` (build script) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
error: could not compile `serde` (build script) due to 1 previous error
error: could not compile `parking_lot_core` (build script) due to 1 previous error
error: could not compile `proc-macro2` (build script) due to 1 previous error
error: could not compile `libc` (build script) due to 1 previous error
error: could not compile `rayon-core` (build script) due to 1 previous error
error: could not compile `crossbeam-utils` (build script) due to 1 previous error
error: could not compile `crc32fast` (build script) due to 1 previous error
error: could not compile `anyhow` (build script) due to 1 previous error
error: could not compile `rustix` (build script) due to 1 previous error
error: could not compile `serde` (build script) due to 1 previous error
error: could not compile `thiserror` (build script) due to 1 previous error
error: could not compile `rustversion` (build script) due to 1 previous error
error: could not compile `unicode-case-mapping` (build script) due to 1 previous error
error: builder for '/nix/store/dqqjv01yzp577n8xn9byhxl92izn7q7n-texlab-5.20.0.drv' failed with exit code 101;

It seems that this happens only when building the tests.. Any idea why is that? If not, we might eventually disable the tests only for aarch64.

pfoerster commented 1 week ago

@doronbehar Could it be that the env variable CC_AARCH64_UNKNOWN_LINUX_GNU is only passed to the build command but not the test command?

doronbehar commented 1 week ago

CC_AARCH64_UNKNOWN_LINUX_GNU

Hmm I don't spot a place where we set that variable explicitly. If this is a variable used when cross compiling, I'm pretty sure we don't use it.

pfoerster commented 1 week ago

I think the easiest fix is to remove the .cargo/config.toml file and replace it with environment variables (#1237). Probably, the config.toml messes with the Nix environment.