Bug ID 1189898
Summary osc build --clean aarch64 doesn't work out of the box
Classification openSUSE
Product openSUSE Tumbleweed
Version Current
Hardware Other
OS Other
Status NEW
Severity Normal
Priority P5 - None
Component Development
Assignee screening-team-bugs@suse.de
Reporter mcepl@suse.com
QA Contact qa-bugs@suse.de
Found By ---
Blocker ---

When I run

osc build --clean openSUSE_Tumbledweed aarch64

in my project (editor/neovim branch in my home project) I expect something
beautiful to happen. Instead I get this:

neovim@kusansky$ osc build --clean aarch64
WARNING: native compile is not possible, a emulator via binfmt misc handler
must be configured!
Building neovim.spec for openSUSE_Tumbleweed/aarch64
Run source service: /usr/lib/obs/service/format_spec_file --outdir
/home/matej/build/home:mcepl:branches:editors/neovim/tmpnjtsnk1a.format_spec_file.service
Run source service: /usr/lib/obs/service/source_validator --outdir
/home/matej/build/home:mcepl:branches:editors/neovim/tmpa85zi6c7.source_validator.service
- package has neovim-rpmlintrc: (unchanged)
Getting buildconfig from server and store to
/home/matej/build/home:mcepl:branches:editors/neovim/.osc/_buildconfig-openSUSE_Tumbleweed-aarch64
Getting buildinfo from server and store to
/home/matej/build/home:mcepl:branches:editors/neovim/.osc/_buildinfo-openSUSE_Tumbleweed-aarch64.xml
WARNING: It is guessed to build on hostarch 'x86_64' for 'aarch64' via QEMU
user emulation.
Updating cache of required packages
0.0% cache miss. 220/220 dependencies cached.

Verifying integrity of cached packages
using keys from openSUSE:Tumbleweed, editors
Writing build configuration
Running build
logging output to /var/tmp/build-root/openSUSE_Tumbleweed-aarch64/.build.log...
[    0s] Memory limit set to 43620264KB
[    0s] Using BUILD_ROOT=/var/tmp/build-root/openSUSE_Tumbleweed-aarch64
[    0s] Using BUILD_ARCH=aarch64:aarch64_ilp32:armv8l
[    0s]
[    0s]
[    0s] kusansky started "build neovim.spec" at Fri Aug 27 14:40:29 UTC 2021.
[    0s]
[    0s]
[    0s] processing recipe
/home/matej/build/home:mcepl:branches:editors/neovim/neovim.spec ...
[    0s] running changelog2spec --target rpm --file
/home/matej/build/home:mcepl:branches:editors/neovim/neovim.spec
[    0s] init_buildsystem --configdir /usr/lib/build/configs --cachedir
/var/cache/build --clean --rpmlist /tmp/rpmlist.__b75lwb
/home/matej/build/home:mcepl:branches:editors/neovim/neovim.spec ...
[    0s] registering binfmt handlers for cross build
[    0s] write: File exists
[    0s] /proc/sys/fs/binfmt_misc/register: write failed
[    0s] /usr/lib/build/qemu-reg: line 9: write failed. Content:
:aarch64:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-aarch64-binfmt:P
[    0s] /.build/qemu-reg: No such file or directory
[    0s] /.build/qemu-reg: failed. Trying alternate binfmt file
[    0s] write: File exists
[    0s] /proc/sys/fs/binfmt_misc/register: write failed
[    0s] /usr/lib/build/qemu-reg: line 9: write failed. Content:
:aarch64:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-aarch64-binfmt:P
[    0s] /usr/lib/build/qemu-reg: binfmt registration failed
[    0s] hostname: Name or service not known
[    1s] cycle: rpm-config-SUSE -> rpm
[    1s]   breaking dependency rpm-config-SUSE -> rpm
[    1s] [1/34] preinstalling filesystem...
[    1s] [2/34] preinstalling permissions...
[    1s] [3/34] preinstalling glibc...
[    1s] [4/34] preinstalling diffutils...
[    1s] [5/34] preinstalling fillup...
[    1s] [6/34] preinstalling libacl1...
[    1s] [7/34] preinstalling libattr1...
[    1s] [8/34] preinstalling libbz2-1...
[    1s] [9/34] preinstalling libcap2...
[    1s] [10/34] preinstalling libgcc_s1...
[    1s] [11/34] preinstalling libgpg-error0...
[    1s] [12/34] preinstalling liblua5_3-5...
[    1s] [13/34] preinstalling liblua5_4-5...
[    1s] [14/34] preinstalling liblzma5...
[    1s] [15/34] preinstalling libpcre1...
[    1s] [16/34] preinstalling libpcre2-8-0...
[    1s] [17/34] preinstalling libpopt0...
[    1s] [18/34] preinstalling libz1...
[    1s] [19/34] preinstalling libzstd1...
[    1s] [20/34] preinstalling attr...
[    1s] [21/34] preinstalling libelf1...
[    1s] [22/34] preinstalling libgcrypt20...
[    1s] [23/34] preinstalling libncurses6...
[    2s] [24/34] preinstalling libselinux1...
[    2s] [25/34] preinstalling libreadline8...
[    2s] [26/34] preinstalling tar...
[    2s] [27/34] preinstalling bash...
[    2s] [28/34] preinstalling grep...
[    2s] [29/34] preinstalling pam...
[    2s] [30/34] preinstalling sed...
[    2s] [31/34] preinstalling coreutils...
[    2s] [32/34] preinstalling aaa_base...
[    2s] [33/34] preinstalling rpm-config-SUSE...
[    2s] [34/34] preinstalling rpm...
[    2s] initializing rpm db...
[    2s] chroot: failed to run command '/usr/bin/rpmdb': No such file or
directory
[    2s]
[    2s] kusansky failed "build neovim.spec" at Fri Aug 27 14:40:31 UTC 2021.
[    2s]

The buildroot was: /var/tmp/build-root/openSUSE_Tumbleweed-aarch64
neovim@kusansky$

========================================================================

I guess the problem is that I don't have configured binfmt properly, but I have
never found an official instructions what should I do.

In desperation I tried to follow instructions in
https://github.com/dbhi/qus#setup and then use the generated binary in /usr/bin
of the chroot, but it didn't help at all:

neovim@kusansky$ oscb  aarch64
WARNING: native compile is not possible, a emulator via binfmt misc handler
must be configured!
Building neovim.spec for openSUSE_Tumbleweed/aarch64
Run source service: /usr/lib/obs/service/format_spec_file --outdir
/home/matej/build/home:mcepl:branches:editors/neovim/tmps5j65fqr.format_spec_file.service
Run source service: /usr/lib/obs/service/source_validator --outdir
/home/matej/build/home:mcepl:branches:editors/neovim/tmp7jcl6lp3.source_validator.service
- package has neovim-rpmlintrc: (unchanged)
Getting buildconfig from server and store to
/home/matej/build/home:mcepl:branches:editors/neovim/.osc/_buildconfig-openSUSE_Tumbleweed-aarch64
Getting buildinfo from server and store to
/home/matej/build/home:mcepl:branches:editors/neovim/.osc/_buildinfo-openSUSE_Tumbleweed-aarch64.xml
WARNING: It is guessed to build on hostarch 'x86_64' for 'aarch64' via QEMU
user emulation.
Updating cache of required packages
0.0% cache miss. 220/220 dependencies cached.

Verifying integrity of cached packages
using keys from openSUSE:Tumbleweed, editors
Writing build configuration
Running build
logging output to /var/tmp/build-root/openSUSE_Tumbleweed-aarch64/.build.log...
[    0s] Memory limit set to 43620264KB
[    0s] Using BUILD_ROOT=/var/tmp/build-root/openSUSE_Tumbleweed-aarch64
[    0s] Using BUILD_ARCH=aarch64:aarch64_ilp32:armv8l
[    0s]
[    0s]
[    0s] kusansky started "build neovim.spec" at Fri Aug 27 16:45:29 UTC 2021.
[    0s]
[    0s]
[    0s] processing recipe
/home/matej/build/home:mcepl:branches:editors/neovim/neovim.spec ...
[    0s] running changelog2spec --target rpm --file
/home/matej/build/home:mcepl:branches:editors/neovim/neovim.spec
[    0s] init_buildsystem --configdir /usr/lib/build/configs --cachedir
/var/cache/build --rpmlist /tmp/rpmlist.od1t61bl
/home/matej/build/home:mcepl:branches:editors/neovim/neovim.spec ...
[    0s] It seems that there was an incomplete setup of
/var/tmp/build-root/openSUSE_Tumbleweed-aarch64.
[    0s] To be sure, we will build it again completely...
[    0s] Your build system is broken!! Shall I execute
[    0s]
[    0s]     rm -rf -- /var/tmp/build-root/openSUSE_Tumbleweed-aarch64/*
[    0s]
[    0s] y - yes, cleanup the build root
[    0s] N - No, abort build (default on enter)
[    0s] c - Continue anyway with this build root
y
[    3s] [y/N/c] registering binfmt handlers for cross build
[    3s] write: File exists
[    3s] /proc/sys/fs/binfmt_misc/register: write failed
[    3s] /usr/lib/build/qemu-reg: line 9: write failed. Content:
:aarch64:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-aarch64-binfmt:P
[    3s] /.build/qemu-reg: No such file or directory
[    3s] /.build/qemu-reg: failed. Trying alternate binfmt file
[    3s] write: File exists
[    3s] /proc/sys/fs/binfmt_misc/register: write failed
[    3s] /usr/lib/build/qemu-reg: line 9: write failed. Content:
:aarch64:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\xb7:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-aarch64-binfmt:P
[    3s] /usr/lib/build/qemu-reg: binfmt registration failed
[    3s] hostname: Name or service not known
[    3s] cycle: rpm-config-SUSE -> rpm
[    3s]   breaking dependency rpm-config-SUSE -> rpm
[    3s] [1/34] preinstalling filesystem...
[    3s] [2/34] preinstalling permissions...
[    3s] [3/34] preinstalling glibc...
[    3s] [4/34] preinstalling diffutils...
[    3s] [5/34] preinstalling fillup...
[    3s] [6/34] preinstalling libacl1...
[    3s] [7/34] preinstalling libattr1...
[    3s] [8/34] preinstalling libbz2-1...
[    4s] [9/34] preinstalling libcap2...
[    4s] [10/34] preinstalling libgcc_s1...
[    4s] [11/34] preinstalling libgpg-error0...
[    4s] [12/34] preinstalling liblua5_3-5...
[    4s] [13/34] preinstalling liblua5_4-5...
[    4s] [14/34] preinstalling liblzma5...
[    4s] [15/34] preinstalling libpcre1...
[    4s] [16/34] preinstalling libpcre2-8-0...
[    4s] [17/34] preinstalling libpopt0...
[    4s] [18/34] preinstalling libz1...
[    4s] [19/34] preinstalling libzstd1...
[    4s] [20/34] preinstalling attr...
[    4s] [21/34] preinstalling libelf1...
[    4s] [22/34] preinstalling libgcrypt20...
[    4s] [23/34] preinstalling libncurses6...
[    4s] [24/34] preinstalling libselinux1...
[    4s] [25/34] preinstalling libreadline8...
[    4s] [26/34] preinstalling tar...
[    4s] [27/34] preinstalling bash...
[    4s] [28/34] preinstalling grep...
[    4s] [29/34] preinstalling pam...
[    4s] [30/34] preinstalling sed...
[    5s] [31/34] preinstalling coreutils...
[    5s] [32/34] preinstalling aaa_base...
[    5s] [33/34] preinstalling rpm-config-SUSE...
[    5s] [34/34] preinstalling rpm...
[    5s] initializing rpm db...
[    5s] chroot: failed to run command '/usr/bin/rpmdb': No such file or
directory
[    5s]
[    5s] kusansky failed "build neovim.spec" at Fri Aug 27 16:45:34 UTC 2021.
[    5s]

The buildroot was: /var/tmp/build-root/openSUSE_Tumbleweed-aarch64
neovim@kusansky$ sudo -i
kusansky:~# cd /var/tmp/build-root/openSUSE_Tumbleweed-aarch64/
kusansky:openSUSE_Tumbleweed-aarch64# cp /usr/local/sbin/qemu-aarch64-static
bin/
kusansky:openSUSE_Tumbleweed-aarch64# logout
neovim@kusansky$ oscb --no-init aarch64
neovim@kusansky$ oscb --no-init aarch64
WARNING: native compile is not possible, a emulator via binfmt misc handler
must be configured!
Building neovim.spec for openSUSE_Tumbleweed/aarch64
Run source service: /usr/lib/obs/service/format_spec_file --outdir
/home/matej/build/home:mcepl:branches:editors/neovim/tmp0blqivwa.format_spec_file.service
Run source service: /usr/lib/obs/service/source_validator --outdir
/home/matej/build/home:mcepl:branches:editors/neovim/tmplqm0cf3y.source_validator.service
- package has neovim-rpmlintrc: (unchanged)
Use local
'/home/matej/build/home:mcepl:branches:editors/neovim/.osc/_buildinfo-openSUSE_Tumbleweed-aarch64.xml'
file as buildinfo
Use local
'/home/matej/build/home:mcepl:branches:editors/neovim/.osc/_buildconfig-openSUSE_Tumbleweed-aarch64'
file as buildconfig
WARNING: It is guessed to build on hostarch 'x86_64' for 'aarch64' via QEMU
user emulation.
Updating cache of required packages
0.0% cache miss. 220/220 dependencies cached.

Verifying integrity of cached packages
using keys from openSUSE:Tumbleweed, editors
Writing build configuration
Running build
logging output to /var/tmp/build-root/openSUSE_Tumbleweed-aarch64/.build.log...
[    0s] Memory limit set to 43620264KB
[    0s] Using BUILD_ROOT=/var/tmp/build-root/openSUSE_Tumbleweed-aarch64
[    0s] Using BUILD_ARCH=aarch64:aarch64_ilp32:armv8l
[    0s]
[    1s]
[    1s] kusansky started "build neovim.spec" at Fri Aug 27 16:46:02 UTC 2021.
[    1s]
[    1s]
[    1s] processing recipe
/home/matej/build/home:mcepl:branches:editors/neovim/neovim.spec ...
[    1s] running changelog2spec --target rpm --file
/home/matej/build/home:mcepl:branches:editors/neovim/neovim.spec
[    1s] /usr/bin/build: line 1506:
/var/tmp/build-root/openSUSE_Tumbleweed-aarch64/etc/passwd: No such file or
directory
[    1s] chroot: failed to run command 'su': No such file or directory
[    1s] Error: TOPDIR empty
[    1s]
[    1s] kusansky failed "build neovim.spec" at Fri Aug 27 16:46:02 UTC 2021.
[    1s]

The buildroot was: /var/tmp/build-root/openSUSE_Tumbleweed-aarch64
neovim@kusansky$

========================================================================

The point is I don't think I should struggle this much at all, this should
somehow just work. I just want to install package osc-build-cross or something
like that, and everything should be just configured and working. This is too
much pain.


You are receiving this mail because: