View previous topic :: View next topic |
Author |
Message |
XelKarin Tux's lil' helper
Joined: 29 Dec 2003 Posts: 82
|
Posted: Sat Aug 06, 2022 7:34 pm Post subject: Compiling Rust code under qemu user chroot environment |
|
|
I'm trying to compile a Rust application under a qemu user chroot environment. The chroot environment is ARM running on an AMD64 system. Cargo fails to fetch dependent crates in the environment as follows.
Code: | Updating crates.io index
error: failed to get `libc` as a dependency of package `newt v0.6.8 (/root/src/newt-rs)`
Caused by:
failed to load source for dependency `libc`
Caused by:
Unable to update registry `crates-io`
Caused by:
failed to fetch `https://github.com/rust-lang/crates.io-index`
Caused by:
target OID for the reference doesn't exist on the repository; class=Reference (4) |
Any ideas as to what could be happening? |
|
Back to top |
|
|
mike155 Advocate
Joined: 17 Sep 2010 Posts: 4438 Location: Frankfurt, Germany
|
Posted: Sun Aug 07, 2022 11:05 am Post subject: |
|
|
Do you have internet access?
Please execute the commands below:
Code: | cd /tmp
wget https://github.com/rust-lang/crates.io-index |
Does it work? Or do you get an error? |
|
Back to top |
|
|
XelKarin Tux's lil' helper
Joined: 29 Dec 2003 Posts: 82
|
Posted: Wed Aug 10, 2022 3:01 am Post subject: |
|
|
The above works fine.
Code: | --2022-08-09 19:55:08-- https://github.com/rust-lang/crates.io-index
Resolving github.com... 192.30.255.113
Connecting to github.com|192.30.255.113|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘crates.io-index’
crates.io-index [ <=> ] 1.25M 385KB/s in 3.3s
2022-08-09 19:55:12 (385 KB/s) - ‘crates.io-index’ saved [1308037] |
Also ping and DNS lookups work fine. |
|
Back to top |
|
|
Hu Moderator
Joined: 06 Mar 2007 Posts: 21602
|
Posted: Wed Aug 10, 2022 2:56 pm Post subject: |
|
|
Exactly what command are you using that leads to the cargo error? Is this being done by Portage or from a custom build system that you invoke by hand? |
|
Back to top |
|
|
XelKarin Tux's lil' helper
Joined: 29 Dec 2003 Posts: 82
|
|
Back to top |
|
|
mike155 Advocate
Joined: 17 Sep 2010 Posts: 4438 Location: Frankfurt, Germany
|
Posted: Wed Aug 10, 2022 10:11 pm Post subject: |
|
|
Do you know strace? You could run
Code: | strace -f -o /tmp/strace.log cargo build --features asm |
and look for failing system calls directly before the output of the error message. But I worry that the strace.log will be loooong. It may be difficult to find the failing system call in strace.log. |
|
Back to top |
|
|
XelKarin Tux's lil' helper
Joined: 29 Dec 2003 Posts: 82
|
Posted: Thu Aug 11, 2022 1:16 am Post subject: |
|
|
strace fails immediately.
Code: | /usr/bin/strace: test_ptrace_get_syscall_info: PTRACE_TRACEME: Function not implemented
/usr/bin/strace: ptrace(PTRACE_TRACEME, ...): Function not implemented
/usr/bin/strace: PTRACE_SETOPTIONS: Function not implemented
/usr/bin/strace: detach: waitpid(22801): No child processes |
*edit*
Okay, I set the environment variable QEMU_STRACE=1 and strace runs, but its threads/child processes fail with similar errors.
One failed with
Code: | /usr/bin/strace: ptrace(PTRACE_TRACEME, ...): Function not implemented |
and another failed with
Code: | /usr/bin/strace: PTRACE_SETOPTIONS: Function not implemented |
I'm going to continue looking into strace though.
*edit*
Actually that environment variable seems to cause every program run by qemu to be straced automatically by the emulator. |
|
Back to top |
|
|
XelKarin Tux's lil' helper
Joined: 29 Dec 2003 Posts: 82
|
Posted: Thu Aug 11, 2022 2:30 am Post subject: |
|
|
Under strace I'm seeing alot of
Code: | Unknown syscall 403 |
|
|
Back to top |
|
|
XelKarin Tux's lil' helper
Joined: 29 Dec 2003 Posts: 82
|
Posted: Thu Aug 11, 2022 3:16 am Post subject: |
|
|
The error occurring just before the failed to get dependency errors is
Code: | openat(AT_FDCWD,"/root/src/newt-rs/target/.rustc_info.json",O_WRONLY|O_CREAT|O_LARGEFILE|O_TRUNC|O_CLOEXEC,0666) = -1 errno=2 (No such file or directory) |
And before that it looks like something was downloaded and written to
Code: | /root/.cargo/registry/index/github.com-1285ae84e5963aae/.git/objects/pack/pack-8ec23db35fd1a7feb23e032a338bbba1108cfb76.idx |
|
|
Back to top |
|
|
XelKarin Tux's lil' helper
Joined: 29 Dec 2003 Posts: 82
|
Posted: Sun Aug 21, 2022 10:41 pm Post subject: |
|
|
I created an AARCH64 chroot and the build completes fine under that. Seems the issue only occurs with ARM32. |
|
Back to top |
|
|
mike155 Advocate
Joined: 17 Sep 2010 Posts: 4438 Location: Frankfurt, Germany
|
Posted: Sun Aug 21, 2022 10:56 pm Post subject: |
|
|
Quote: | Under strace I'm seeing alot of
Code: | Unknown syscall 403 |
|
According to this post, that's clock_gettime64(). |
|
Back to top |
|
|
|