Bug 16059 - bitbake-setup "--non-interactive" ignores "top-dir-prefix"
Summary: bitbake-setup "--non-interactive" ignores "top-dir-prefix"
Status: RESOLVED FIXED
Alias: None
Product: BitBake
Classification: Build System, Metadata & Runtime
Component: bitbake (show other bugs)
Version: 5.3
Hardware: x86 Multiple
: Medium+ normal
Target Milestone: 5.3 M4
Assignee: David Reyna
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2025-11-11 16:29 UTC by David Reyna
Modified: 2025-11-14 05:09 UTC (History)
4 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Reyna 2025-11-11 16:29:34 UTC
I want to use "--non-interactive" but absolutely not have it install "bitbake-builds" into my home directory.

I thought that the obvious solution was to use bitbake-setup to set "top-dir-prefix" to my desired directory, but "--non-interactive" ignored that setting.

REPRODUCER:
  $ git clone https://git.openembedded.org/bitbake/
  $ ./bitbake/bin/bitbake-setup settings set default top-dir-prefix $PWD
  $ ./bitbake/bin/bitbake-setup init --non-interactive ...

BUT THE SETUP STILL INSTALLED INTO MY HOME DIR.
Comment 1 Joshua Watt 2025-11-13 15:34:30 UTC
David,

I ran into the same problem. The issue is that top-dir-prefix only makes sense to be set globally, so your "bitbake-setup settings set default top-dir-prefix $PWD" doesn't do anything.

This was fixed just recently in 0c92c9ca4 ("bitbake-setup: Only set top-dir-prefix and top-dir-name in global settings"), please make sure you have that commit, then run your "bitbake-setup settings" command again and let us know if you still have a problem.
Comment 2 Randy MacLeod 2025-11-13 15:40:13 UTC
Fixed, right David ?
Comment 3 David Reyna 2025-11-14 05:08:10 UTC
I have these observations.

1) The new behavior is that "top-dir-prefix" for bitbake-setup will show the CWD.

  $ ./bitbake/bin/bitbake-setup settings list
  default top-dir-prefix /opt/dreyna/yp_5_3_no_interactive
  ...
  $ cd bitbake
  $ ./bin/bitbake-setup settings list
  default top-dir-prefix /opt/dreyna/yp_5_3_no_interactive/bitbake
  ...

This matches my expectation for "least surprise".

2) If I explicitly set a new default value, that value sticks

  $ ./bitbake/bin/bitbake-setup settings set default top-dir-prefix $PWD/my_install
  $ ./bitbake/bin/bitbake-setup settings list
  default top-dir-prefix /opt/dreyna/yp_5_3_no_interactive/my_install
  ...
  $ cd bitbake
  $ ./bin/bitbake-setup settings list
  default top-dir-prefix /opt/dreyna/yp_5_3_no_interactive/my_install
  ...

This matches my expectation for "least surprise".

3) If I now run "bitbake-setup init --non-interactive", it installs where it is supposed to

  $ ./bitbake/bin/bitbake-setup init --non-interactive poky-master poky distro/poky machine/qemux86-64
  $ ls /opt/dreyna/yp_5_3_no_interactive/my_install/bitbake-builds/poky-master-poky-distro_poky-machine_qemux86-64/
  build  config  layers
  $

This passes my tests. I recommend that this case be moved to "Resolved".
Comment 4 David Reyna 2025-11-14 05:09:47 UTC
It passed my tests. I am happy :-)