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 bin/BuildPackages.sh compatible with more systems (in particular, ones without wait -n)? #4289

Closed
wilfwilson opened this issue Feb 25, 2021 · 3 comments · Fixed by #4291

Comments

@wilfwilson
Copy link
Member

This is a bit of a wish list request, but I thought I'd throw it out there in case anyone wants to work on it.

I only learned of the existence of the --parallel option to bin/BuildPackages.sh (introduced in @ChrisJefferson's PR #3922) because of the in-preparation release notes for GAP 4.11.1. It's great... except that it doesn't work on my computer 🙁. I apparently have an old version of bash, where wait -n gives:

$ wait -n
-bash: wait: -n: invalid option
wait: usage: wait [n]

(A quick Google suggests that wait -n was added in bash 4.3, in 2014).

The comments on #3922 suggest that making something more robust might take a bit of effort, but if anyone has any suggestions for quick and easy fixes, I'm open to your ideas.

@ChrisJefferson
Copy link
Contributor

Can you try replacing the wait -n line with: wait -n 2>&1 >/dev/null || wait. This will reduce the amount of parallelization we do (it will spawn 4 things, then wait for all of them), but will at least still work.

@wilfwilson
Copy link
Member Author

To check, is that command saying "run wait -n, but if that fails, run wait?

I tried the line yesterday with just wait rather than wait -n, and that resulted in about a 45% reduction in time taken (about 5½ minutes to about 3 minutes). It's the same with your suggested line. Thanks. I'll make a PR.

@ChrisJefferson
Copy link
Contributor

Yes, and the 2>&1 >/dev/null hides any error message from wait -n.

If you are curious, wait, means "wait for all background processes to finish running". wait -n means "wait for one background process to finish running". As you say it was added in bash 4.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants