easybuild-framework icon indicating copy to clipboard operation
easybuild-framework copied to clipboard

fix handling of quotes in rpath wrapper

Open Flamefire opened this issue 1 year ago • 3 comments

In some software the compiler must be invoked with an argument containing a literal single quote which requires escaping in the call. E.g.: gcc -DFOO=\'value\'

However the current rpath wrapper would remove those single quotes causing errors during compilation or erronous behavior of the compiled binary.

Fix by replacing the eval of the rpath_args.py output by readarray -t. An array asignment could be used (CMD_ARGS=( $(rpath_args.py ...) )) but that would break up arguments containing spaces. Quotes from the output are kept literally, so quoting to avoid this is not possible. readarray -t works and is widely available.

Also some minor fixes related to quoting in the bash script template.

Note: I used the NULL separator to separate arguments in the output as there is a (very small) chance an argument to the compiler contains newlines.

Flamefire avatar Dec 12 '24 11:12 Flamefire

@Flamefire Failing tests should be looked into, and meanwhile merge conflicts have emerged as well

boegel avatar Sep 03 '25 16:09 boegel

Resolved the merge conflicts. Test failures were mostly due to --trace output of run_shell_cmd.

I also switched the separator to NULL similar to find -print0 to make it (even more) robust

Flamefire avatar Sep 04 '25 08:09 Flamefire

Shall we add a special case to tests to detect the GitHub rate limit and skip/succeed them in PRs?

Flamefire avatar Oct 07 '25 14:10 Flamefire