tversteeg/emplace

compiling errors on Android/Termux

Closed this issue ยท 3 comments

Hi! I've never had any problems compiling this on Android via Termux but I get this error now:

error[E0308]: mismatched types
   --> /data/data/com.termux/files/home/.cargo/registry/src/github.com-1ecc6299db9ec823/sys-info-0.7.0/lib.rs:618:22
    |
618 | pub fn boottime() -> Result<timeval, Error> {
    |        --------      ^^^^^^^^^^^^^^^^^^^^^^ expected enum `std::result::Result`, found `()`
    |        |
    |        implicitly returns `()` as its body has no tail or `return` expression
    |
    = note:   expected enum `std::result::Result<timeval, Error>`
            found unit type `()`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0308`.
The following warnings were emitted during compilation:

warning: c/linux.c:96:11: warning: implicitly declaring library function 'index' with type 'char *(const char *, int)' [-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 warning generated.

error: could not compile `sys-info`

Caused by:
  process didn't exit successfully: `rustc --crate-name sys_info /data/data/com.termux/files/home/.cargo/registry/src/github.com-1ecc6299db9ec823/sys-info-0.7.0/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no -C metadata=8e4c9c41fb88bb44 -C extra-filename=-8e4c9c41fb88bb44 --out-dir /data/data/com.termux/files/home/emplace/target/release/deps -L dependency=/data/data/com.termux/files/home/emplace/target/release/deps --extern libc=/data/data/com.termux/files/home/emplace/target/release/deps/liblibc-90acee28a3686a67.rmeta --cap-lints allow -L native=/data/data/com.termux/files/home/emplace/target/release/build/sys-info-955860057669091d/out -l static=info` (exit code: 1)
warning: build failed, waiting for other jobs to finish...
error: build failed

Not sure if sys-info is a new lib? or perhaps it a new version of it causing the issue?

sys-info is a library that's a dependency of bugreport another library I've added in 0.4.1.

I've found the compilation error you're getting, and it seems to be fixed in version 0.8 of the crate: FillZpp/sys-info-rs#67

The only problem is that bugreport still uses the 0.8 version, so I've created a PR to fix that: sharkdp/bugreport#5

@all-contributors please add @5c0tt-b0t for bug

@tversteeg

I've put up a pull request to add @5c0tt-b0t! ๐ŸŽ‰