Date: Sat, 20 Mar 2021 13:02:24 GMT From: Jessica Clarke <jrtc27@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: 8c9e45503fe4 - main - tools/build: Improve host-symlinks failure mode Message-ID: <202103201302.12KD2OxK015270@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=8c9e45503fe41732f72e1a4cc9a231e63b4289ba commit 8c9e45503fe41732f72e1a4cc9a231e63b4289ba Author: Jessica Clarke <jrtc27@FreeBSD.org> AuthorDate: 2021-03-20 13:00:34 +0000 Commit: Jessica Clarke <jrtc27@FreeBSD.org> CommitDate: 2021-03-20 13:00:34 +0000 tools/build: Improve host-symlinks failure mode Since set -e is enabled by sys.mk, if the tool cannot be found in PATH then the entire shell command line fails, causing us to not print the error message below and instead silently (due to the @) fail, only getting the usual "Error code 1" print from bmake. Thus, provide a dummy default that will never exist (the same as is used by meta2deps.sh) if which fails so that we get the error message as intended. MFC after: 1 week --- tools/build/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/build/Makefile b/tools/build/Makefile index effe8b9cb31d..31d027f75ce2 100644 --- a/tools/build/Makefile +++ b/tools/build/Makefile @@ -301,7 +301,8 @@ _host_tools_to_symlink:=${_host_tools_to_symlink:Nsh} host-symlinks: @echo "Linking host tools into ${DESTDIR}/bin" .for _tool in ${_host_tools_to_symlink} - @export PATH=$${PATH}:/usr/local/bin; source_path=`which ${_tool}`; \ + @export PATH=$${PATH}:/usr/local/bin; \ + source_path=`which ${_tool} || echo /dev/null/no/such`; \ if [ ! -e "$${source_path}" ] ; then \ echo "Cannot find host tool '${_tool}' in PATH ($$PATH)." >&2; false; \ fi; \
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202103201302.12KD2OxK015270>