Skip to content

Need better errors when running something on nothing

When you try to run a manual element with no commands define, it will try to run the strip-commands.

Because the user had no clue that the runtime needed to have a shell and actually, be a runtime; at least an imported one (reasonable for a newcomer), we have a weird error.

Would be better to tell the user that they need a runtime, than to just blindly execute the non-existing shell.

Error example:


[00:00:00][bfa2b513][build:foo.bst] FAILURE Running strip-commands
[00:00:00][bfa2b513][build:foo.bst] FAILURE Command 'find "/buildstream/install" -type f \
  '(' -perm -111 -o -name '*.so*' \
      -o -name '*.cmxs' -o -name '*.node' ')' \
  -exec sh -ec \
  'read -n4 hdr <"$1" # check for elf header
   if [ "$hdr" != "$(printf \\x7fELF)" ]; then
       exit 0
   fi
   debugfile="/buildstream/install/usr/lib/debug/$(basename "$1")"
   mkdir -p "$(dirname "$debugfile")"
   objcopy --only-keep-debug --compress-debug-sections "$1" "$debugfile"
   chmod 644 "$debugfile"
   strip --remove-section=.comment --remove-section=.note --strip-unneeded "$1"
   objcopy --add-gnu-debuglink "$debugfile" "$1"' - {} ';'' failed with exitcode 1

    Sandbox directory: /root/.cache/buildstream/build/foo-3wi0u9yf

    Printing the last 20 lines from log file:
    /root/.cache/buildstream/logs/my-project-name/foo/bfa2b513-build.33.log
    ======================================================================
           objcopy --only-keep-debug --compress-debug-sections "$1" "$debugfile"
           chmod 644 "$debugfile"
           strip --remove-section=.comment --remove-section=.note --strip-unneeded "$1"
           objcopy --add-gnu-debuglink "$debugfile" "$1"' - {} ';'
    bwrap: execvp sh: No such file or directory
    [00:00:00] FAILURE [foo.bst]      : Running strip-commands
    [00:00:00] FAILURE [foo.bst]      : Command 'find "/buildstream/install" -type f \
      '(' -perm -111 -o -name '*.so*' \
          -o -name '*.cmxs' -o -name '*.node' ')' \
      -exec sh -ec \
      'read -n4 hdr <"$1" # check for elf header
       if [ "$hdr" != "$(printf \\x7fELF)" ]; then
           exit 0
       fi
       debugfile="/buildstream/install/usr/lib/debug/$(basename "$1")"
       mkdir -p "$(dirname "$debugfile")"
       objcopy --only-keep-debug --compress-debug-sections "$1" "$debugfile"
       chmod 644 "$debugfile"
       strip --remove-section=.comment --remove-section=.note --strip-unneeded "$1"
       objcopy --add-gnu-debuglink "$debugfile" "$1"' - {} ';'' failed with exitcode 1
    ======================================================================
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information