RFR: 8301753: AppendFile needs to add a new line to be compatible with old make
Magnus Ihse Bursie
ihse at openjdk.org
Wed Feb 8 13:55:44 UTC 2023
On Tue, 7 Feb 2023 20:56:01 GMT, Leonid Mesnik <lmesnik at openjdk.org> wrote:
> The newline is added to be compatible with old make 3.81 which is still used on MacOSX.
> Fixed actually by dnsimon.
Possible solutions include:
* Stripping any potential newline from the end of the input, and keep unconditionally adding one in the printf statement like in the current patch.
* Checking if the input ends with a newline, and print the additional `\n` only if it doesn't.
* Change the requirements for both the make 4+ and printf version to never have input ending in a newline. This would likely have to be verified by an assert.
My personal recommendation would be to pick the first solution on this list, I think it is easiest to implement in Make.
-------------
PR: https://git.openjdk.org/jdk/pull/12461
More information about the build-dev
mailing list