public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
* [scarthgap][PATCH 1/4] buildhistory: Fix intermittent package file list creation
@ 2024-09-02 10:31 Pedro Ferreira
  2024-09-02 10:31 ` [scarthgap][PATCH 2/4] buildhistory: Restoring files from preserve list Pedro Ferreira
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Pedro Ferreira @ 2024-09-02 10:31 UTC (permalink / raw)
  To: openembedded-core; +Cc: Pedro Ferreira, Pedro Silva Ferreira, Richard Purdie

The directory that buildhistory_list_pkg_files writes to during do_package
is created by do_packagedata so a clean buildhistory doesn't have
files-in-package written during the first build since packagedata happens
after do_package.

Ensure the output package folder is created to avoid missing
files-in-package.txt files.

Also it ensures that in case of `find` fails we leave with
a hard error instead of hiding the error on the for loop.

Signed-off-by: Pedro Silva Ferreira <Pedro.Silva.Ferreira@criticaltechworks.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/classes/buildhistory.bbclass | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index fd53e92402..d219519f86 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -599,15 +599,12 @@ buildhistory_list_files_no_owners() {

 buildhistory_list_pkg_files() {
        # Create individual files-in-package for each recipe's package
-       for pkgdir in $(find ${PKGDEST}/* -maxdepth 0 -type d); do
+       pkgdirlist=$(find ${PKGDEST}/* -maxdepth 0 -type d)
+       for pkgdir in $pkgdirlist; do
                pkgname=$(basename $pkgdir)
                outfolder="${BUILDHISTORY_DIR_PACKAGE}/$pkgname"
                outfile="$outfolder/files-in-package.txt"
-               # Make sure the output folder exists so we can create the file
-               if [ ! -d $outfolder ] ; then
-                       bbdebug 2 "Folder $outfolder does not exist, file $outfile not created"
-                       continue
-               fi
+               mkdir -p $outfolder
                buildhistory_list_files $pkgdir $outfile fakeroot
        done
 }
--
2.34.1

The information in this communication may contain confidential or legally privileged information. It is intended solely for the use of the individual or entity it addresses and others authorized to receive it. If you are not an intended recipient, you are hereby notified that any disclosure, copying, distribution or action in reliance on the contents of this information is strictly prohibited and may be unlawful. If you have received this communication by error, please notify us immediately by responding to this e-mail and then delete it from your system. Critical TechWorks is not liable for the proper and complete transmission of the information in this communication nor for any delay in its receipt

This e-mail is environmentally friendly, just like Critical TechWorks, which lives in a paper-free atmosphere. Therefore, please consider the environment before printing it!


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [scarthgap][PATCH 2/4] buildhistory: Restoring files from preserve list
  2024-09-02 10:31 [scarthgap][PATCH 1/4] buildhistory: Fix intermittent package file list creation Pedro Ferreira
@ 2024-09-02 10:31 ` Pedro Ferreira
  2024-09-02 10:31 ` [scarthgap][PATCH 3/4] buildhistory: Simplify intercept call sites and drop SSTATEPOSTINSTFUNC usage Pedro Ferreira
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Pedro Ferreira @ 2024-09-02 10:31 UTC (permalink / raw)
  To: openembedded-core; +Cc: Pedro Ferreira, Pedro Ferreira, Richard Purdie

This fix will ensure that, when we activate feature
`BUILDHISTORY_RESET`, files marked to keep on feature
`BUILDHISTORY_PRESERVE` will indeed exist is buildhistory
final path since they are moved to buildhistory/old but
not restored at any point.

Signed-off-by: Pedro Ferreira <Pedro.Silva.Ferreira@criticaltechworks.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/classes/buildhistory.bbclass | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index d219519f86..08970aafea 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -110,6 +110,7 @@ python buildhistory_emit_pkghistory() {
     import json
     import shlex
     import errno
+    import shutil

     pkghistdir = d.getVar('BUILDHISTORY_DIR_PACKAGE')
     oldpkghistdir = d.getVar('BUILDHISTORY_OLD_DIR_PACKAGE')
@@ -223,6 +224,20 @@ python buildhistory_emit_pkghistory() {
         items.sort()
         return ' '.join(items)

+    def preservebuildhistoryfiles(pkg, preserve):
+        if os.path.exists(os.path.join(oldpkghistdir, pkg)):
+            listofobjs = os.listdir(os.path.join(oldpkghistdir, pkg))
+            for obj in listofobjs:
+                if obj not in preserve:
+                    continue
+                try:
+                    bb.utils.mkdirhier(os.path.join(pkghistdir, pkg))
+                    shutil.copyfile(os.path.join(oldpkghistdir, pkg, obj), os.path.join(pkghistdir, pkg, obj))
+                except IOError as e:
+                    bb.note("Unable to copy file. %s" % e)
+                except EnvironmentError as e:
+                    bb.note("Unable to copy file. %s" % e)
+
     pn = d.getVar('PN')
     pe = d.getVar('PE') or "0"
     pv = d.getVar('PV')
@@ -250,6 +265,14 @@ python buildhistory_emit_pkghistory() {
     if not os.path.exists(pkghistdir):
         bb.utils.mkdirhier(pkghistdir)
     else:
+        # We need to make sure that all files kept in
+        # buildhistory/old are restored successfully
+        # otherwise next block of code wont have files to
+        # check and purge
+        if d.getVar("BUILDHISTORY_RESET"):
+            for pkg in packagelist:
+                preservebuildhistoryfiles(pkg, preserve)
+
         # Remove files for packages that no longer exist
         for item in os.listdir(pkghistdir):
             if item not in preserve:
--
2.34.1

The information in this communication may contain confidential or legally privileged information. It is intended solely for the use of the individual or entity it addresses and others authorized to receive it. If you are not an intended recipient, you are hereby notified that any disclosure, copying, distribution or action in reliance on the contents of this information is strictly prohibited and may be unlawful. If you have received this communication by error, please notify us immediately by responding to this e-mail and then delete it from your system. Critical TechWorks is not liable for the proper and complete transmission of the information in this communication nor for any delay in its receipt

This e-mail is environmentally friendly, just like Critical TechWorks, which lives in a paper-free atmosphere. Therefore, please consider the environment before printing it!


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [scarthgap][PATCH 3/4] buildhistory: Simplify intercept call sites and drop SSTATEPOSTINSTFUNC usage
  2024-09-02 10:31 [scarthgap][PATCH 1/4] buildhistory: Fix intermittent package file list creation Pedro Ferreira
  2024-09-02 10:31 ` [scarthgap][PATCH 2/4] buildhistory: Restoring files from preserve list Pedro Ferreira
