Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make clean: split file list into manageable chunks #1897

Merged
merged 1 commit into from
Oct 26, 2017

Conversation

jforissier
Copy link
Contributor

"make clean" might fail with the following error:

make[2]: execvp: /bin/bash: Argument list too long

This error was observed on a platform that has lots of additional
source files compared to upstream (drivers, etc.), and that sets a long
output path on the command line (make ... O=/some/long/path).

Fix the error by splitting the file list into more manageable chunks.
Note that removing one file at a time is not reasonable, because
spawning too may shells takes quite a long time (up to 7-10 seconds to
"make clean").

Signed-off-by: Jerome Forissier jerome.forissier@linaro.org
Reported-by: Lijianhui airbak.li@hisilicon.com

mk/cleandirs.mk Outdated
# (200 files at a time), to minimize the odds of having:
# "/bin/bash: Argument list too long"
define do-rm-f
$(call _do-rm, $(wordlist 1, 200, $(1)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_do-rm-f?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doh! That's what happens when you decide to rename something at the last minute.
Will fix, thanks.

Copy link
Contributor

@etienne-lms etienne-lms left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested ok with s/_do-rm/_do-rm-f/ fix.

mk/cleandirs.mk Outdated

define _do-rm-f
${q}rm -f $1

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: spurious empty line

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. Leftover from a previous solution whic hwas simply iterating with foreach.
Will fix.

mk/cleandirs.mk Outdated
$(call _do-rm, $(wordlist 1, 200, $(1)))
$(eval _tail := $(wordlist 201, $(words $(1)), $(1)))
$(if $(_tail), $(call do-rm-f, $(_tail)))
$(eval _tail :=)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you need this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, un-necessary cleanup indeed. Will fix.

mk/cleandirs.mk Outdated
# (200 files at a time), to minimize the odds of having:
# "/bin/bash: Argument list too long"
define do-rm-f
$(call _do-rm, $(wordlist 1, 200, $(1)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

@jforissier
Copy link
Contributor Author

Update

@jenswi-linaro
Copy link
Contributor

Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>

"make clean" might fail with the following error:

  make[2]: execvp: /bin/bash: Argument list too long

This error was observed on a platform that has lots of additional
source files compared to upstream (drivers, etc.), and that sets a long
output path on the command line (make ... O=/some/long/path).

Fix the error by splitting the file list into more manageable chunks.
Note that removing one file at a time is not reasonable, because
spawning too may shells takes quite a long time (up to 7-10 seconds to
"make clean").

Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reported-by: Lijianhui <airbak.li@hisilicon.com>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
@jforissier jforissier merged commit bc0d271 into OP-TEE:master Oct 26, 2017
@jforissier jforissier deleted the clean-huge-file-list branch October 26, 2017 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants