Bug 9992

Summary: If we run oe-init-build-env with an argument for builddir, toaster start fails
Product: [Build System, Metadata & Runtime] Toaster Reporter: brian avery <brian.avery>
Component: toasterAssignee: brian avery <brian.avery>
Status: RESOLVED FIXED QA Contact: Libertad <libertad.gonzalez.de.la.cruz>
Severity: normal    
Priority: Medium CC: belen.barros.pena, jessica.zhang, joshuagloe, michael.g.wood, stanciux.mihail
Version: 2.2   
Target Milestone: 2.3 M3   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)
Bug Depends on:    
Bug Blocks: 11109    

Description brian avery 2016-07-21 16:23:29 UTC
To replicate:
mkdir ~/cow;
cd ~/cow;
. ~/poky/oe-init-build-env .;
. toaster start;
# . toaster start will fail:
sqlite3.OperationalError: unable to open database file                                                              │·································
++++++++++++
a proposal:
Currently, we reach "above" the build dir and put toaster directory's e.g. build_toaster_xx and _toaster_clones_ there.  Unfortunately, we can't even guarantee that the running user has permissions to access the directory above the builddir. For example, if I do cd ~;. ~/poky/oe-init-build-env .; I don't have permission for /home.
So, I'd be ok with a standard start being 
build/
build/conf
build/toaster_build_XX
build/_toaster_clones_
That way cd ~;. ~/poky/oe-init-build-env .;. toaster start; would work.
Comment 1 Michael Wood 2016-08-03 15:22:10 UTC
hint this currently set in: toastermain/settings.py 
 
  TOASTER_SQLITE_DEFAULT_DIR = os.path.join(os.environ.get('TOASTER_DIR', ''),
                                            'build')
  
  DATABASES = {
      'default': {
          # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
          'ENGINE': 'django.db.backends.sqlite3',
          # DB name or full path to database file if using sqlite3.
          'NAME': "%s/toaster.sqlite" % TOASTER_SQLITE_DEFAULT_DIR,
          'USER': '',


(We should really ecourage people to write their own config files such as we have for the test db  toastermain/settings_test.py)
Comment 2 brian avery 2016-11-02 15:02:13 UTC
*** Bug 10524 has been marked as a duplicate of this bug. ***
Comment 3 brian avery 2017-02-01 19:10:28 UTC
sent to toaster ml:
https://patchwork.openembedded.org/series/5104/
Comment 4 brian avery 2017-03-15 15:02:20 UTC
f43d97af9466580c3a10d766791836b42c674497