psychoinformatics-de / datalad-debian

DataLad extension for working with Debian packages and package repositories
Other
2 stars 5 forks source link

`No space left on device`-error when building with `datalad deb-build-package`. #114

Closed christian-monch closed 2 years ago

christian-monch commented 2 years ago

I am building the inm7-distribution with datalad-debian. The current distribution file has 48 packages and 69 dsc-files. I am building binaries from all dsc-file with something like this:

#!/usr/bin/env bash

cd inm7-distribution/packages
for p in $(ls -1); do
    pushd $p
    for d in $(ls -1 *.dsc); do
        datalad deb-build-package $d
    done
    popd
    datalad save -r
done

when the last package is built (from rich/rich_9.9.0-1.dsc) I receive the error Cannot write: No space left on device, which is reproducible. More specific:

❱ datalad deb-build-package rich_9.9.0-1.dsc                                                                                                                                                                                         
[INFO   ] Making sure inputs are available (this may take some time)                                           
[INFO   ] == Command start (output follows) =====                                                              
INFO:    Converting SIF file to temporary sandbox...                                                                                                                              

#                                                                                                                                                                                                                                                                       
# Extracting the source package: 2022-07-15T07:11:13+00:00                                                                                                                                                           
#                                                                                                                                                                                                                 

dpkg-source: warning: extracting unsigned source package (rich_9.9.0-1.dsc)                                                                                                                                                                                                   
dpkg-source: info: extracting rich in source                                                                                                                                                                                                                            
dpkg-source: info: unpacking rich_9.9.0.orig.tar.xz                                                                                                                                                                                                                     
tar: rich-9.9.0/imgs/downloader.gif: Wrote only 7680 of 10240 bytes                                                                                                                                                                                                     
tar: rich-9.9.0/imgs/features.png: Cannot write: No space left on device                                                                                                                                
tar: rich-9.9.0/imgs/hello_world.png: Cannot write: No space left on device                                                                                                                             
tar: rich-9.9.0/imgs/log.png: Cannot write: No space left on device                                                                                                                                                                                                     
tar: rich-9.9.0/imgs/logging.png: Cannot write: No space left on device                                                                                                                                             
tar: rich-9.9.0/imgs/markdown.png: Cannot write: No space left on device                                                                                                                                                                        
tar: rich-9.9.0/imgs/print.png: Cannot write: No space left on device                                                                                                                                                                                                   
...

I did not look into it any further yet. @aqw suggests that it is a limitation in the container environment.

mih commented 2 years ago

Thanks @christian-monch for detecting this grave bug. It would prevent any build of source packages larger than 16 MB (less actually).

A (or the) solution is to add --workdir to the singularity run call and point it to a tmpdir on the host system

mih commented 2 years ago

With this patch, it works for me:

diff --git a/datalad_debian/bootstrap_builder.py b/datalad_debian/bootstrap_builder.py
index aec7837..deffd49 100644
--- a/datalad_debian/bootstrap_builder.py
+++ b/datalad_debian/bootstrap_builder.py
@@ -120,6 +120,7 @@ class BootstrapBuilder(Interface):
             '--containall ' \
             '--writable ' \
             '--no-home ' \
+            '--workdir {{tmpdir}} ' \
             '{img} {cmd}'

         # this is a fresh addition of the build env

This requires a new run of deb-bootstrap-builder in the distribution builder dataset, and then a datalad deb-build-package with --update-builder in the package datasets.

christian-monch commented 2 years ago

Thx