"make:execvp:/bin/sh:Argument list too long" error during build with make command

Asked 2 years ago, Updated 2 years ago, 116 views

There is an error when building with the make command.
I can't tell if the Linux setting is bad, the Makefile is bad, or the shell is bad, so please let me know.

Creating.build/goshim.tar.bz2
make:execvp:/bin/sh:Argument list too long
make:*** [Makefile:316:.build/goshim.tar.bz2] Error 127
GOSHIM_DEPS=$(shell./scripts/goListFiles.sh$(PKGNAME)/core/chaincode/shim)
orderer: $(BUILD_DIR)/bin/orderer

$(BUILD_DIR)/goshim.tar.bz2:$(GOSHIM_DEPS)
        @echo "Creating$@"
        @tar-jhc-C$(GOPATH)/src$(patsubst$(GOPATH)/src/%,%,$(GOSHIM_DEPS))>$@

1.Try dividing the shell argument by xargs

The same error occurred and was not resolved.
Below is a Makefile sentence that replaces @tar-jhc-C$(GOPATH)/src$(patsubst$(GOPATH)/src/%, %, $(GOSHIM_DEPS)).

@./scripts/goListFiles.sh$(PKGNAME)/core/chaincode/shim|seds#$(GOPATH)/src/##g|xargstar-jhc-C$(GOPATH)/src>$@

2. Increase the shell argument limit

I have listed the values shown below, but they have not been resolved.

getconf ARG_MAX

3. Build with ubuntu,centOS on x64 instead of ARM

The build was successful without any problems.

linux bash shellscript makefile

2022-09-30 21:38

1 Answers

GNU tar allows you to import files from files specified in the -T option instead of specifying them as arguments.

If Raspberry pi's tar supports this option, why don't you write a list of files to the appropriate file and specify the file with the tar's -T option?


2022-09-30 21:38

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.