All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: bbnpreetsingh@gmail.com, bitbake-devel@lists.openembedded.org
Cc: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Subject: Re: [bitbake-devel] [PATCH] cooker: fix -w with a file name that has no directory
Date: Tue, 17 Nov 2026 12:32:30 +0000	[thread overview]
Message-ID: <a41c1517f39b3f6ea520094767ee2b98ab010b7a.camel@linuxfoundation.org> (raw)
In-Reply-To: <20261114185534.7-1-bbnpreetsingh@gmail.com>

On Sat, 2026-11-14 at 18:55 +0000, Baban via bitbake-devel wrote:
> "bitbake -w events.json" fails with:
> 
>   FileNotFoundError: [Errno 2] No such file or directory: ''
> 
> There is no directory to create for a bare file name, so don't try.
> 
> Fixes: ee174b231897 ("cooker: Add support for BB_DEFAULT_EVENTLOG")
> Signed-off-by: Babanpreet Singh <bbnpreetsingh@gmail.com>
> ---
> 
> Notes:
>     Found while looking at YOCTO #16492. Applies with or without Mathieu's
>     patch for that bug.
> 
>  lib/bb/cooker.py       |  5 +++--
>  lib/bb/tests/cooker.py | 18 ++++++++++++++++++
>  2 files changed, 21 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
> index 8a422e506..f79cd5e6c 100644
> --- a/lib/bb/cooker.py
> +++ b/lib/bb/cooker.py
> @@ -457,8 +457,9 @@ You can also remove the BB_HASHSERVE_UPSTREAM setting, but this may result in si
>          if not self.eventlog or self.eventlog[0] != eventlog:
>              # we log all events to a file if so directed
>              # register the log file writer as UI Handler
> -            if not os.path.exists(os.path.dirname(eventlog)):
> -                bb.utils.mkdirhier(os.path.dirname(eventlog))
> +            dirname = os.path.dirname(eventlog)
> +            if dirname and not os.path.exists(dirname):
> +                bb.utils.mkdirhier(dirname)
>              writer = EventWriter(self, eventlog)
>              EventLogWriteHandler = namedtuple('EventLogWriteHandler', ['event'])
>              self.eventlog = (eventlog, bb.event.register_UIHhandler(EventLogWriteHandler(writer)), writer)

Thanks for the patch. When reviewing this I realised that the current
working directory in the server code might not be the same as the
commandline.

Would you be able to tweak the code in main.py where it sets 
"options.writeeventlog = eventlog" to resolve the path there to a full
path?

It can also be set via BB_DEFAULT_EVENTLOG and I think we should just
show an error if that path isn't absolute?

I think that would resolve my concerns.

Thanks,

Richard


  reply	other threads:[~2026-11-17 12:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-14 18:55 [PATCH] cooker: fix -w with a file name that has no directory Babanpreet Singh
2026-11-17 12:32 ` Richard Purdie [this message]
2026-11-18 21:54   ` [PATCH v2] cooker: make the event log path absolute Babanpreet Singh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a41c1517f39b3f6ea520094767ee2b98ab010b7a.camel@linuxfoundation.org \
    --to=richard.purdie@linuxfoundation.org \
    --cc=bbnpreetsingh@gmail.com \
    --cc=bitbake-devel@lists.openembedded.org \
    --cc=mathieu.dubois-briand@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.