Skip to content

configury: remove whitespace from "conftestval"-style tests #13286

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

Merged
merged 2 commits into from
Jun 4, 2025

Conversation

jsquyres
Copy link
Member

Several configure tests write integer result values to files and then do something like foo=$(cat conftestval). However, if the conftestval file contains whitespace around the integer value (e.g., if conftestval was written by a Fortran test code), then $foo will still contain that whitespace, too -- which then propagates throughout the configury and elsewhere.

This commit uses xargs to strip off the whitespace. There's really only one place where this is happening that is a problem, but let's do it in all places where we foo=$(cat conftestval) with integer results, just as a matter of consistency and defensive programming.

Thanks to Lisandro Dalcin (@dalcinl) for raising the issue.

Refs #13285.

jsquyres added 2 commits May 31, 2025 09:24
Several configure tests write integer result values to files and then
do something like foo=$(cat conftestval).  However, if the conftestval
file contains whitespace around the integer value (e.g., if
conftestval was written by a Fortran test code), then $foo will still
contain that whitespace, too -- which then propagates throughout the
configury and elsewhere.

This commit uses xargs to strip off the whitespace.  There's really
only one place where this is happening that is a problem, but let's do
it in all places where we foo=$(cat conftestval) with integer results,
just as a matter of consistency and defensive programming.

Thanks to Lisandro Dalcin for raising the issue.

Signed-off-by: Jeff Squyres <[email protected]>
No code or logic changes.

Signed-off-by: Jeff Squyres <[email protected]>
@jsquyres jsquyres merged commit d6b2630 into open-mpi:main Jun 4, 2025
15 checks passed
@jsquyres jsquyres deleted the pr/safer-conftestval-results branch June 4, 2025 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants