#2908: Cactus: Fixed arg list too long error.
| Reporter: | Max Morris |
| Status: | open |
| Milestone: | |
| Version: | |
| Type: | bug |
| Priority: | major |
| Component: |
Comment (by Roland Haas):
The key line in the proposed change is
OBJS-bytes := $(shell (echo -n $(OBJS) | wc --bytes) 2>/dev/null || echo -1)
However making a small dummy Makefile:
# make a long set of arguments >2million
OBJS=$(shell awk 'BEGIN{for(i=0;i<200000;i++) print "01234567890";exit'})
OBJS-bytes := $(shell (echo -n $(OBJS) | wc --bytes) 2>/dev/null || echo -1)
$(info $(OBJS-bytes))
and running via
make -f Makefile
on my Debian based Linux box I get:
haengie2: ~/tmp$ make -f Makefile
make: /bin/sh: Argument list too long
make: *** No targets.