[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
master
Jules Villard 4 years ago committed by Facebook GitHub Bot
parent dcc12d0a42
commit 21e9b1823d

@ -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

Loading…
Cancel
Save