ninenines / erlang.mk

A build tool for Erlang that just works.
https://erlang.mk
ISC License
578 stars 241 forks source link

Make failed, argument list too long #994

Open shionryuu opened 7 months ago

shionryuu commented 7 months ago

I try to compile project with erlang.mk, but it failed with following error:

$ curl https://erlang.mk/erlang.mk -o erlang.mk
...
$ echo "include erlang.mk" > Makefile
$ make
...
make[1]: /bin/sh: Argument list too long
make[1]: *** [erlang.mk:4724: /home/user/workspace/erlang/project/.erlang.mk/last-makefile-change] Error 127
make: *** [erlang.mk:4498: app] Error 2
essen commented 7 months ago

Try using it from a directory closer to /.

Some systems have weird limits, yours might, but you didn't provide which one you are using so I can only guess.

shionryuu commented 7 months ago

I'm currently using Manjaro Linux.

Move close to / doesn't help, my project contain more than 6000 files. The file list of touch (line 4725) is too long.

4720 ifeq ($(IS_APP)$(IS_DEP),)
4721 ifneq ($(words $(ERL_FILES) $(CORE_FILES) $(ASN1_FILES) $(MIB_FILES) $(XRL_FILES) $(YRL_FILES)),0)
4722 # Rebuild everything when the Makefile changes.
4723 $(ERLANG_MK_TMP)/last-makefile-change: $(MAKEFILE_LIST) | $(ERLANG_MK_TMP)
4724    $(verbose) if test -f $@; then \
4725        touch $(ERL_FILES) $(CORE_FILES) $(ASN1_FILES) $(MIB_FILES) $(XRL_FILES) $(YRL_FILES); \
4726        touch -c $(PROJECT).d; \
4727    fi
4728    $(verbose) touch $@
essen commented 7 months ago

Ah understood. I guess that would be a problem. Would need to split into multiple commands instead of just one, with that many files.

What's the maximum command line size, do you know?

essen commented 7 months ago

Otherwise figuring out an alternative way to do this might be even better.