@ 2024-09-02 10:31 ` Pedro Ferreira
  2024-09-02 10:31 ` [scarthgap][PATCH 4/4] sstate: Drop SSTATEPOSTINSTFUNC support Pedro Ferreira
  2024-09-03 13:19 ` [OE-core] [scarthgap][PATCH 1/4] buildhistory: Fix intermittent package file list creation Steve Sakoman
  3 siblings, 0 replies; 6+ messages in thread
From: Pedro Ferreira @ 2024-09-02 10:31 UTC (permalink / raw)
  To: openembedded-core; +Cc: Richard Purdie

From: Richard Purdie <richard.purdie@linuxfoundation.org>

We planned to drop SSTATEPOSTINSTFUNC some time ago with the introduction of
postfuncs. Finally get around to doing that which should make the buildhistory
code a little more readable.

Unfortunately ordering the buildhistory function calls after the sstate ones is
difficult without coding that into the sstate class. This patch does that to
ensure everything functions as expected until we can find a better way. This is
still likely preferable than the generic sstate postfuncs support since the function
flow is much more readable.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/classes-global/sstate.bbclass |  5 +++-
 meta/classes/buildhistory.bbclass  | 39 +++++++++++++++---------------
 2 files changed, 23 insertions(+), 21 deletions(-)

diff --git a/meta/classes-global/sstate.bbclass b/meta/classes-global/sstate.bbclass
index 76a7b59636..93df5fa9e6 100644
--- a/meta/classes-global/sstate.bbclass
+++ b/meta/classes-global/sstate.bbclass
@@ -161,7 +161,10 @@ python () {
     d.setVar('SSTATETASKS', " ".join(unique_tasks))
     for task in unique_tasks:
         d.prependVarFlag(task, 'prefuncs', "sstate_task_prefunc ")
-        d.appendVarFlag(task, 'postfuncs', " sstate_task_postfunc")
+        # Generally sstate should be last, execpt for buildhistory functions
+        postfuncs = (d.getVarFlag(task, 'postfuncs') or "").split()
+        newpostfuncs = [p for p in postfuncs if "buildhistory" not in p] + ["sstate_task_postfunc"] + [p for p in postfuncs if "buildhistory" in p]
+        d.setVarFlag(task, 'postfuncs', " ".join(newpostfuncs))
         d.setVarFlag(task, 'network', '1')
         d.setVarFlag(task + "_setscene", 'network', '1')
 }
diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index 08970aafea..0b1bd518fe 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -47,11 +47,18 @@ BUILDHISTORY_PUSH_REPO ?= ""
 BUILDHISTORY_TAG ?= "build"
 BUILDHISTORY_PATH_PREFIX_STRIP ?= ""

-SSTATEPOSTINSTFUNCS:append = " buildhistory_emit_pkghistory"
-# We want to avoid influencing the signatures of sstate tasks - first the function itself:
-sstate_install[vardepsexclude] += "buildhistory_emit_pkghistory"
-# then the value added to SSTATEPOSTINSTFUNCS:
-SSTATEPOSTINSTFUNCS[vardepvalueexclude] .= "| buildhistory_emit_pkghistory"
+# We want to avoid influencing the signatures of the task so use vardepsexclude
+do_populate_sysroot[postfuncs] += "buildhistory_emit_sysroot"
+do_populate_sysroot_setscene[postfuncs] += "buildhistory_emit_sysroot"
+do_populate_sysroot[vardepsexclude] += "buildhistory_emit_sysroot"
+
+do_package[postfuncs] += "buildhistory_list_pkg_files"
+do_package_setscene[postfuncs] += "buildhistory_list_pkg_files"
+do_package[vardepsexclude] += "buildhistory_list_pkg_files"
+
+do_packagedata[postfuncs] += "buildhistory_emit_pkghistory"
+do_packagedata_setscene[postfuncs] += "buildhistory_emit_pkghistory"
+do_packagedata[vardepsexclude] += "buildhistory_emit_pkghistory"

 # Similarly for our function that gets the output signatures
 SSTATEPOSTUNPACKFUNCS:append = " buildhistory_emit_outputsigs"
@@ -91,27 +98,15 @@ buildhistory_emit_sysroot() {
 # Write out metadata about this package for comparison when writing future packages
 #
 python buildhistory_emit_pkghistory() {
-    if d.getVar('BB_CURRENTTASK') in ['populate_sysroot', 'populate_sysroot_setscene']:
-        bb.build.exec_func("buildhistory_emit_sysroot", d)
-        return 0
-
-    if not "package" in (d.getVar('BUILDHISTORY_FEATURES') or "").split():
-        return 0
-
-    if d.getVar('BB_CURRENTTASK') in ['package', 'package_setscene']:
-        # Create files-in-<package-name>.txt files containing a list of files of each recipe's package
-        bb.build.exec_func("buildhistory_list_pkg_files", d)
-        return 0
-
-    if not d.getVar('BB_CURRENTTASK') in ['packagedata', 'packagedata_setscene']:
-        return 0
-
     import re
     import json
     import shlex
     import errno
     import shutil

+    if not "package" in (d.getVar('BUILDHISTORY_FEATURES') or "").split():
+        return 0
+
     pkghistdir = d.getVar('BUILDHISTORY_DIR_PACKAGE')
     oldpkghistdir = d.getVar('BUILDHISTORY_OLD_DIR_PACKAGE')

@@ -621,6 +616,10 @@ buildhistory_list_files_no_owners() {
 }

 buildhistory_list_pkg_files() {
+       if [ "${@bb.utils.contains('BUILDHISTORY_FEATURES', 'package', '1', '0', d)}" = "0" ] ; then
+               return
+       fi
+
        # Create individual files-in-package for each recipe's package
        pkgdirlist=$(find ${PKGDEST}/* -maxdepth 0 -type d)
        for pkgdir in $pkgdirlist; do
--
2.34.1

The information in this communication may contain confidential or legally privileged information. It is intended solely for the use of the individual or entity it addresses and others authorized to receive it. If you are not an intended recipient, you are hereby notified that any disclosure, copying, distribution or action in reliance on the contents of this information is strictly prohibited and may be unlawful. If you have received this communication by error, please notify us immediately by responding to this e-mail and then delete it from your system. Critical TechWorks is not liable for the proper and complete transmission of the information in this communication nor for any delay in its receipt

This e-mail is environmentally friendly, just like Critical TechWorks, which lives in a paper-free atmosphere. Therefore, please consider the environment before printing it!


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [scarthgap][PATCH 4/4] sstate: Drop SSTATEPOSTINSTFUNC support
  2024-09-02 10:31 [scarthgap][PATCH 1/4] buildhistory: Fix intermittent package file list creation Pedro Ferreira
  2024-09-02 10:31 ` [scarthgap][PATCH 2/4] buildhistory: Restoring files from preserve list Pedro Ferreira
  2024-09-02 10:31 ` [scarthgap][PATCH 3/4] buildhistory: Simplify intercept call sites and drop SSTATEPOSTINSTFUNC usage Pedro Ferreira
@ 2024-09-02 10:31 ` Pedro Ferreira
  2024-09-02 12:01   ` Richard Purdie
  2024-09-03 13:19 ` [OE-core] [scarthgap][PATCH 1/4] buildhistory: Fix intermittent package file list creation Steve Sakoman
  3 siblings, 1 reply; 6+ messages in thread
From: Pedro Ferreira @ 2024-09-02 10:31 UTC (permalink / raw)
  To: openembedded-core; +Cc: Richard Purdie

From: Richard Purdie <richard.purdie@linuxfoundation.org>

This was deprecated with the introduction of postfunc support for tasks
in general and only used by buildhistory. Now that usage has been removed,
drop the code from sstate.bbclass. Any other users should be able to use
postfuncs too.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 meta/classes-global/sstate.bbclass | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/meta/classes-global/sstate.bbclass b/meta/classes-global/sstate.bbclass
index 93df5fa9e6..42b7e03513 100644
--- a/meta/classes-global/sstate.bbclass
+++ b/meta/classes-global/sstate.bbclass
@@ -103,7 +103,6 @@ SSTATECREATEFUNCS[vardeps] = "SSTATE_SCAN_FILES"
 SSTATEPOSTCREATEFUNCS = ""
 SSTATEPREINSTFUNCS = ""
 SSTATEPOSTUNPACKFUNCS = "sstate_hardcode_path_unpack"
-SSTATEPOSTINSTFUNCS = ""
 EXTRA_STAGING_FIXMES ?= "HOSTTOOLS_DIR"

 # Check whether sstate exists for tasks that support sstate and are in the
@@ -332,15 +331,10 @@ def sstate_install(ss, d):
         if os.path.exists(state[1]):
             oe.path.copyhardlinktree(state[1], state[2])

-    for postinst in (d.getVar('SSTATEPOSTINSTFUNCS') or '').split():
-        # All hooks should run in the SSTATE_INSTDIR
-        bb.build.exec_func(postinst, d, (sstateinst,))
-
     for lock in locks:
         bb.utils.unlockfile(lock)

 sstate_install[vardepsexclude] += "SSTATE_ALLOW_OVERLAP_FILES SSTATE_MANMACH SSTATE_MANFILEPREFIX"
-sstate_install[vardeps] += "${SSTATEPOSTINSTFUNCS}"

 def sstate_installpkg(ss, d):
     from oe.gpg_sign import get_signer
--
2.34.1

The information in this communication may contain confidential or legally privileged information. It is intended solely for the use of the individual or entity it addresses and others authorized to receive it. If you are not an intended recipient, you are hereby notified that any disclosure, copying, distribution or action in reliance on the contents of this information is strictly prohibited and may be unlawful. If you have received this communication by error, please notify us immediately by responding to this e-mail and then delete it from your system. Critical TechWorks is not liable for the proper and complete transmission of the information in this communication nor for any delay in its receipt

This e-mail is environmentally friendly, just like Critical TechWorks, which lives in a paper-free atmosphere. Therefore, please consider the environment before printing it!


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [scarthgap][PATCH 4/4] sstate: Drop SSTATEPOSTINSTFUNC support
  2024-09-02 10:31 ` [scarthgap][PATCH 4/4] sstate: Drop SSTATEPOSTINSTFUNC support Pedro Ferreira
@ 2024-09-02 12:01   ` Richard Purdie
  0 siblings, 0 replies; 6+ messages in thread
From: Richard Purdie @ 2024-09-02 12:01 UTC (permalink / raw)
  To: Pedro Ferreira, openembedded-core

On Mon, 2024-09-02 at 11:31 +0100, Pedro Ferreira wrote:
> From: Richard Purdie <richard.purdie@linuxfoundation.org>
> 
> This was deprecated with the introduction of postfunc support for
> tasks
> in general and only used by buildhistory. Now that usage has been
> removed,
> drop the code from sstate.bbclass. Any other users should be able to
> use
> postfuncs too.
> 
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> ---
>  meta/classes-global/sstate.bbclass | 6 ------
>  1 file changed, 6 deletions(-)

I suspect this patch can be dropped from the series as we wouldn't
remove this on a stable branch.

I'd also highlight that this has not merged to master yet.

Cheers,

Richard


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [OE-core] [scarthgap][PATCH 1/4] buildhistory: Fix intermittent package file list creation
  2024-09-02 10:31 [scarthgap][PATCH 1/4] buildhistory: Fix intermittent package file list creation Pedro Ferreira
                   ` (2 preceding siblings ...)
  2024-09-02 10:31 ` [scarthgap][PATCH 4/4] sstate: Drop SSTATEPOSTINSTFUNC support Pedro Ferreira
