Skip to contentSkip to conversation

buildhistory: fix incorrect command line in commit message with memres

PATCH New Paul Eggleton 1 participant 3 messages Jun 9, 2017

lore
Share & tools
lore
#0 lore raw

cover buildhistory: fix incorrect command line in commit message with memres

Note: this depends upon the patchset I just sent to the bitbake-devel list.

The following changes since commit 186882ca62bf683b93cd7a250963921b89ba071f:

buildhistory: skip tests if GitPython module is missing (2017-06-07 16:00:43 +0100)

are available in the git repository at:

git://git.openembedded.org/openembedded-core-contrib paule/buildhistory-cmdline-memres
http://cgit.openembedded.org/openembedded-core-contrib/log/?h=paule/buildhistory-cmdline-memres

Paul Eggleton (2):
bitbake.conf: add BB_CMDLINE to BB_HASHCONFIG_WHITELIST classes/buildhistory: use BB_CMDLINE to get bitbake command line

 meta/classes/buildhistory.bbclass | 13 ++++++++-----
 meta/conf/bitbake.conf            |  2 +-
 2 files changed, 9 insertions(+), 6 deletions(-)
Signature · 1 line
2.9.4
#1 lore raw

PATCH 1/2 bitbake.conf: add BB_CMDLINE to BB_HASHCONFIG_WHITELIST

We really don't want the just-introduced BB_CMDLINE influencing the config hash.

Part of the fix for [YOCTO #11634].

---
 meta/conf/bitbake.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/conf/bitbake.conf +1 -1
index 3ad905c..caae6a0 100644
@@ -856,7 +856,7 @@ BB_HASHCONFIG_WHITELIST ?= "${BB_HASHBASE_WHITELIST} DATE TIME SSH_AGENT_PID \
     PARALLEL_MAKE BB_NUMBER_THREADS BB_ORIGENV BB_INVALIDCONF BBINCLUDED \
     GIT_PROXY_COMMAND ALL_PROXY all_proxy NO_PROXY no_proxy FTP_PROXY ftp_proxy \
     HTTP_PROXY http_proxy HTTPS_PROXY https_proxy SOCKS5_USER SOCKS5_PASSWD \
-    BB_SETSCENE_ENFORCE"
+    BB_SETSCENE_ENFORCE BB_CMDLINE"
 BB_SIGNATURE_EXCLUDE_FLAGS ?= "doc deps depends \
     lockfiles type vardepsexclude vardeps vardepvalue vardepvalueexclude \
     file-checksums python func task export unexport noexec nostamp dirs cleandirs \
Signature · 1 line
2.9.4
#2 lore raw

PATCH 2/2 classes/buildhistory: use BB_CMDLINE to get bitbake command line

In reply to Paul Eggleton

We put the bitbake command line in the buildhistory commit message for informational purposes, but calling sys.argv to get that as we were previously doesn't really work in memory resident mode - that gives you the command used to start the bitbake server which is much less interesting. Use the just-introduced BB_CMDLINE variable instead.

Part of the fix for [YOCTO #11634].

---
 meta/classes/buildhistory.bbclass | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
meta/classes/buildhistory.bbclass +8 -5
index 3e907fc..74b837e 100644
@@ -696,11 +696,14 @@ def buildhistory_get_sdkvars(d):
 
 
 def buildhistory_get_cmdline(d):
-    if sys.argv[0].endswith('bin/bitbake'):
-        bincmd = 'bitbake'
-    else:
-        bincmd = sys.argv[0]
-    return '%s %s' % (bincmd, ' '.join(sys.argv[1:]))
+    argv = d.getVar('BB_CMDLINE', False)
+    if argv:
+        if argv[0].endswith('bin/bitbake'):
+            bincmd = 'bitbake'
+        else:
+            bincmd = argv[0]
+        return '%s %s' % (bincmd, ' '.join(argv[1:]))
+    return ''
 
 
 buildhistory_single_commit() {
Signature · 1 line
2.9.4