Re: [bitbake-devel] [PATCH 2/2] bitbake-setup: write notes for generated build configs

Ernest Van Hoecke <[email protected]> Mon, 1 Jun 2026 15:55:30 +0200
Newsgroups org.openembedded.lists.bitbake-devel
Message-ID <3yo5dz6bcwiwkwzqe7ucg3u4lkfpgjhzgmwqnehllgehxrmopt@vtqynopxxjug>
On Mon, Jun 01, 2026 at 03:30:48PM +0200, Alexander Kanavin wrote:
> On Mon, 1 Jun 2026 at 14:53, Ernest Van Hoecke via
> lists.openembedded.org
> <[email protected]> wrote:
> 
> > Yes, I tested with some newlines explicitly written and this worked fine.
> > Since it just comes from a json string and is passed to `f.write()` I
> > don't believe any special escaping is necessary, just "\n" is fine.
> >
> > My understanding is that the Python json library should handle this well
> > and converts it to a real newline in the python string.
> 
> I need to ask though: how practical and readable is it going to be,
> when written into the json? Notes are meant as multiple paragraphs of
> text, and it would be good to be able to write them that way, instead
> of some specially-formatted single string.
> 
> Alex
>

I considered this and agree, there's no true beautiful solution here.
The description field also has this issue, granted, that's meant to be
much shorter than notes.

Since json doesn't support multiline strings, the only alternative is
making this field a list of strings and concatenating them in code. I'm
certainly open to that and can send a v2 doing it that way (it'd look
like an extra "\n".join()).
 
Ernest