Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 24 additions & 2 deletions datalad_debian/build_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
Interface,
build_doc,
)
from datalad.interface.results import (
get_status_dict
)
from datalad.interface.utils import (
eval_results,
)
Expand Down Expand Up @@ -170,7 +173,8 @@ def __call__(dsc, *, dataset=None, update_builder=False):
)
return

yield from pkg_ds.containers_run(
build_log = None
for r in pkg_ds.containers_run(
# needs to go in relative, because it is interpreted inside the
# (containerized) buildenv
dsc.relative_to(pkg_ds.pathobj) if dsc.is_absolute() else dsc,
Expand All @@ -183,4 +187,22 @@ def __call__(dsc, *, dataset=None, update_builder=False):
result_renderer='disabled',
return_type='generator',
on_failure='ignore',
)
):
# find the logfile
if r['status'] == 'ok' and r['action'] == 'add' \
and r['type'] == 'file' \
and r['refds'] == pkg_ds.pathobj.as_posix() \
and r['path'].startswith(r['refds'] + "/logs"):
Comment thread
adswa marked this conversation as resolved.
Outdated

build_log = r['path']
yield r

if build_log:
# check for success marker from singularity runscript
lines = Path(build_log).read_text().splitlines()[-3:]
if "# datalad-debian: build succeeded" not in lines:
yield get_status_dict(
action='deb_build_package',
status='error',
message=f"Build failed. Check {build_log} for details.",
ds=pkg_ds)
1 change: 1 addition & 0 deletions datalad_debian/resources/recipes/singularity-default
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,4 @@ logfile="/pkg/logs/${{logbase}}_${{ts}}_${{flavor}}.txt"
mkdir -p /pkg/logs
bash /doall.sh "$dsc" |& tee "$logfile"
echo -e "\n#\n# Builder exit: $(date -u --iso-8601=seconds)\n#\n" >> "$logfile"
echo -e "\n#\n# datalad-debian: build succeeded\n#\n" >> "$logfile"