RFR: 8296478: Rework 8282948 and 8282700 to use the new autoconf UTIL_ARG_WITH [v5]
Julian Waters
jwaters at openjdk.org
Tue Nov 22 16:04:33 UTC 2022
On Fri, 18 Nov 2022 11:27:14 GMT, Magnus Ihse Bursie <ihse at openjdk.org> wrote:
>> Julian Waters has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Uh oh
>
> Aaaahhh, **that** bug. I've run into that before. I did attempt to fix it but after wasting too many hours I gave up. :-( It seems to be a limitation in m4 that I cannot understand how to get around. At some point, the string literal, even though quoted inside the `[...]`, is expanded and parsed as m4 macro expansion arguments. In theory, I should have been able to add an additional layer of quoting and then un-quote it once it was past the problematic point, but that did not work.
>
> I solved the problem by not solving it, and instead rephrased the message to not need the comma. (Imho, this limitation actually improved the quality of the descriptions, so it was not bad per se).
>
> But I agree that it is annoying to have such a limitation in `UTIL_DEFUN_NAMED`. If you want to have a go at trying to solve it, please do! I'll fully admit my shortcomings and state that trying to solve this passes my knowledge and ability to manipulate m4.
>
> Or, maybe, you could add some documentation to `UTIL_DEFUN_NAMED` and `UTIL_ARG_WITH`, saying that comma is not allowed in the values.
@magicus I need some of your input on this:
Typically when using AC_ARG_WITH one would surround the if block with an extra quote, for instance if we had `if ! [[ $JDK_RC_NAME =~ ^[[:print:]]*$ ]]` the code in m4 would have an extra set of brackets to quote it so m4 doesn't absolutely wreck the final script that we want to emit, such as `if [ ! [[ $JDK_RC_NAME =~ ^[[:print:]]*$ ]] ]`
I'm about halfway through fixing the whole issue with commas, and I'm fairly certain I could lump the problem with quoting expansion in there too. My question though is: When it comes to parameters that take "predicate" code blocks as arguments (Such as CHECK_VALUE), should I have UTIL_ARG_NAMED handle the annoying issue of quoting entirely so the caller can freely pass `if ! [[ $JDK_RC_NAME =~ ^[[:print:]]*$ ]]` without having to worry at all, or should I make users still have to keep passing that extra level of quotation into things like IF_GIVEN to match what is already being done?
-------------
PR: https://git.openjdk.org/jdk/pull/11020
More information about the build-dev
mailing list