Closed ganto closed 6 years ago
I could locally reproduce the error when rebuilding the package via copr-rpmbuild
, however mock
-only builds didn't trigger the error.
When comparing the test output with a mock
build that doesn't fail, it's obvious that in the successful case the unix sockets are placed in the former LXD_DIR
which is for each test case a directory placed in /tmp
. So this error must be caused by an exported LXD_SOCKET
variable in the environment of the build which would overwrite the intended behaviour.
The only place where I ever export this variable is the /etc/profile.d/lxd.sh
which is part of the lxd
RPM. But we are building the lxd
RPM so this file shouldn't be in the profile of the build, does it?
To my surprise, when querying the build environment it tells me the lxd.sh
is there because lxd-3.0-0.2
is installed:
Executing(%check): /bin/sh -e /var/tmp/rpm-tmp.ns61L1
+ umask 022
+ cd /builddir/build/BUILD
+ cd lxd-3.0.0
---- DEBUG ----
+ export GOPATH=/builddir/build/BUILDROOT/lxd-3.0.0-0.3.fc27.x86_64//usr/share/gocode:/usr/share/gocode
+ GOPATH=/builddir/build/BUILDROOT/lxd-3.0.0-0.3.fc27.x86_64//usr/share/gocode:/usr/share/gocode
+ echo '---- DEBUG ----'
++ id
>>> User: uid=1000(mockbuild) gid=135(mock) groups=135(mock)
+ echo '>>> User: uid=1000(mockbuild) gid=135(mock) groups=135(mock)'
>>> Environment
+ echo '>>> Environment'
+ sort
+ env
CONFIG_SITE=NONE
GOPATH=/builddir/build/BUILDROOT/lxd-3.0.0-0.3.fc27.x86_64//usr/share/gocode:/usr/share/gocode
HISTCONTROL=ignoredups
HISTSIZE=1000
HOME=/builddir
HOSTNAME=
LANG=C
LOGNAME=mockbuild
LXD_SOCKET=/run/lxd.socket
MAIL=/var/spool/mail/mockbuild
NOTIFY_SOCKET=/run/systemd/nspawn/notify
OLDPWD=/builddir/build/BUILD
PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/builddir/.local/bin:/builddir/bin
PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig
PROMPT_COMMAND=printf "\033]0;<mock-chroot>\007"
PWD=/builddir/build/BUILD/lxd-3.0.0
RPM_ARCH=x86_64
RPM_BUILD_DIR=/builddir/build/BUILD
RPM_BUILD_ROOT=/builddir/build/BUILDROOT/lxd-3.0.0-0.3.fc27.x86_64
RPM_DOC_DIR=/usr/share/doc
RPM_LD_FLAGS=-Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld
RPM_OPT_FLAGS=-O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables
RPM_OS=linux
RPM_PACKAGE_NAME=lxd
RPM_PACKAGE_RELEASE=0.3.fc27
RPM_PACKAGE_VERSION=3.0.0
RPM_SOURCE_DIR=/builddir/build/SOURCES
SHELL=/bin/bash
SHLVL=2
TERM=vt100
USER=mockbuild
_=/usr/bin/env
container=systemd-nspawn
container_uuid=ef84a3c0-ad08-44d8-956e-6ece8afd9a4b
>>> Profile
+ echo '>>> Profile'
+ ls -lh /etc/profile.d/
total 44K
-rw-r--r--. 1 root root 196 Aug 3 2017 colorgrep.csh
-rw-r--r--. 1 root root 201 Aug 3 2017 colorgrep.sh
-rw-r--r--. 1 root root 1.8K Feb 12 13:44 colorls.csh
-rw-r--r--. 1 root root 1.6K Feb 12 13:44 colorls.sh
-rw-r--r--. 1 root root 162 Aug 5 2017 colorxzgrep.csh
-rw-r--r--. 1 root root 183 Aug 5 2017 colorxzgrep.sh
-rw-r--r--. 1 root root 216 Aug 3 2017 colorzgrep.csh
-rw-r--r--. 1 root root 220 Aug 3 2017 colorzgrep.sh
-rw-r--r--. 1 root root 92 Apr 16 00:15 lxd.sh
-rw-r--r--. 1 root root 120 Aug 5 2017 which2.csh
-rw-r--r--. 1 root root 157 Aug 5 2017 which2.sh
>>> Source
+ echo '>>> Source'
+ test -f /etc/profile.d/lxd.sh
+ rpm -qf /etc/profile.d/lxd.sh
lxd-3.0.0-0.2.fc27.x86_64
The work-around is easy, simply unset the LXD_SOCKET
variable (fixed with d2d7529bd0903eed2fff2827375ec932aa900a58). But there is one question remaining:
Where does lxd-3.0.0-0.2.fc27.x86_64
come from? The copr-rpmbuild
log files don't contain any output why and how this package was installed. The only place this package is mentioned is in the /var/lib/copr-rpmbuild/results/installed_pkgs.log
unfortunately without context.
I'll close this issue as the build problem is solved. I'll add an update if I should find out why lxd
is installed when building lxd
...
The current COPR build of
lxd-3.0.0-0.3
fail to build successfully because the%check
step fails to start thelxd
daemon with the following error:Obviously the regular user running the build and test operations doesn't have the permissions to write to
/run
which is only writable to root.