@ 2024-09-03 13:19 ` Steve Sakoman
  3 siblings, 0 replies; 6+ messages in thread
From: Steve Sakoman @ 2024-09-03 13:19 UTC (permalink / raw)
  To: pedro.silva.ferreira; +Cc: openembedded-core, Richard Purdie

This patch doesn't apply:

Applying: buildhistory: Fix intermittent package file list creation
Using index info to reconstruct a base tree...
error: patch failed: meta/classes/buildhistory.bbclass:599
error: meta/classes/buildhistory.bbclass: patch does not apply
error: Did you hand edit your patch?
It does not apply to blobs recorded in its index.
Patch failed at 0001 buildhistory: Fix intermittent package file list creation

Steve

On Mon, Sep 2, 2024 at 3:32 AM Pedro Ferreira via
lists.openembedded.org
<pedro.silva.ferreira=criticaltechworks.com@lists.openembedded.org>
wrote:
>
> The directory that buildhistory_list_pkg_files writes to during do_package
> is created by do_packagedata so a clean buildhistory doesn't have
> files-in-package written during the first build since packagedata happens
> after do_package.
>
> Ensure the output package folder is created to avoid missing
> files-in-package.txt files.
>
> Also it ensures that in case of `find` fails we leave with
> a hard error instead of hiding the error on the for loop.
>
> Signed-off-by: Pedro Silva Ferreira <Pedro.Silva.Ferreira@criticaltechworks.com>
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> ---
>  meta/classes/buildhistory.bbclass | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
>
> diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
> index fd53e92402..d219519f86 100644
> --- a/meta/classes/buildhistory.bbclass
> +++ b/meta/classes/buildhistory.bbclass
> @@ -599,15 +599,12 @@ buildhistory_list_files_no_owners() {
>
>  buildhistory_list_pkg_files() {
>         # Create individual files-in-package for each recipe's package
> -       for pkgdir in $(find ${PKGDEST}/* -maxdepth 0 -type d); do
> +       pkgdirlist=$(find ${PKGDEST}/* -maxdepth 0 -type d)
> +       for pkgdir in $pkgdirlist; do
>                 pkgname=$(basename $pkgdir)
>                 outfolder="${BUILDHISTORY_DIR_PACKAGE}/$pkgname"
>                 outfile="$outfolder/files-in-package.txt"
> -               # Make sure the output folder exists so we can create the file
> -               if [ ! -d $outfolder ] ; then
> -                       bbdebug 2 "Folder $outfolder does not exist, file $outfile not created"
> -                       continue
> -               fi
> +               mkdir -p $outfolder
>                 buildhistory_list_files $pkgdir $outfile fakeroot
>         done
>  }
> --
> 2.34.1
>
> The information in this communication may contain confidential or legally privileged information. It is intended solely for the use of the individual or entity it addresses and others authorized to receive it. If you are not an intended recipient, you are hereby notified that any disclosure, copying, distribution or action in reliance on the contents of this information is strictly prohibited and may be unlawful. If you have received this communication by error, please notify us immediately by responding to this e-mail and then delete it from your system. Critical TechWorks is not liable for the proper and complete transmission of the information in this communication nor for any delay in its receipt
>
> This e-mail is environmentally friendly, just like Critical TechWorks, which lives in a paper-free atmosphere. Therefore, please consider the environment before printing it!
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#204080): https://lists.openembedded.org/g/openembedded-core/message/204080
> Mute This Topic: https://lists.openembedded.org/mt/108224347/3620601
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [steve@sakoman.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-09-03 13:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-02 10:31 [scarthgap][PATCH 1/4] buildhistory: Fix intermittent package file list creation Pedro Ferreira
2024-09-02 10:31 ` [scarthgap][PATCH 2/4] buildhistory: Restoring files from preserve list Pedro Ferreira
2024-09-02 10:31 ` [scarthgap][PATCH 3/4] buildhistory: Simplify intercept call sites and drop SSTATEPOSTINSTFUNC usage Pedro Ferreira
2024-09-02 10:31 ` [scarthgap][PATCH 4/4] sstate: Drop SSTATEPOSTINSTFUNC support Pedro Ferreira
2024-09-02 12:01   ` Richard Purdie
2024-09-03 13:19 ` [OE-core] [scarthgap][PATCH 1/4] buildhistory: Fix intermittent package file list creation Steve Sakoman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox