Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] fails to build on android termux #376

Closed
phanirithvij opened this issue Aug 26, 2023 · 6 comments
Closed

[BUG] fails to build on android termux #376

phanirithvij opened this issue Aug 26, 2023 · 6 comments
Labels
bug Something isn't working

Comments

@phanirithvij
Copy link

Describe the bug
^^ Title

To Reproduce
Steps to reproduce the behavior:

  1. cargo install --git https://github.com/tversteeg/emplace

Expected behavior
Works on termux as this issue was fixed already #151 (did it get re introduced?)

Desktop (please complete the following information):

  • OS: [e.g. Linux] Android 11, termux
  • Shell: [e.g Bash] fish

Additional context
Error log

    Updating git repository `https://github.com/tversteeg/emplace`
  Installing emplace v1.4.2 (https://github.com/tversteeg/emplace#c655442b)
    Updating crates.io index
   Compiling libc v0.2.147
   Compiling proc-macro2 v1.0.66
   Compiling unicode-ident v1.0.11
   Compiling cfg-if v1.0.0
   Compiling rustix v0.38.9
   Compiling syn v1.0.109
   Compiling autocfg v1.1.0
   Compiling bitflags v2.4.0
   Compiling memchr v2.5.0
   Compiling linux-raw-sys v0.4.5
   Compiling proc-macro-hack v0.5.20+deprecated
   Compiling indexmap v1.9.3
   Compiling quote v1.0.33
   Compiling ppv-lite86 v0.2.17
   Compiling syn v2.0.29
   Compiling serde v1.0.188
   Compiling getrandom v0.2.10
   Compiling cc v1.0.83
   Compiling errno v0.3.2
   Compiling rand_core v0.6.4
   Compiling rand_chacha v0.3.1
   Compiling sys-info v0.9.1
The following warnings were emitted during compilation:

warning: c/linux.c:96:11: error: call to undeclared library function 'index' with type 'char *(const char *, int)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
warning:                 mount = index(procline, ' ');
warning:                         ^
warning: c/linux.c:96:11: note: include the header <strings.h> or explicitly provide a declaration for 'index'
warning: 1 error generated.

error: failed to run custom build command for `sys-info v0.9.1`

Caused by:
  process didn't exit successfully: `/data/data/com.termux/files/usr/tmp/cargo-installLP1bMz/release/build/sys-info-781b43d978978525/build-script-build` (exit status: 1)
  --- stdout
  TARGET = Some("aarch64-linux-android")
  OPT_LEVEL = Some("3")
  HOST = Some("aarch64-linux-android")
  cargo:rerun-if-env-changed=CC_aarch64-linux-android
  CC_aarch64-linux-android = None
  cargo:rerun-if-env-changed=CC_aarch64_linux_android
  CC_aarch64_linux_android = None
  cargo:rerun-if-env-changed=HOST_CC
  HOST_CC = None
  cargo:rerun-if-env-changed=CC
  CC = None
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("false")
  CARGO_CFG_TARGET_FEATURE = Some("neon")
  cargo:rerun-if-env-changed=CFLAGS_aarch64-linux-android
  CFLAGS_aarch64-linux-android = None
  cargo:rerun-if-env-changed=CFLAGS_aarch64_linux_android
  CFLAGS_aarch64_linux_android = None
  cargo:rerun-if-env-changed=HOST_CFLAGS
  HOST_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None
  running: "aarch64-linux-android-gcc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-Wall" "-Wextra" "-o" "/data/data/com.termux/files/usr/tmp/cargo-installLP1bMz/aarch64-linux-android/release/build/sys-info-847b2222ddc2bf7d/out/c/linux.o" "-c" "c/linux.c"
  cargo:warning=c/linux.c:96:11: error: call to undeclared library function 'index' with type 'char *(const char *, int)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]

  cargo:warning=                mount = index(procline, ' ');

  cargo:warning=                        ^

  cargo:warning=c/linux.c:96:11: note: include the header <strings.h> or explicitly provide a declaration for 'index'

  cargo:warning=1 error generated.

  exit status: 1

  --- stderr


  error occurred: Command "aarch64-linux-android-gcc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-Wall" "-Wextra" "-o" "/data/data/com.termux/files/usr/tmp/cargo-installLP1bMz/aarch64-linux-android/release/build/sys-info-847b2222ddc2bf7d/out/c/linux.o" "-c" "c/linux.c" with args "aarch64-linux-android-gcc" did not execute successfully (status code exit status: 1).


warning: build failed, waiting for other jobs to finish...
error: failed to compile `emplace v1.4.2 (https://github.com/tversteeg/emplace#c655442b)`, intermediate artifacts can be found at `/data/data/com.termux/files/usr/tmp/cargo-installLP1bMz`

Machine information
Print the contents of emplace bugreport here.

Can't install emplace so can't print.

$ cargo --version
cargo 1.70.0
$ rustc --version --verbose
rustc 1.70.0 (90c541806 2023-05-31) (built from a source tarball)
binary: rustc
commit-hash: 90c541806f23a127002de5b4038be731ba1458ca
commit-date: 2023-05-31
host: aarch64-linux-android
release: 1.70.0
LLVM version: 16.0.6
@phanirithvij phanirithvij added the bug Something isn't working label Aug 26, 2023
@tversteeg
Copy link
Owner

Since this bug report there have been many updates of dependencies, does it still happen?

@phanirithvij
Copy link
Author

cargo install --git https://github.com/tversteeg/emplace
    Updating git repository `https://github.com/tversteeg/emplace`
  Installing emplace v1.5.2 (https://github.com/tversteeg/emplace#34c0be6b)
    Updating crates.io index
  Downloaded time v0.3.34
  Downloaded anstyle v1.0.6
  Downloaded backtrace v0.3.69
  Downloaded dialoguer v0.11.0
  Downloaded rustix v0.38.31
  Downloaded strum v0.26.1
  Downloaded libc v0.2.153
  Downloaded toml_edit v0.22.4
  Downloaded serde v1.0.196
  Downloaded proc-macro2 v1.0.78
  Downloaded addr2line v0.21.0
  Downloaded enum_dispatch v0.3.12
  Downloaded gimli v0.28.1
  Downloaded rustc-demangle v0.1.23
  Downloaded miniz_oxide v0.7.2
  Downloaded console v0.15.8
  Downloaded serde_derive v1.0.196
  Downloaded ron v0.8.1
  Downloaded git-version v0.3.9
  Downloaded indexmap v2.2.2
  Downloaded itertools v0.12.1
  Downloaded object v0.32.2
  Downloaded shell-escape v0.1.5
  Downloaded num-conv v0.1.0
  Downloaded zeroize v1.7.0
  Downloaded time-macros v0.2.17
  Downloaded toml v0.8.10
  Downloaded tempfile v3.10.0
  Downloaded strum_macros v0.26.1
  Downloaded bugreport v0.5.0
  Downloaded sys-info v0.9.1
  Downloaded winnow v0.5.39
  Downloaded git-version-macro v0.3.9
  Downloaded clap_complete v4.4.10
  Downloaded fsio v0.4.0
  Downloaded run_script v0.10.1
  Downloaded 36 crates (5.4 MB) in 1.15s (largest was `fsio` at 1.1 MB)
   Compiling libc v0.2.153
   Compiling proc-macro2 v1.0.78
   Compiling unicode-ident v1.0.12
   Compiling serde v1.0.196
   Compiling cfg-if v1.0.0
   Compiling utf8parse v0.2.1
   Compiling anstyle v1.0.6
   Compiling anstyle-query v1.0.2
   Compiling anstyle-parse v0.2.3
   Compiling rustix v0.38.31
   Compiling ppv-lite86 v0.2.17
   Compiling colorchoice v1.0.0
   Compiling memchr v2.7.1
   Compiling strsim v0.10.0
   Compiling gimli v0.28.1
   Compiling anstream v0.6.11
   Compiling powerfmt v0.2.0
   Compiling num-conv v0.1.0
   Compiling rustversion v1.0.14
   Compiling thiserror v1.0.56
   Compiling quote v1.0.35
   Compiling linux-raw-sys v0.4.13
   Compiling hashbrown v0.14.3
   Compiling syn v2.0.48
   Compiling getrandom v0.2.12
   Compiling errno v0.3.8
   Compiling cc v1.0.83
   Compiling rand_core v0.6.4
   Compiling lazy_static v1.4.0
   Compiling adler v1.0.2
   Compiling time-core v0.1.2
   Compiling clap_lex v0.6.0
   Compiling equivalent v1.0.1
   Compiling rand_chacha v0.3.1
   Compiling time-macros v0.2.17
   Compiling clap_builder v4.4.18
   Compiling indexmap v2.2.2
   Compiling rand v0.8.5
   Compiling miniz_oxide v0.7.2
   Compiling sys-info v0.9.1
The following warnings were emitted during compilation:

warning: sys-info@0.9.1: c/linux.c:96:11: error: call to undeclared library function 'index' with type 'char *(const char *, int)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
warning: sys-info@0.9.1:    96 |                 mount = index(procline, ' ');
warning: sys-info@0.9.1:       |                         ^
warning: sys-info@0.9.1: c/linux.c:96:11: note: include the header <strings.h> or explicitly provide a declaration for 'index'
warning: sys-info@0.9.1: 1 error generated.

error: failed to run custom build command for `sys-info v0.9.1`

Caused by:
  process didn't exit successfully: `/data/data/com.termux/files/usr/tmp/cargo-installobFdp8/release/build/sys-info-b56fdbfd91dce562/build-script-build` (exit status: 1)
  --- stdout
  TARGET = Some("aarch64-linux-android")
  OPT_LEVEL = Some("3")
  HOST = Some("aarch64-linux-android")
  cargo:rerun-if-env-changed=CC_aarch64-linux-android
  CC_aarch64-linux-android = None
  cargo:rerun-if-env-changed=CC_aarch64_linux_android
  CC_aarch64_linux_android = None
  cargo:rerun-if-env-changed=HOST_CC
  HOST_CC = None
  cargo:rerun-if-env-changed=CC
  CC = None
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("false")
  CARGO_CFG_TARGET_FEATURE = Some("neon")
  cargo:rerun-if-env-changed=CFLAGS_aarch64-linux-android
  CFLAGS_aarch64-linux-android = None
  cargo:rerun-if-env-changed=CFLAGS_aarch64_linux_android
  CFLAGS_aarch64_linux_android = None
  cargo:rerun-if-env-changed=HOST_CFLAGS
  HOST_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None
  running: "aarch64-linux-android-gcc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-Wall" "-Wextra" "-o" "/data/data/com.termux/files/usr/tmp/cargo-installobFdp8/release/build/sys-info-0e8ad214f95feeb6/out/c/linux.o" "-c" "c/linux.c"
  cargo:warning=c/linux.c:96:11: error: call to undeclared library function 'index' with type 'char *(const char *, int)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]

  cargo:warning=   96 |                 mount = index(procline, ' ');

  cargo:warning=      |                         ^

  cargo:warning=c/linux.c:96:11: note: include the header <strings.h> or explicitly provide a declaration for 'index'

  cargo:warning=1 error generated.

  exit status: 1

  --- stderr


  error occurred: Command "aarch64-linux-android-gcc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-Wall" "-Wextra" "-o" "/data/data/com.termux/files/usr/tmp/cargo-installobFdp8/release/build/sys-info-0e8ad214f95feeb6/out/c/linux.o" "-c" "c/linux.c" with args "aarch64-linux-android-gcc" did not execute successfully (status code exit status: 1).


warning: build failed, waiting for other jobs to finish...
error: failed to compile `emplace v1.5.2 (https://github.com/tversteeg/emplace#34c0be6b)`, intermediate artifacts can be found at `/data/data/com.termux/files/usr/tmp/cargo-installobFdp8`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

@phanirithvij
Copy link
Author

phanirithvij commented Feb 7, 2024

sys-info is still 0.9.1 and I don't think it supports android termux. FillZpp/sys-info-rs#116

@tversteeg
Copy link
Owner

I removed the dependency all together by disabling the feature on the bugreport crate, can you verify that it works as intended now?

@phanirithvij
Copy link
Author

Is it possible to detect the platform as android and only then disable that feature? Because operating system info seems very vital to bug reports.

@tversteeg
Copy link
Owner

Hmmm could be, but the platform is also somewhat embedded in the compile time information. I think that's enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants