osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/41142?usp=email )
Change subject: buildsystem/gen_links: catch file not found errors ......................................................................
buildsystem/gen_links: catch file not found errors
Tweak gen_links() to sequentially iterate over the files for which symlinks shall be created, and verify that each symlink target exists. If the target does not exist, abort with an error:
ERROR in bsc/gen_links.sh: file not found File (from FILES): SDP_EncDec.cc DIR: ../deps/titan.Libraries.TCCUsefulFunctions/src
This is slightly slower than the parallel approach from before, but it prevents adding subtle bugs that don't trigger every time so IMHO the trade-off is worth it.
Change-Id: I6b0440dda7d5b37a4baa4b16f3979f7fb32b7b15 --- M _buildsystem/gen_links.inc.sh 1 file changed, 14 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/42/41142/1
diff --git a/_buildsystem/gen_links.inc.sh b/_buildsystem/gen_links.inc.sh index 161754c..b7272e2 100644 --- a/_buildsystem/gen_links.inc.sh +++ b/_buildsystem/gen_links.inc.sh @@ -27,9 +27,20 @@ local files="$*"
for f in $files; do - (ln -sf \ - "$(realpath "$TOPDIR/$PROJECTDIR/$dir/$f")" \ - "$BUILDDIR/$PROJECTDIR/$f") & + local target="$(realpath "$TOPDIR/$PROJECTDIR/$dir/$f")" + if ! [ -e "$target" ]; then + echo + echo "ERROR in $PROJECTDIR/gen_links.sh: file not found" + echo " File (from FILES):" + echo " $f" + echo " DIR:" + echo " $dir" + echo + exit 1 + fi + ln -sf \ + "$target" \ + "$BUILDDIR/$PROJECTDIR/$f" done }