Re: git: 42ee30f19cc7 - main - depend-cleanup.sh: Need to delete jemalloc.3 in objtree

From: Herbert J. Skuhra <herbert_at_gojira.at>
Date: Sat, 14 Dec 2024 11:47:35 UTC
On Sat, 14 Dec 2024 00:04:26 +0100, Warner Losh wrote:
> 
> The branch main has been updated by imp:
> 
> URL: https://cgit.FreeBSD.org/src/commit/?id=42ee30f19cc7ad85187cbf97155dbd5207a04845
> 
> commit 42ee30f19cc7ad85187cbf97155dbd5207a04845
> Author:     Warner Losh <imp@FreeBSD.org>
> AuthorDate: 2024-12-13 17:46:59 +0000
> Commit:     Warner Losh <imp@FreeBSD.org>
> CommitDate: 2024-12-13 23:04:34 +0000
> 
>     depend-cleanup.sh: Need to delete jemalloc.3 in objtree
>     
>     With the jemalloc.3 move into the tree (it's a generated file that we
>     don't/can't generate as part of the build), we need to remove it from
>     the .OBJDIR or make gets confused about how to build it (honestly for
>     reasons unknown).
>     
>     Sponsored by:           Netflix
> ---
>  tools/build/depend-cleanup.sh | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/tools/build/depend-cleanup.sh b/tools/build/depend-cleanup.sh
> index 6e7585f0afe6..81acf517f9d7 100755
> --- a/tools/build/depend-cleanup.sh
> +++ b/tools/build/depend-cleanup.sh
> @@ -231,3 +231,11 @@ clean_dep   lib/libcrypt crypt-md5    c
>  clean_dep   lib/libcrypt crypt-nthash c
>  clean_dep   lib/libcrypt crypt-sha256 c
>  clean_dep   lib/libcrypt crypt-sha512 c
> +
> +# 20241213  b55f5e1c4ae3  jemalloc: Move generated jemalloc.3 into lib/libc tree
> +if [ -e "$OBJTOP"/lib/libc/jemalloc.3 ]; then
> +	# Have to cleanup the jemalloc.3 in the obj tree since make gets
> +	# confused and won't use the one in lib/libc/malloc/jemalloc/jemalloc.3
> +	echo "Removing stale jemalloc.3 object"
> +	run rm -f "$OBJTOP"/lib/libc/jemalloc.3
> +fi

Does this actually work? Should this be

if [ -h "$OBJTOP"/lib/libc/jemalloc.3 ]; then

?