Fixing "run all examples" command for macOS (Contributing page) #61
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While running this on my machine (Apple silicon mac) I got this:
xargs: command line cannot be assembled, too long
On macOS (and possibly other compatible systems), there is a limit on the size of arguments that can be passed using the
-I
flag. From the manual page (man xargs
):So, bumping this number up (e.g. adding
-S1024
) can resolve this problem.This change shouldn't affect other architectures, but It would be great if the reviewer could validate this on another setup different than mine.
Motivation
Smoother dev contributing experience (just copy n' paste)
Solution
Adding a flag to the To run all (runnable) examples, specifically to the
xargs
part of the command.xargs -S1024 -I {} sh -c 'if cargo run --example {} --quiet 1>/dev/null;
PR Checklist