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

Building fails on Termux #27

Closed
Potato1682 opened this issue Oct 3, 2022 · 2 comments
Closed

Building fails on Termux #27

Potato1682 opened this issue Oct 3, 2022 · 2 comments

Comments

@Potato1682
Copy link

Hello,

I tried to build xcp 0.9.2 on Termux by cargo install, but it failed to compile.

The command I typed:

$ cargo install --locked xcp

Versions:

rustc 1.64.0
cargo 1.64.0
Termux Variables:
TERMUX_API_VERSION=0.50.1
TERMUX_APK_RELEASE=F_DROID
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP_PID=9719
TERMUX_IS_DEBUGGABLE_BUILD=0
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.0
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://mirrors.pku.edu.cn/termux/termux-main/ stable main
Updatable packages:
All packages up to date
termux-tools version:
1.29.3
Android version:
12
Kernel build information:
Linux localhost 4.14.212-Velvet-Cyprus_v2.1 #1 SMP PREEMPT Tue Sep 13 07:06:30 UTC 2022 aarch64 Android
Device manufacturer:
Xiaomi
Device model:
Redmi Note 9S

And the output:

error[E0433]: failed to resolve: could not find `linux` in `os`
  --> /data/data/com.termux/files/home/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/xcp-0.9.2/src/os/linux.rs:22:14
   |                                                                                    22 | use std::os::linux::fs::MetadataExt;
   |              ^^^^^ could not find `linux` in `os`                                  
error[E0599]: no method named `st_blocks` found for struct `std::fs::Metadata` in the current scope
   --> /data/data/com.termux/files/home/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/xcp-0.9.2/src/os/linux.rs:182:13
    |                                                                                   182 |     Ok(stat.st_blocks() < stat.st_size() / stat.st_blksize())
    |             ^^^^^^^^^ method not found in `std::fs::Metadata`                         |
    = help: items from traits can only be used if the trait is in scope                 help: the following trait is implemented but not in scope; perhaps add a `use` for it:
    |                                                                                   17  | use std::os::android::fs::MetadataExt;
    |                                                                                   
error[E0599]: no method named `st_size` found for struct `std::fs::Metadata` in the current scope
   --> /data/data/com.termux/files/home/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/xcp-0.9.2/src/os/linux.rs:182:32
    |                                                                                   182 |     Ok(stat.st_blocks() < stat.st_size() / stat.st_blksize())
    |                                ^^^^^^^ method not found in `std::fs::Metadata`        |
    = help: items from traits can only be used if the trait is in scope                 help: the following trait is implemented but not in scope; perhaps add a `use` for it:
    |                                                                                   17  | use std::os::android::fs::MetadataExt;
    |                                                                                   
error[E0599]: no method named `st_blksize` found for struct `std::fs::Metadata` in the current scope
   --> /data/data/com.termux/files/home/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/xcp-0.9.2/src/os/linux.rs:182:49
    |                                                                                   182 |     Ok(stat.st_blocks() < stat.st_size() / stat.st_blksize())
    |                                                 ^^^^^^^^^^ method not found in `std::fs::Metadata`
    |                                                                                       = help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:      |
17  | use std::os::android::fs::MetadataExt;                                                |
                                                                                        error[E0308]: mismatched types
    --> /data/data/com.termux/files/home/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/xcp-0.9.2/src/os/linux.rs:285:41
     |                                                                                  285  |             libc::ioctl(fd.as_raw_fd(), FS_IOC_FIEMAP, req_ptr)
     |             -----------                 ^^^^^^^^^^^^^ expected `i32`, found `u64`     |             |
     |             arguments to this function are incorrect                                  |
note: function defined here                                                                 --> /data/data/com.termux/files/home/.local/share/cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.134/src/unix/linux_like/android/mod.rs:2824:12                         |
2824 |     pub fn ioctl(fd: ::c_int, request: ::c_int, ...) -> ::c_int;                      |            ^^^^^
help: you can convert a `u64` to an `i32` and panic if the converted value doesn't fit       |
285  |             libc::ioctl(fd.as_raw_fd(), FS_IOC_FIEMAP.try_into().unwrap(), req_ptr)
     |                                                      ++++++++++++++++++++                                                                                                Some errors have detailed explanations: E0308, E0433, E0599.                            For more information about an error, try `rustc --explain E0308`.
error: could not compile `xcp` due to 5 previous errors
@tarka
Copy link
Owner

tarka commented Oct 4, 2022

It looks like Android jail filesystems don't support some features. I've released 0.9.3 that should work.

@tarka tarka closed this as completed Oct 4, 2022
@Potato1682
Copy link
Author

Potato1682 commented Oct 4, 2022

Thanks! It was built successfully and worked properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants