Skip to content

source-bundle: %{build-root} is not expanded to where the generated scripts run the builds

Given the following demo bst file:

kind: manual

depends:
- debian-stretch.bst

config:
  build-commands:
  - echo hello >world

  install-commands:
  - cp %{build-root}/world %{install-root}/world

The build and install commands work correctly in a normal sandboxed bst build, but the build script that bst source-bundle creates contains the following sequence of commands:

cp -a "$SRCDIR/hello-world" '/buildstream/build/hello-world'
cd '/buildstream/build/hello-world'

export PREFIX='/buildstream/install'

export HOME=/tmp LC_ALL=C LOGNAME=tomjon MAKEFLAGS=-j6 PATH=/usr/bin:/bin:/usr/sbin:/sbin SHELL=/bin/sh TERM=dumb TZ=UTC USER=tomjon USERNAME=tomjon V=1

# Build the module
(set -ex; echo hello >world
) || exit 1
(set -ex; cp /buildstream/build/world /buildstream/install/world
) || exit 1
(set -ex; :
) || exit 1

It seems that either the sources should be copied to /buildstream/build and not /buildstream/build/<build-name> (the whole directory is cleaned in any case), or %{build-root} should be expanded to the subdirectory that is actually used for the build.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information