latex-lsp / texlab

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

Build on Android/Termux failed #287

Closed ghost closed 2 years ago

ghost commented 4 years ago
cargo install --git https://github.com/latex-lsp/texlab.git
                                                               Updating git repository `https://github.com/latex-lsp/texlab.git`
  Installing texlab v2.2.0 (https://github.com/latex-lsp/texlab.git#36cd8e19)
    Updating crates.io index
    Updating git repository `https://github.com/cormacrelf/citeproc-rs`                                                 Downloaded arrayvec v0.5.1
  Downloaded lock_api v0.3.4                                 Downloaded num-iter v0.1.41
  Downloaded net2 v0.2.34
  Downloaded mio v0.6.22                                     Downloaded num_cpus v1.13.0
  Downloaded num-traits v0.2.12
  Downloaded miniz_oxide v0.3.7                              Downloaded petgraph v0.5.1
  Downloaded proc-macro-hack v0.5.18                         Downloaded proc-macro2 v1.0.19
  Downloaded proc-macro-nested v0.1.6                        Downloaded ryu v1.0.5
  Downloaded proc-macro-error-attr v1.0.3                    Downloaded proc-macro-error v1.0.3
  Downloaded pin-project-lite v0.1.7                         Downloaded pin-project-internal v0.4.23
  Downloaded pin-project v0.4.23
  Downloaded serde_json v1.0.57                              Downloaded stable_deref_trait v1.2.0
  Downloaded structopt-derive v0.4.8                         Downloaded remove_dir_all v0.5.3
  Downloaded sha2 v0.8.2                                     Downloaded thiserror-impl v1.0.20
  Downloaded thiserror v1.0.20
  Downloaded tinyvec v0.3.3
  Downloaded structopt v0.3.15
  Downloaded unicode-xid v0.2.1
  Downloaded version_check v0.9.2                            Downloaded typenum v1.12.0
  Downloaded adler32 v1.2.0                                  Downloaded vec_map v0.8.2
  Downloaded static_assertions v1.1.0                        Downloaded arc-swap v0.4.7
  Downloaded async-trait v0.1.36
  Downloaded cc v1.0.58                                      Downloaded bit-vec v0.6.2
  Downloaded base64 v0.12.3                                  Downloaded bytemuck v1.3.1
  Downloaded crossbeam-queue v0.2.3                          Downloaded error-chain v0.12.3
  Downloaded bit-set v0.5.2                                  Downloaded deflate v0.8.6
  Downloaded bytes v0.5.6                                    Downloaded indexmap v1.5.0
  Downloaded itoa v0.4.6
  Downloaded memoffset v0.5.5
  Downloaded num-integer v0.1.43                             Downloaded unicode-width v0.1.8
  Downloaded ppv-lite86 v0.2.8
  Downloaded num-rational v0.3.0
  Downloaded log v0.4.11
  Downloaded png v0.16.7                                     Downloaded siphasher v0.3.3                                Downloaded mio-uds v0.6.8
  Downloaded syn v1.0.36                                     Downloaded unicode-normalization v0.1.13
  Downloaded serde_repr v0.1.6                               Downloaded aho-corasick v0.7.13
  Downloaded lsp-types v0.74.2
  Downloaded generational-arena v0.2.8                       Downloaded tiff v0.5.0                                     Downloaded fuzzy-matcher v0.3.5                            Downloaded hashbrown v0.8.1
  Downloaded crossbeam-channel v0.4.3                        Downloaded clap v2.33.1
  Downloaded jpeg-decoder v0.1.20                            Downloaded image v0.23.8
  Downloaded tokio v0.2.22                                   Downloaded lexical-core v0.7.4
  Downloaded libc v0.2.74                                    Downloaded 71 crates (4.4 MB) in 5.08s
   Compiling libc v0.2.74                                     Compiling proc-macro2 v1.0.19
   Compiling unicode-xid v0.2.1                               Compiling syn v1.0.36
   Compiling cfg-if v0.1.10                                   Compiling autocfg v1.0.0
   Compiling lazy_static v1.4.0
   Compiling rand_core v0.4.2                                 Compiling autocfg v0.1.7
   Compiling memchr v2.3.3                                    Compiling serde_derive v1.0.114
   Compiling serde v1.0.114                                   Compiling siphasher v0.2.3                                 Compiling log v0.4.11
   Compiling maybe-uninit v2.0.0
   Compiling ryu v1.0.5
   Compiling string_cache_shared v0.3.0
   Compiling version_check v0.9.2
   Compiling serde_json v1.0.57
   Compiling byteorder v1.3.4
   Compiling new_debug_unreachable v1.0.4
   Compiling getrandom v0.1.14
   Compiling itoa v0.4.6                                      Compiling either v1.5.3
   Compiling semver-parser v0.7.0                             Compiling bitflags v1.2.1
   Compiling precomputed-hash v0.1.1
   Compiling proc-macro2 v0.4.30
   Compiling unicode-xid v0.1.0
   Compiling scopeguard v1.1.0
   Compiling syn v0.15.44
   Compiling ppv-lite86 v0.2.8
   Compiling regex-syntax v0.6.18
   Compiling mac v0.1.1                                       Compiling unicode-segmentation v1.6.0
   Compiling proc-macro-hack v0.5.18
   Compiling utf-8 v0.7.5
   Compiling version_check v0.1.5
   Compiling once_cell v1.4.0
   Compiling typenum v1.12.0                                  Compiling siphasher v0.3.3
   Compiling slab v0.4.2
   Compiling lexical-core v0.7.4
   Compiling futures-core v0.3.5
   Compiling unic-common v0.9.0
   Compiling pin-project-internal v0.4.23
   Compiling arrayvec v0.5.1
   Compiling unic-char-range v0.9.0
   Compiling static_assertions v1.1.0
   Compiling rayon-core v1.7.1
   Compiling fixedbitset v0.1.9
   Compiling proc-macro-nested v0.1.6
   Compiling byte-tools v0.3.1
   Compiling xmlparser v0.10.0
   Compiling v_htmlescape v0.4.5                              Compiling futures-sink v0.3.5                              Compiling ordermap v0.3.5
   Compiling same-file v1.0.6
   Compiling fnv v1.0.7
   Compiling strum v0.15.0
   Compiling stable_deref_trait v1.2.0
   Compiling adler32 v1.2.0
   Compiling bit-vec v0.6.2
   Compiling tinyvec v0.3.3
   Compiling void v1.0.2
   Compiling futures-io v0.3.5
   Compiling rustc-hash v1.1.0
   Compiling pin-utils v0.1.0
   Compiling fake-simd v0.1.2
   Compiling strsim v0.9.3
   Compiling arc-swap v0.4.7
   Compiling matches v0.1.8
   Compiling crc32fast v1.2.0
   Compiling stringreader v0.1.1
   Compiling opaque-debug v0.2.3
   Compiling cc v1.0.58
   Compiling bytes v0.5.6                                     Compiling lzw v0.10.0                                      Compiling diff v0.1.12
   Compiling pin-project-lite v0.1.7                          Compiling unicode-width v0.1.8                             Compiling ascii v0.9.3
   Compiling color_quant v1.0.1
   Compiling ucd-trie v0.1.3
   Compiling strsim v0.8.0
   Compiling ansi_term v0.11.0
   Compiling percent-encoding v2.1.0
   Compiling vec_map v0.8.2
   Compiling jni-sys v0.3.0
   Compiling cesu8 v1.1.0
   Compiling remove_dir_all v0.5.3
   Compiling percent-encoding v1.0.1
   Compiling fixedbitset v0.2.0
   Compiling scoped_threadpool v0.1.9
   Compiling smallvec v0.4.5
   Compiling base64 v0.12.3
   Compiling bytemuck v1.3.1                                  Compiling generational-arena v0.2.8
   Compiling thread_local v1.0.1
   Compiling rand_core v0.3.1
   Compiling rand_jitter v0.1.4
   Compiling phf_shared v0.7.24
   Compiling crossbeam-utils v0.7.2
   Compiling memoffset v0.5.5
   Compiling crossbeam-epoch v0.8.2
   Compiling hashbrown v0.8.1                                 Compiling indexmap v1.5.0
   Compiling num-traits v0.2.12
   Compiling rayon v1.3.1
   Compiling num-integer v0.1.43
   Compiling num-iter v0.1.41
   Compiling num-rational v0.3.0
   Compiling rand_chacha v0.1.1
   Compiling rand_pcg v0.1.2
   Compiling rand v0.6.5
   Compiling itertools v0.8.2
   Compiling itertools v0.9.0
   Compiling lock_api v0.3.4
   Compiling semver v0.9.0
   Compiling futf v0.1.4
   Compiling heck v0.3.1
   Compiling futures-task v0.3.5
   Compiling phf_shared v0.8.0
   Compiling nom v5.1.2
   Compiling proc-macro-error-attr v1.0.3
   Compiling error-chain v0.12.3
   Compiling proc-macro-error v1.0.3
   Compiling unic-ucd-version v0.9.0
   Compiling unic-char-property v0.9.0
   Compiling block-padding v0.1.5
   Compiling roxmltree v0.7.3
   Compiling futures-channel v0.3.5
   Compiling walkdir v2.3.1                                   Compiling owning_ref v0.3.3
   Compiling miniz_oxide v0.3.7                               Compiling petgraph v0.4.13
   Compiling bit-set v0.5.2                                   Compiling nom v4.2.3                                       Compiling unreachable v1.0.0
   Compiling unicode-normalization v0.1.13
   Compiling unicode-bidi v0.3.4
   Compiling textwrap v0.11.0
   Compiling gif v0.10.3
   Compiling rand_hc v0.1.0
   Compiling rand_xorshift v0.1.1
   Compiling rand_isaac v0.1.1
   Compiling fuzzy-matcher v0.3.5
   Compiling phf v0.7.24                                      Compiling tendril v0.4.1
   Compiling rustc_version v0.2.3                             Compiling unic-ucd-segment v0.9.0
   Compiling bibutils-sys v0.1.0
   Compiling idna v0.2.0
   Compiling jni v0.11.0
error[E0425]: cannot find value `EXPECTED_JVM_FILENAME` in this scope
  --> /data/data/com.termux/files/home/.cargo/registry/src/github.com-1ecc6299db9ec823/jni-0.11.0/build.rs:91:25
   |                                                       91 |         if file_name == EXPECTED_JVM_FILENAME {
   |                         ^^^^^^^^^^^^^^^^^^^^^ not found in this scope

error: aborting due to previous error
                                                           For more information about this error, try `rustc --explain E0425`.
error: could not compile `jni`.

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: failed to compile `texlab v2.2.0 (https://github.com/latex-lsp/texlab.git#36cd8e19)`, intermediate artifacts can be found at `/data/data/com.termux/files/usr/tmp/cargo-installlR55lM`

Caused by:
  build failed
matu3ba commented 4 years ago

html2d depends on jni. I am not sure, if this problem also persists on other programs using jni.

pfoerster commented 4 years ago

It looks like the problem is related to the html2md crate that we are using to render citations. You can either try compiling without the citation feature for now (but you won't get rendered citations, then) or you can try if compiling html2md (https://gitlab.com/Kanedias/html2md) in isolation is possible.

ghost commented 4 years ago

Compiling Html2md seperated returned the same error :

Cloning into 'html2md'...
remote: Enumerating objects: 345, done.
remote: Counting objects: 100% (345/345), done.
remote: Compressing objects: 100% (181/181), done.
remote: Total 583 (delta 266), reused 218 (delta 160), pack-reused 238
Receiving objects: 100% (583/583), 170.30 KiB | 952.00 KiB/s, done.
Resolving deltas: 100% (391/391), done.
 13  ✔  ls                             1s  ~/t/html2md
html2md
 14  ✔  cd html2md/                         ~/t/html2md
 15   master  ✔  ls                     ~/t/h/html2md
AUTHORS.md       Cargo.toml  README.md  test-samples
CONTRIBUTING.md  LICENSE     src        tests
 16   master  ✔  cargo build --release  ~/t/h/html2md
    Updating crates.io index
  Downloaded phf_codegen v0.8.0
  Downloaded time v0.1.43
  Downloaded error-chain v0.12.4
  Downloaded syn v1.0.38
  Downloaded markup5ever_rcdom v0.1.0
  Downloaded string_cache_codegen v0.5.1
  Downloaded string_cache v0.8.0
  Downloaded xml5ever v0.16.1
  Downloaded markup5ever v0.10.0
  Downloaded jni v0.14.0
  Downloaded html5ever v0.25.1
  Downloaded 11 crates (532.0 KB) in 2.22s
   Compiling libc v0.2.74
   Compiling getrandom v0.1.14
   Compiling proc-macro2 v1.0.19
   Compiling cfg-if v0.1.10
   Compiling unicode-xid v0.2.1
   Compiling ppv-lite86 v0.2.8
   Compiling syn v1.0.38
   Compiling serde v1.0.114
   Compiling siphasher v0.3.3
   Compiling ryu v1.0.5
   Compiling serde_derive v1.0.114
   Compiling serde_json v1.0.57
   Compiling new_debug_unreachable v1.0.4
   Compiling lazy_static v1.4.0
   Compiling itoa v0.4.6
   Compiling log v0.4.11
   Compiling mac v0.1.1
   Compiling memchr v2.3.3
   Compiling utf-8 v0.7.5
   Compiling precomputed-hash v0.1.1
   Compiling byteorder v1.3.4
   Compiling version_check v0.9.2
   Compiling same-file v1.0.6
   Compiling void v1.0.2
   Compiling either v1.5.3
   Compiling ascii v0.9.3
   Compiling jni-sys v0.3.0
   Compiling regex-syntax v0.6.18
   Compiling cesu8 v1.1.0
   Compiling percent-encoding v2.1.0
   Compiling phf_shared v0.8.0
   Compiling thread_local v1.0.1
   Compiling futf v0.1.4
   Compiling walkdir v2.3.1
   Compiling unreachable v1.0.0
   Compiling phf v0.8.0
   Compiling tendril v0.4.1
   Compiling error-chain v0.12.4
   Compiling time v0.1.43
   Compiling aho-corasick v0.7.13
   Compiling quote v1.0.7
   Compiling rand_core v0.5.1
   Compiling combine v3.8.1
   Compiling jni v0.14.0
error[E0425]: cannot find value `EXPECTED_JVM_FILENAME` in this scope
  --> /data/data/com.termux/files/home/.cargo/registry/src/github.com-1ecc6299db9ec823/jni-0.14.0/build.rs:89:25
   |
89 |         if file_name == EXPECTED_JVM_FILENAME {
   |                         ^^^^^^^^^^^^^^^^^^^^^ not found in this scope

error: aborting due to previous error

For more information about this error, try `rustc --explain E0425`.
error: could not compile `jni`.

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed
ghost commented 4 years ago

What would be the compile instruction for excluding the citation feature?

cargo build --release --workspace --exclude ???
efoerster commented 4 years ago

To disable the citation feature, you can compile it with cargo build --no-default-features --features "server".

ghost commented 4 years ago

This time the compilation suceeded and after copying the binary to the termux binary folder it seems to work in vscode (code-server). Thank you for your help!

cargo build --no-default-features --features "server"
   Compiling proc-macro2 v1.0.13
   Compiling autocfg v1.0.0
   Compiling unicode-xid v0.2.0
   Compiling syn v1.0.33
   Compiling libc v0.2.67
   Compiling cfg-if v0.1.10
   Compiling lazy_static v1.4.0
   Compiling semver-parser v0.7.0
   Compiling maybe-uninit v2.0.0
   Compiling memchr v2.3.3
   Compiling version_check v0.9.1
   Compiling serde_derive v1.0.114
   Compiling slab v0.4.2
   Compiling log v0.4.8
   Compiling byteorder v1.3.4
   Compiling getrandom v0.1.14
   Compiling ryu v1.0.3
   Compiling futures-core v0.3.5
   Compiling bitflags v1.2.1
   Compiling serde v1.0.114
   Compiling adler32 v1.0.4
   Compiling rayon-core v1.7.1
   Compiling proc-macro-nested v0.1.3
   Compiling futures-sink v0.3.5
   Compiling scopeguard v1.1.0
   Compiling once_cell v1.4.0
   Compiling either v1.5.3
   Compiling crc32fast v1.2.0
   Compiling serde_json v1.0.55
   Compiling ppv-lite86 v0.2.6
   Compiling stable_deref_trait v1.1.1
   Compiling arrayvec v0.4.12
   Compiling arc-swap v0.4.4
   Compiling pin-utils v0.1.0
   Compiling matches v0.1.8
   Compiling smallvec v1.4.0
   Compiling futures-io v0.3.5
   Compiling bytes v0.5.4
   Compiling unicode-segmentation v1.6.0
   Compiling pin-project-lite v0.1.4
   Compiling lzw v0.10.0
   Compiling nodrop v0.1.14
   Compiling unicode-width v0.1.7
   Compiling itoa v0.4.5
   Compiling color_quant v1.0.1
   Compiling percent-encoding v2.1.0
   Compiling ansi_term v0.11.0
   Compiling vec_map v0.8.1
   Compiling regex-syntax v0.6.18
   Compiling static_assertions v0.3.4
   Compiling strsim v0.8.0
   Compiling remove_dir_all v0.5.2
   Compiling base64 v0.12.1
   Compiling fixedbitset v0.2.0
   Compiling scoped_threadpool v0.1.9
   Compiling bytemuck v1.2.0
   Compiling texlab v2.2.0 (/data/data/com.termux/files/home/texlab/texlab)
   Compiling thread_local v1.0.1
   Compiling semver v0.9.0
   Compiling crossbeam-utils v0.7.2
   Compiling crossbeam-epoch v0.8.2
   Compiling num-traits v0.2.11
   Compiling num-integer v0.1.42
   Compiling rayon v1.3.1
   Compiling num-rational v0.2.4
   Compiling num-iter v0.1.40
   Compiling indexmap v1.3.2
   Compiling proc-macro-error-attr v1.0.2
   Compiling proc-macro-error v1.0.2
   Compiling nom v5.1.2
   Compiling inflate v0.4.5
   Compiling miniz_oxide v0.3.6
   Compiling futures-channel v0.3.5
   Compiling futures-task v0.3.5
   Compiling itertools v0.9.0
   Compiling owning_ref v0.3.3
   Compiling unicode-bidi v0.3.4
   Compiling unicode-normalization v0.1.12
   Compiling heck v0.3.1
   Compiling textwrap v0.11.0
   Compiling gif v0.10.3
   Compiling fuzzy-matcher v0.3.4
   Compiling rustc_version v0.2.3
   Compiling idna v0.2.0
   Compiling aho-corasick v0.7.10
   Compiling smallvec v0.6.13
   Compiling fern v0.6.0
   Compiling memoffset v0.5.3
   Compiling lexical-core v0.6.2
   Compiling iovec v0.1.4
   Compiling net2 v0.2.33
   Compiling num_cpus v1.12.0
   Compiling rand v0.4.6
   Compiling signal-hook-registry v1.2.0
   Compiling atty v0.2.11
   Compiling quote v1.0.7
   Compiling deflate v0.8.4
   Compiling tiff v0.4.0
   Compiling regex v1.3.9
   Compiling crossbeam-queue v0.2.1
   Compiling rand_core v0.5.1
   Compiling mio v0.6.21
   Compiling clap v2.33.0
   Compiling parking_lot_core v0.2.14
   Compiling png v0.16.2
   Compiling rand_chacha v0.2.2
   Compiling parking_lot v0.4.8
   Compiling mio-uds v0.6.7
   Compiling titlecase v1.1.0
   Compiling rand v0.7.3
   Compiling crossbeam-deque v0.7.3
   Compiling chashmap v2.2.2
   Compiling uuid v0.8.1
   Compiling tempfile v3.1.0
   Compiling syn-mid v0.5.0
   Compiling proc-macro-hack v0.5.11
   Compiling pin-project-internal v0.4.16
   Compiling tokio-macros v0.2.5
   Compiling serde_repr v0.1.5
   Compiling async-trait v0.1.31
   Compiling thiserror-impl v1.0.19
   Compiling jsonrpc-derive v0.1.0 (/data/data/com.termux/files/home/texlab/texlab/crates/jsonrpc_derive)
   Compiling jpeg-decoder v0.1.18
   Compiling futures-macro v0.3.5
   Compiling tokio v0.2.21
   Compiling image v0.23.4
   Compiling structopt-derive v0.4.7
   Compiling thiserror v1.0.19
   Compiling pin-project v0.4.16
   Compiling futures-util v0.3.5
   Compiling tokio-util v0.3.1
   Compiling structopt v0.3.14
   Compiling futures-executor v0.3.5
   Compiling futures v0.3.5
   Compiling url v2.1.1
   Compiling petgraph v0.5.0
   Compiling jsonrpc v0.1.0 (/data/data/com.termux/files/home/texlab/texlab/crates/jsonrpc)
   Compiling lsp-types v0.74.1
warning: unused return value of `std::mem::replace` that must be used
  --> src/tex/miktex.rs:36:9
   |
36 |         mem::replace(&mut *self.resolver.lock().await, Arc::new(resolver));
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(unused_must_use)]` on by default
   = note: if you don't need the old value, you can just assign the new value directly

warning: unused return value of `std::mem::replace` that must be used
  --> src/tex/texlive.rs:34:9
   |
34 |         mem::replace(&mut *self.resolver.lock().await, Arc::new(resolver));
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: if you don't need the old value, you can just assign the new value directly

warning: 2 warnings emitted

    Finished dev [unoptimized + debuginfo] target(s) in 4m 40s