Skip to content

Instantly share code, notes, and snippets.

@kergoth
Last active March 23, 2017 16:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kergoth/5744c784efb16d73ceaa332ac4276f49 to your computer and use it in GitHub Desktop.
Save kergoth/5744c784efb16d73ceaa332ac4276f49 to your computer and use it in GitHub Desktop.
Add a bitbake argument to disable variable history tracking for `bitbake -e`, as history tracking massively increases memory usage
diff --git i/lib/bb/cookerdata.py w/lib/bb/cookerdata.py
index 722d860..d48ef14 100644
--- i/lib/bb/cookerdata.py
+++ w/lib/bb/cookerdata.py
@@ -42,7 +42,9 @@ class ConfigParameters(object):
self.options.pkgs_to_build = targets or []
self.options.tracking = False
- if hasattr(self.options, "show_environment") and self.options.show_environment:
+ if (hasattr(self.options, "show_environment") and
+ self.options.show_environment and
+ not self.options.no_variable_tracking):
self.options.tracking = True
for key, val in self.options.__dict__.items():
diff --git i/lib/bb/data_smart.py w/lib/bb/data_smart.py
index d6dd698..4f39de5 100644
--- i/lib/bb/data_smart.py
+++ w/lib/bb/data_smart.py
@@ -317,8 +317,8 @@ class VariableHistory(object):
o.write("# pre-expansion value:\n")
o.write('# "%s"\n' % (commentVal))
else:
- o.write("#\n# $%s\n# [no history recorded]\n#\n" % var)
- o.write('# "%s"\n' % (commentVal))
+ if oval != val:
+ o.write('# %s=%s\n' % (var, commentVal))
def get_variable_files(self, var):
"""Get the files where operations are made on a variable"""
diff --git i/lib/bb/main.py w/lib/bb/main.py
index b3cd2cf..c9fa505 100755
--- i/lib/bb/main.py
+++ w/lib/bb/main.py
@@ -206,6 +206,9 @@ class BitBakeConfigParameters(cookerdata.ConfigParameters):
help="Show the global or per-recipe environment complete with information"
" about where variables were set/changed.")
+ parser.add_option("--no-variable-tracking", action="store_true",
+ help="Disable variable tracking, which is enabled by default when using --environment/-e. The variable tracking feature adds variable history support to the -e output, but greatly increases memory usage")
+
parser.add_option("-g", "--graphviz", action="store_true", dest="dot_graph", default=False,
help="Save dependency tree information for the specified "
"targets in the dot syntax.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment