Building snapd

I’m trying to build snapd using the redhat spec file at:

But I’m getting the following error:

+ pushd ./data
+ /usr/bin/make DESTDIR=/builddir/build/BUILDROOT/snapd-2.42.1-0.x86_64 INSTALLROOT=/builddir/build/BUILDROOT/snapd-2.42.1-0.x86_64 install_prefix=/builddir/build/BUILDROOT/snapd-2.42.1-0.x86_64 BUILDROOT=/builddir/build/BUILDROOT/snapd-2.42.1-0.x86_64 BUILD_ROOT=/builddir/build/BUILDROOT/snapd-2.42.1-0.x86_64 INSTALL_ROOT=/builddir/build/BUILDROOT/snapd-2.42.1-0.x86_64 install BINDIR=/usr/bin LIBEXECDIR=/usr/libexec ' '
/usr/bin/make -C systemd install
make[1]: Entering directory '/builddir/build/BUILD/snapd-2.42.1/data/systemd'
# NOTE: old (e.g. 14.04) GNU coreutils doesn't -D with -t
install -d -m 0755 /builddir/build/BUILDROOT/snapd-2.42.1-0.x86_64//lib/systemd/system
install -m 0644 -t /builddir/build/BUILDROOT/snapd-2.42.1-0.x86_64//lib/systemd/system snapd.apparmor.service snapd.autoimport.service snapd.core-fixup.service snapd.failure.service snapd.seeded.service snapd.service snapd.snap-repair.service snapd.snap-repair.timer snapd.socket snapd.system-shutdown.service
install -d -m 0755 /builddir/build/BUILDROOT/snapd-2.42.1-0.x86_64//usr/libexec/snapd
install -m 0755 -t /builddir/build/BUILDROOT/snapd-2.42.1-0.x86_64//usr/libexec/snapd snapd.core-fixup.sh
install -m 0755 -t /builddir/build/BUILDROOT/snapd-2.42.1-0.x86_64//usr/libexec/snapd snapd.run-from-snap
make[1]: Leaving directory '/builddir/build/BUILD/snapd-2.42.1/data/systemd'
/usr/bin/make -C systemd-user install
make[1]: Entering directory '/builddir/build/BUILD/snapd-2.42.1/data/systemd-user'
# NOTE: old (e.g. 14.04) GNU coreutils doesn't -D with -t
install -d -m 0755 /builddir/build/BUILDROOT/snapd-2.42.1-0.x86_64//usr/lib/systemd/user
install -m 0644 -t /builddir/build/BUILDROOT/snapd-2.42.1-0.x86_64//usr/lib/systemd/user snapd.session-agent.service snapd.session-agent.socket
make[1]: Leaving directory '/builddir/build/BUILD/snapd-2.42.1/data/systemd-user'
/usr/bin/make -C systemd-env install
make[1]: Entering directory '/builddir/build/BUILD/snapd-2.42.1/data/systemd-env'
# NOTE: old (e.g. 14.04) GNU coreutils doesn't -D with -t
install -d -m 0755 /builddir/build/BUILDROOT/snapd-2.42.1-0.x86_64//usr/lib/environment.d/
install -m 0644 -t /builddir/build/BUILDROOT/snapd-2.42.1-0.x86_64//usr/lib/environment.d/ 990-snapd.conf
make[1]: Leaving directory '/builddir/build/BUILD/snapd-2.42.1/data/systemd-env'
/usr/bin/make -C dbus install
make[1]: Entering directory '/builddir/build/BUILD/snapd-2.42.1/data/dbus'
# NOTE: old (e.g. 14.04) GNU coreutils doesn't -D with -t
install -d -m 0755 /builddir/build/BUILDROOT/snapd-2.42.1-0.x86_64//usr/share/dbus-1/services
install -m 0644 -t /builddir/build/BUILDROOT/snapd-2.42.1-0.x86_64//usr/share/dbus-1/services io.snapcraft.Launcher.service io.snapcraft.Settings.service
make[1]: Leaving directory '/builddir/build/BUILD/snapd-2.42.1/data/dbus'
/usr/bin/make -C env install
make[1]: Entering directory '/builddir/build/BUILD/snapd-2.42.1/data/env'
# NOTE: old (e.g. 14.04) GNU coreutils doesn't -D with -t
install -d -m 0755 /builddir/build/BUILDROOT/snapd-2.42.1-0.x86_64//etc/profile.d
install -m 0644 -t /builddir/build/BUILDROOT/snapd-2.42.1-0.x86_64//etc/profile.d snapd.sh
make[1]: Leaving directory '/builddir/build/BUILD/snapd-2.42.1/data/env'
/usr/bin/make -C desktop install
make[1]: Entering directory '/builddir/build/BUILD/snapd-2.42.1/data/desktop'
install -d -m 0755 /builddir/build/BUILDROOT/snapd-2.42.1-0.x86_64//usr/share/applications
install -m 0644 -t /builddir/build/BUILDROOT/snapd-2.42.1-0.x86_64//usr/share/applications snap-handle-link.desktop
install -d -m 0755 /builddir/build/BUILDROOT/snapd-2.42.1-0.x86_64//etc/xdg/autostart
install -m 0644 -t /builddir/build/BUILDROOT/snapd-2.42.1-0.x86_64//etc/xdg/autostart snap-userd-autostart.desktop
make[1]: Leaving directory '/builddir/build/BUILD/snapd-2.42.1/data/desktop'
gcc      -o .o
gcc: fatal error: no input files
compilation terminated.
make: *** [<builtin>: .o] Error 1
error: Bad exit status from /var/tmp/rpm-tmp.wcuzgi (%install)

I don’t understand why gcc is being executed. The spec file says:

# Install all systemd and dbus units, and env files
pushd ./data
%make_install BINDIR="%{_bindir}" LIBEXECDIR="%{_libexecdir}" \
              SYSTEMDSYSTEMUNITDIR="%{_unitdir}" \
              SNAP_MOUNT_DIR="%{_sharedstatedir}/snapd/snap" \
              SNAPD_ENVIRONMENT_FILE="%{_sysconfdir}/sysconfig/snapd"
popd

and the makefile in the data directory has:

all install clean:
	$(MAKE) -C systemd $@
	$(MAKE) -C systemd-user $@
	$(MAKE) -C systemd-env $@
	$(MAKE) -C dbus $@
	$(MAKE) -C env $@
	$(MAKE) -C desktop $@

Can anyone please help?

The error log is quite confusing. Is this on rawhide?

Clearlinux actually.

1 Like

There’s a suspicious ' ' at the end of the make install line, perhaps it’s triggering an implicit rule to build a binary called ' '?

1 Like

I’ll try looking into this then.