From 21e9b1823d4e6dce885eebc169647ecf602299ee Mon Sep 17 00:00:00 2001 From: Jules Villard Date: Tue, 18 Aug 2020 06:25:45 -0700 Subject: [PATCH] [build] fix "bad substitution" in shell Summary: Somehow bash now sees this as `${\#var}`, which is invalid, and fails rather loudly on my laptop which pollutes the build output. Removing `\` breaks other platforms. So, switch to using `wc -m` to count the number of characters. Reviewed By: ngorogiannis Differential Revision: D23187505 fbshipit-source-id: a22cc0fe5 --- Makefile.config | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile.config b/Makefile.config index eb571774d..86c2d0e44 100644 --- a/Makefile.config +++ b/Makefile.config @@ -128,9 +128,8 @@ endif MAKE := $(MAKE) INTERACTIVE=$(INTERACTIVE) -# 99999 PIDs ought to be enough for anybody, but check if pid_max can be found just in case -MAX_PID_SIZE = \ - $(shell PID_MAX=$$(cat /proc/sys/kernel/pid_max 2>/dev/null); echo $${\#PID_MAX} || echo 5) +# 9999999 PIDs ought to be enough for anybody, but check if pid_max can be found just in case +MAX_PID_SIZE = $(shell echo $$(( $$(wc -m < /proc/sys/kernel/pid_max 2>/dev/null) - 1 )) || echo 7) # Arguments: # $(1) is a string describing the command