why is "bitbake-setup list" trying to *create* bitbake-builds directory?
i'm confused about why "bitbake-setup list" is not just attempting
to "list" stuff, but is actively creating a "bitbake-builds" directory in my current location.
if i have no bitbake-builds in my home directory and i'm *in* that
directory, then:
$ bitbake-setup list
Bitbake-setup is using /home/rpjday/bitbake-builds as top directory
("bitbake-setup settings --help" shows how to change it).Available configurations:
poky-master Poky - The Yocto Project testing distribution
configurations and hardware test platforms
oe-nodistro OpenEmbedded - 'nodistro' basic configuration
Run 'init' with one of the above configuration identifiers to set up a build.
$
and suddenly i have a bitbake-builds directory -- that is not at all
intuitive since all i asked for was a "list", i did not ask for anything to be initialized or created.
this causes unexpected behaviour if you happen to be in a
non-writable directory, say /etc, and run the same command, which then blows up since it can't create that directory:
$ bitbake-setup list
Bitbake-setup is using /etc/bitbake-builds as top directory
("bitbake-setup settings --help" shows how to change it).Traceback (most recent call last):
File "/home/rpjday/oe/layers/bitbake/bin/bitbake-setup", line 963,
in <module>
main()
~~~~^^ File "/home/rpjday/oe/layers/bitbake/bin/bitbake-setup", line 955,
in main
d = init_bb_cache(top_dir, all_settings, args)
File "/home/rpjday/oe/layers/bitbake/bin/bitbake-setup", line 52, ininit_bb_cache
bb.fetch.fetcher_init(d)
~~~~~~~~~~~~~~~~~~~~~^^^
File "/home/rpjday/oe/layers/bitbake/lib/bb/fetch2/__init__.py",
line 516, in fetcher_init
_checksum_cache.init_cache(d.getVar("BB_CACHEDIR"))
~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/rpjday/oe/layers/bitbake/lib/bb/cache.py", line 824, in
init_cache
bb.utils.mkdirhier(cachedir)
~~~~~~~~~~~~~~~~~~^^^^^^^^^^ File "/home/rpjday/oe/layers/bitbake/lib/bb/utils.py", line 943, in
mkdirhier
raise e
File "/home/rpjday/oe/layers/bitbake/lib/bb/utils.py", line 940, in
mkdirhier
os.makedirs(directory)
~~~~~~~~~~~^^^^^^^^^^^ File "<frozen os>", line 218, in makedirs
File "<frozen os>", line 218, in makedirs
File "<frozen os>", line 228, in makedirs
PermissionError: [Errno 13] Permission denied: '/etc/bitbake-builds'
that is not intuitive behaviour.
rday
Quoted 6 lines · Robert P. J. Day via lists.openembedded.org
i'm confused about why "bitbake-setup list" is not just attempting
to "list" stuff, but is actively creating a "bitbake-builds" directory in my current location.
Quoted 6 lines
if i have no bitbake-builds in my home directory and i'm *in* that
directory, then:$ bitbake-setup list Bitbake-setup is using /home/rpjday/bitbake-builds as top directory ("bitbake-setup settings --help" shows how to change it).
Does this still happen on the latest master? I think it might have been fixed by: 0ae46d39c ("bitbake-setup: create top-dir later in init")
Quoted 69 lines
Available configurations:
poky-master Poky - The Yocto Project testing distribution
configurations and hardware test platforms
oe-nodistro OpenEmbedded - 'nodistro' basic configurationRun 'init' with one of the above configuration identifiers to set up a build.
$and suddenly i have a bitbake-builds directory -- that is not at all
intuitive since all i asked for was a "list", i did not ask for anything to be initialized or created.this causes unexpected behaviour if you happen to be in a
non-writable directory, say /etc, and run the same command, which then blows up since it can't create that directory:$ bitbake-setup list Bitbake-setup is using /etc/bitbake-builds as top directory ("bitbake-setup settings --help" shows how to change it).Traceback (most recent call last):
File "/home/rpjday/oe/layers/bitbake/bin/bitbake-setup", line 963,
in <module>main() ~~~~^^File "
/home/rpjday/oe/layers/bitbake/bin/bitbake-setup", line 955,
in main
d =init_bb_cache(top_dir, all_settings, args)
File "/home/rpjday/oe/layers/bitbake/bin/bitbake-setup", line 52, ininit_bb_cachebb.fetch.fetcher_init(d) ~~~~~~~~~~~~~~~~~~~~~^^^ File "/home/rpjday/oe/layers/bitbake/lib/bb/fetch2/__init__.py", line 516, in fetcher_init _checksum_cache.init_cache(d.getVar("BB_CACHEDIR")) ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/rpjday/oe/layers/bitbake/lib/bb/cache.py", line 824, in init_cache bb.utils.mkdirhier(cachedir) ~~~~~~~~~~~~~~~~~~^^^^^^^^^^File "
/home/rpjday/oe/layers/bitbake/lib/bb/utils.py", line 943, in
mkdirhier
raise e
File "/home/rpjday/oe/layers/bitbake/lib/bb/utils.py", line 940, in
mkdirhieros.makedirs(directory) ~~~~~~~~~~~^^^^^^^^^^^File "<frozen os>", line 218, in makedirs
File "<frozen os>", line 218, in makedirs
File "<frozen os>", line 228, in makedirs
PermissionError: [Errno 13] Permission denied: '/etc/bitbake-builds'that is not intuitive behaviour.
rday
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#18458): https://lists.openembedded.org/g/bitbake-devel/message/18458
Mute This Topic: https://lists.openembedded.org/mt/116374639/3616693
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/bitbake-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Quoted 12 lines · Joshua Watt
Quoted 9 lines · Robert P. J. Day via lists.openembedded.org
i'm confused about why "bitbake-setup list" is not just attempting
to "list" stuff, but is actively creating a "bitbake-builds" directory in my current location.if i have no bitbake-builds in my home directory and i'm *in* that
directory, then:
Quoted 7 lines
Quoted 3 lines
$ bitbake-setup list Bitbake-setup is using /home/rpjday/bitbake-builds as top directory ("bitbake-setup settings --help" shows how to change it).Does this still happen on the latest master? I think it might have been fixed by:
0ae46d39c("bitbake-setup: create top-dir later in init")
i just pulled bitbake master and it is still behaving this way -- i
will make absolutely sure i'm up to date. can you not reproduce this?
rday
Quoted 7 lines · Joshua Watt via lists.openembedded.org
Quoted 7 lines
i'm confused about why "bitbake-setup list" is not just attempting
to "list" stuff, but is actively creating a "bitbake-builds" directory in my current location.if i have no bitbake-builds in my home directory and i'm *in* that
directory, then:
Quoted 7 lines
Quoted 3 lines
$ bitbake-setup list Bitbake-setup is using /home/rpjday/bitbake-builds as top directory ("bitbake-setup settings --help" shows how to change it).Does this still happen on the latest master? I think it might have been fixed by:
0ae46d39c("bitbake-setup: create top-dir later in init")
It does yes. The issue is that bitbake-setup needs to set up a bitbake datastore (at least), and potentially fetch and unpack the registry repository, so it can walk its file tree looking for configs. The code to do this is shared with things like init/status/update, and so uses the same top dir as those other commands do. And of course there was pressure to change the default top dir to . (instead of ~) which is how attempting to list from places like /etc no longer works.
I guess it can be changed to use a throwaway tempdir as topdir rather, or go through the same "print top dir info/confirm top dir" sequence as init does.
Alex
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 11 lines · Alexander Kanavin via lists.openembedded.org
It does yes. The issue is that bitbake-setup needs to set up a bitbake datastore (at least), and potentially fetch and unpack the registry repository, so it can walk its file tree looking for configs. The code to do this is shared with things like
init/status/update, and so uses the same top dir as those other commands do. And of course there was pressure to change the default top dir to . (instead of ~) which is how attempting to list from places like /etc no longer works.I guess it can be changed to use a throwaway tempdir as topdir rather, or go through the same "print top dir info/confirm top dir" sequence as init does.
I just sent a patch for this.
Alex