Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 936608 - app-containers/aardvark-dns-1.10.0 does not build in crossdev cross-compiling environment
Summary: app-containers/aardvark-dns-1.10.0 does not build in crossdev cross-compiling...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Zac Medico
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-07-25 00:06 UTC by ev
Modified: 2024-08-08 17:53 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
aarch64-unknown-linux-gnu-emerge --info =app-containers/aardvark-dns-1.10.0 (crossdev-emerge--info-aardvark-dns-1.10.0.txt,6.20 KB, text/plain)
2024-07-25 00:06 UTC, ev
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ev 2024-07-25 00:06:20 UTC
Created attachment 898279 [details]
aarch64-unknown-linux-gnu-emerge --info =app-containers/aardvark-dns-1.10.0

CHOST=aarch64-unknown-linux-gnu
CBUILD=x86_64-pc-linux-gnu

Failed build log

$ cat /usr/aarch64-unknown-linux-gnu/tmp/portage/app-containers/aardvark-dns-1.10.0/temp/build.log
 * Package:    app-containers/aardvark-dns-1.10.0:0
 * Repository: gentoo
 * Maintainer: zmedico@gentoo.org me@rahil.rocks,proxy-maint@gentoo.org
 * Upstream:   https://github.com/containers/aardvark-dns/issues
 * USE:        arm64 elibc_glibc kernel_linux
 * FEATURES:   network-sandbox preserve-libs sandbox userpriv usersandbox
>>> Unpacking source...
>>> Unpacking aardvark-dns-v1.10.0-vendor.tar.gz to /usr/aarch64-unknown-linux-gnu/tmp/portage/app-containers/aardvark-dns-1.10.0/work
 * Unpacking crates ...
tar -x -C /usr/aarch64-unknown-linux-gnu/tmp/portage/app-containers/aardvark-dns-1.10.0/work/vendor -f aardvark-dns-1.10.0.crate                                                                                                        [ ok ]
>>> Source unpacked in /usr/aarch64-unknown-linux-gnu/tmp/portage/app-containers/aardvark-dns-1.10.0/work
>>> Preparing source in /usr/aarch64-unknown-linux-gnu/tmp/portage/app-containers/aardvark-dns-1.10.0/work/aardvark-dns-1.10.0 ...
>>> Source prepared.
>>> Configuring source in /usr/aarch64-unknown-linux-gnu/tmp/portage/app-containers/aardvark-dns-1.10.0/work/aardvark-dns-1.10.0 ...
>>> Source configured.
>>> Compiling source in /usr/aarch64-unknown-linux-gnu/tmp/portage/app-containers/aardvark-dns-1.10.0/work/aardvark-dns-1.10.0 ...
 * cargo build --release
error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `rustc - --crate-name ___ --print=file-names --target aarch64-unknown-linux-gnu --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=split-debuginfo --print=crate-name --print=cfg` (exit status: 1)
  --- stderr
  error: could not create LLVM TargetMachine for triple: aarch64-unknown-linux-gn: No available targets are compatible with triple "aarch64-unknown-linux-gnu"

 * ERROR: app-containers/aardvark-dns-1.10.0::gentoo failed (compile phase):
 *   cargo build failed
 * 
 * Call stack:
 *     ebuild.sh, line  136:  Called src_compile
 *   environment, line 2030:  Called cargo_src_compile
 *   environment, line  856:  Called die
 * The specific snippet of code:
 *       "${@}" || die "cargo build failed"
 * 
 * If you need support, post the output of `emerge --info '=app-containers/aardvark-dns-1.10.0::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=app-containers/aardvark-dns-1.10.0::gentoo'`.
 * The complete build log is located at '/usr/aarch64-unknown-linux-gnu/tmp/portage/app-containers/aardvark-dns-1.10.0/temp/build.log'.
 * The ebuild environment file is located at '/usr/aarch64-unknown-linux-gnu/tmp/portage/app-containers/aardvark-dns-1.10.0/temp/environment'.
 * Working directory: '/usr/aarch64-unknown-linux-gnu/tmp/portage/app-containers/aardvark-dns-1.10.0/work/aardvark-dns-1.10.0'
Comment 1 James Le Cuirot gentoo-dev 2024-07-25 20:44:19 UTC
crossdev alone isn't enough. You have to set up with experimental cross Rust support with an env file against dev-lang/rust. Put this in /etc/portage/env/dev-lang/rust:

> I_KNOW_WHAT_I_AM_DOING_CROSS=1
> 
> RUST_CROSS_TARGETS=(
>     "AArch64:aarch64-unknown-linux-gnu:aarch64-unknown-linux-gnu"
> )

I tried aardvark-dns and it worked for me. That was against my proposed cargo.eclass changes, but they're probably not needed in this case.
Comment 2 James Le Cuirot gentoo-dev 2024-07-25 20:45:25 UTC
Oh, forgot to mention you need to rebuild dev-lang/rust after that. Don't use dev-lang/rust-bin, that won't work.
Comment 3 László Szalma 2024-08-08 15:57:39 UTC
(In reply to James Le Cuirot from comment #2)
> Oh, forgot to mention you need to rebuild dev-lang/rust after that. Don't
> use dev-lang/rust-bin, that won't work.

emerge -C rust-bin
emerge -av1 rust
emerge -avu app-containers/aardvark-dns

And it worked. But somehow rust (source) should be depended by the package, shouldn't it?
Comment 4 László Szalma 2024-08-08 16:04:48 UTC
(In reply to László Szalma from comment #3)
> (In reply to James Le Cuirot from comment #2)
> > Oh, forgot to mention you need to rebuild dev-lang/rust after that. Don't
> > use dev-lang/rust-bin, that won't work.
> 
> emerge -C rust-bin
> emerge -av1 rust
> emerge -avu app-containers/aardvark-dns
> 
> And it worked. But somehow rust (source) should be depended by the package,
> shouldn't it?

Sorry, it doesn't work for me yet, I sent the comment too early.

>>> Source compiled.
>>> Test phase [not enabled]: app-containers/aardvark-dns-1.11.0

>>> Install app-containers/aardvark-dns-1.11.0 into /var/tmp/portage/app-containers/aardvark-dns-1.11.0/image
make -j5 DESTDIR=/var/tmp/portage/app-containers/aardvark-dns-1.11.0/image install 
install  -D -m0755 target/release/aardvark-dns /var/tmp/portage/app-containers/aardvark-dns-1.11.0/image//usr/libexec/podman/aardvark-dns
/usr/bin/install: stat 'target/release/aardvark-dns' sikertelen: Nincs ilyen fájl vagy könyvtár
install-xattr: failed to stat /var/tmp/portage/app-containers/aardvark-dns-1.11.0/image//usr/libexec/podman/aardvark-dns: No such file or directory
make: *** [Makefile:78: install] Error 1
 * ERROR: app-containers/aardvark-dns-1.11.0::gentoo failed (install phase):
 *   emake failed
Comment 5 James Le Cuirot gentoo-dev 2024-08-08 17:53:24 UTC
The Rust source package is only needed for cross-compiling, which your are not. Your issue is different and has already been resolved. Please resync the repo and retry.