SDK ceased building, of a sudden

I was building harbour-clipper, which has some binaries (both static binary and libs) and at some point it seemed there was a memory issue. I believe when trying to build the 4.x aarch64.

Since then, I can’t build anything. The SDK is deployed on home with 35GB of free space.

Messages look like:

+ /home/mwa/SailfishOS/bin/sfdk qmake /home/mwa/src/sailfish/harbour-greenmahjong/harbour-simplemahjong.pro -spec linux-g++
sfdk: [I] Options from environment: -c target=SailfishOS-4.1.0.24-aarch64
error: db4 error(11) from dbenv->open: Resource temporarily unavailable
error: cannot open Packages index using db4 - Resource temporarily unavailable (11)
error: cannot open Packages database in /var/lib/rpm
Target initialization failed:
Rpm Exception
mkdir: cannot create directory ‘/home/mersdk/.mb2/wrappers/build-harbour-simplemahjong-SailfishOS_4_1_0_24_aarch64_in_Sailfish_OS_Build_Engine-Release’: No space left on device
mkdir: cannot create directory ‘/home/mersdk/.mb2/user-wrappers/build-harbour-simplemahjong-SailfishOS_4_1_0_24_aarch64_in_Sailfish_OS_Build_Engine-Release’: No space left on device
/usr/bin/mb2: line 1430: /home/mersdk/.mb2/wrappers/build-harbour-simplemahjong-SailfishOS_4_1_0_24_aarch64_in_Sailfish_OS_Build_Engine-Release/qmake: No such file or directory
chmod: cannot access '/home/mersdk/.mb2/wrappers/build-harbour-simplemahjong-SailfishOS_4_1_0_24_aarch64_in_Sailfish_OS_Build_Engine-Release/qmake': No such file or directory
mkdir: cannot create directory ‘/home/mersdk/.mb2/wrappers/build-harbour-simplemahjong-SailfishOS_4_1_0_24_aarch64_in_Sailfish_OS_Build_Engine-Release’: No space left on device
mkdir: cannot create directory ‘/home/mersdk/.mb2/user-wrappers/build-harbour-simplemahjong-SailfishOS_4_1_0_24_aarch64_in_Sailfish_OS_Build_Engine-Release’: No space left on device
/usr/bin/mb2: line 1790: /home/mersdk/.mb2/wrappers/build-harbour-simplemahjong-SailfishOS_4_1_0_24_aarch64_in_Sailfish_OS_Build_Engine-Release/make: No such file or directory

On a whim, restarted the machine and now I got this far:

+ /home/mwa/SailfishOS/bin/sfdk qmake /home/mwa/src/sailfish/harbour-clipper/harbour-clipper.pro -spec linux-g++
sfdk: [I] Options from environment: -c target=SailfishOS-4.1.0.24-aarch64
error: db4 error(11) from dbenv->open: Resource temporarily unavailable
error: cannot open Packages index using db4 - Resource temporarily unavailable (11)
error: cannot open Packages database in /var/lib/rpm
Target initialization failed:
Rpm Exception
mkdir: cannot create directory ‘/home/mersdk/.mb2/wrappers/build-harbour-clipper-SailfishOS_4_1_0_24_aarch64_in_Sailfish_OS_Build_Engine-Release’: No space left on device
mkdir: cannot create directory ‘/home/mersdk/.mb2/user-wrappers/build-harbour-clipper-SailfishOS_4_1_0_24_aarch64_in_Sailfish_OS_Build_Engine-Release’: No space left on device
/usr/bin/mb2: line 1430: /home/mersdk/.mb2/wrappers/build-harbour-clipper-SailfishOS_4_1_0_24_aarch64_in_Sailfish_OS_Build_Engine-Release/qmake: No such file or directory
chmod: cannot access '/home/mersdk/.mb2/wrappers/build-harbour-clipper-SailfishOS_4_1_0_24_aarch64_in_Sailfish_OS_Build_Engine-Release/qmake': No such file or directory
mkdir: cannot create directory ‘/home/mersdk/.mb2/wrappers/build-harbour-clipper-SailfishOS_4_1_0_24_aarch64_in_Sailfish_OS_Build_Engine-Release’: No space left on device
mkdir: cannot create directory ‘/home/mersdk/.mb2/user-wrappers/build-harbour-clipper-SailfishOS_4_1_0_24_aarch64_in_Sailfish_OS_Build_Engine-Release’: No space left on device
/usr/bin/mb2: line 1790: /home/mersdk/.mb2/wrappers/build-harbour-clipper-SailfishOS_4_1_0_24_aarch64_in_Sailfish_OS_Build_Engine-Release/make: No such file or directory
chmod: cannot access '/home/mersdk/.mb2/wrappers/build-harbour-clipper-SailfishOS_4_1_0_24_aarch64_in_Sailfish_OS_Build_Engine-Release/make': No such file or directory
Building target platforms: aarch64-meego-linux-gnu
Building for target aarch64-meego-linux-gnu
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.irPU6c
+ umask 022
+ cd /home/mwa/src/sailfish/build-harbour-clipper-SailfishOS_4_1_0_24_aarch64_in_Sailfish_OS_Build_Engine-Release
+ LANG=C
+ export LANG
+ unset DISPLAY
+ CFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -march=armv8-a'
+ export CFLAGS
+ CXXFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -march=armv8-a'
+ export CXXFLAGS
+ FFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -march=armv8-a -I/usr/lib64/gfortran/modules'
+ export FFLAGS
+ LD_AS_NEEDED=1
+ export LD_AS_NEEDED
+ export QT_SELECT=5
+ QT_SELECT=5
+ qmake -qt=5 -makefile 'QMAKE_CFLAGS_RELEASE=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -march=armv8-a' 'QMAKE_CFLAGS_DEBUG=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -march=armv8-a' 'QMAKE_CXXFLAGS_RELEASE=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -march=armv8-a' 'QMAKE_CXXFLAGS_DEBUG=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -march=armv8-a' QMAKE_STRIP=: PREFIX=/usr LIBDIR=/usr/lib64
Usage: /usr/lib64/qt5/bin/qmake [mode] [options] [files]

QMake has two modes, one mode for generating project files based on
some heuristics, and the other for generating makefiles. Normally you
shouldn't need to specify a mode, as makefile generation is the default
mode for qmake, but you may use this to test qmake on an existing project

Mode:
  -project       Put qmake into project file generation mode
                 In this mode qmake interprets files as files to
                 be built,
                 defaults to *; *; *; *.ts; *.xlf; *.qrc
                 Note: The created .pro file probably will 
                 need to be edited. For example add the QT variable to 
                 specify what modules are required.
  -makefile      Put qmake into makefile generation mode (default)
                 In this mode qmake interprets files as project files to
                 be processed, if skipped qmake will try to find a project
                 file in your current working directory

Warnings Options:
  -Wnone         Turn off all warnings; specific ones may be re-enabled by
                 later -W options
  -Wall          Turn on all warnings
  -Wparser       Turn on parser warnings
  -Wlogic        Turn on logic warnings (on by default)
  -Wdeprecated   Turn on deprecation warnings (on by default)

Options:
   * You can place any variable assignment in options and it will be     *
   * processed as if it was in [files]. These assignments will be parsed *
   * before [files].                                                     *
  -o file        Write output to file
  -d             Increase debug level
  -t templ       Overrides TEMPLATE as templ
  -tp prefix     Overrides TEMPLATE so that prefix is prefixed into the value
  -help          This help
  -v             Version information
  -after         All variable assignments after this will be
                 parsed after [files]
  -norecursive   Don't do a recursive search
  -recursive     Do a recursive search
  -set <prop> <value> Set persistent property
  -unset <prop>  Unset persistent property
  -query <prop>  Query persistent property. Show all if <prop> is empty.
  -cache file    Use file as cache           [makefile mode only]
  -spec spec     Use spec as QMAKESPEC       [makefile mode only]
  -nocache       Don't use a cache file      [makefile mode only]
  -nodepend      Don't generate dependencies [makefile mode only]
  -nomoc         Don't generate moc targets  [makefile mode only]
  -nopwd         Don't look for files in pwd [project mode only]


RPM build errors:
error: Bad exit status from /var/tmp/rpm-tmp.irPU6c (%build)
    Bad exit status from /var/tmp/rpm-tmp.irPU6c (%build)
18:42:26: The process "/home/mwa/.config/SailfishSDK/libsfdk/build-target-tools/Sailfish OS Build Engine/SailfishOS-4.1.0.24-aarch64/qmake" exited with code 1.
Error while building/deploying project harbour-clipper (kit: SailfishOS-4.1.0.24-aarch64 (in Sailfish OS Build Engine))
The kit SailfishOS-4.1.0.24-aarch64 (in Sailfish OS Build Engine) has configuration issues which might be the root cause for this problem.
When executing step "qmake"

Ok. Not really an answer as to why, but, uninstalling the SDK targets and re-installing them ‘worked’.

The VM disk was full?

could be the actual error. The docker build doesn’t work for me out of the box, so I’m using the Virtualbox-based SDK → that’s a real VM with limited disk space (irrespective of how much free space is available on the host).

I observed this behaviour when trying to build components of osm-server, too.
Both RAM and disk space were not sufficient in the default configuration (of course this depends on how much other stuff you have compiled in the VM previously, as there might be some leftovers).

You can increase the storage space available to the SDK Build Engine VM either under Qt Creator Options > Sailfish OS > Build Engine or from command line with sfdk engine set.

Yes, it must have been this. I was just a bit surprised that it tanked on something that I had compiled before. As you suggest, probably ‘cruft’.

ah! just found them! could probably be done in the virtualbox settings too?

Pity the VM description field can be missed easily in the vbox UI. In case of Sailfish SDK VMs it says:

ATTENTION: This virtual machine is managed by the Sailfish SDK. Do not try to alter it!

It’s easy to break things by modifying the VMs without SDK assistance.

Thanks: sfdk engine set = what you where thinking of?

E.g. sfdk engine set vm.storage-size=16000. Passing --help should help.

Yes, help-building too, but it’s a bit shy on examples … it’s under the rubric: Build engine properties (go figure) … so here the bits.

    vm.cpu-count <number>
        The number of virtual CPUs inside the build engine virtual machine.
        The maximum is limited by the number of CPUs available on the host.
    
    vm.memory-size <megabytes>
        The amount of memory (RAM) available to the build engine virtual
        machine. The maximum is limited by the size of the physical memory
        available on the host.
    
    vm.storage-size <megabytes>
        The amount of storage (disk) space available to the build engine
        virtual machine. Storage size can only grow; shrinking is not
        possible.
        vm.cpu-count <number>
            The number of virtual CPUs inside the build engine virtual machine.
            The maximum is limited by the number of CPUs available on the host.
        
        vm.memory-size <megabytes>
            The amount of memory (RAM) available to the build engine virtual
            machine. The maximum is limited by the size of the physical memory
            available on the host.
        
        vm.storage-size <megabytes>
            The amount of storage (disk) space available to the build engine
            virtual machine. Storage size can only grow; shrinking is not
            possible.
        
        vm.swap-size <megabytes>
            The size of swap. Setting to zero disables swap (default). Swap may
            consume the free storage size inside the virtual machine. If the
            requested size cannot be served, the highest possible size will be
            set instead.
   
    vm.swap-size <megabytes>
        The size of swap. Setting to zero disables swap (default). Swap may
        consume the free storage size inside the virtual machine. If the
        requested size cannot be served, the highest possible size will be
        set instead.