[bitbake-devel] Variable key replaces original warnings
Olof Johansson
olof.johansson at axis.com
Thu Jul 30 15:03:50 UTC 2015
Hi all,
We've started to see issues on master like
WARNING:
Variable key USERADD_PARAM_${PN} (; --system --home / --no-create-home --comment 'Storage manager daemon' --gid storage storage)
replaces original key USERADD_PARAM_recording-indexer (--system --home / --no-create-home --comment 'apache httpd' --gid www www).
(my alignment...)
The warning happens when doing
WWWUSER_PACKAGE ?= "${PN}"
USERADD_PARAM_${WWWUSER_PACKAGE} := "--system --home / --no-create-home --gid www www"
USERADD_PARAM_${PN}_append = "; --system --home / --no-create-home --gid username username"
(in reality, the first two lines are inherited from a class, and the third in
the recipe itself.)
With bitbake -e I see what looks like the expected value, with both users being
created. If I change USERADD_PARAM_${WWWUSER_PACKAGE} (second line) to
USERADD_PARAM_${PN} no warning is printed, so this only seems to be a problem
in cases where multiple unique non-expanded vars expand to the same expanded
var.
I made a unit test that should demonstrate the problem (I think), and it fails
because of the warnings:
diff --git a/bitbake/lib/bb/tests/data.py b/bitbake/lib/bb/tests/data.py
index e9aab57..e7716cc 100644
--- a/bitbake/lib/bb/tests/data.py
+++ b/bitbake/lib/bb/tests/data.py
@@ -386,6 +386,15 @@ class TestKeyExpansion(unittest.TestCase):
self.assertTrue(logContains("Variable key VAL_${FOO} (A) replaces original key VAL_foo (B)", logs))
self.assertEqual(self.d.getVar("VAL_foo", True), "A")
+ def test_append(self):
+ self.d.setVar("TEST_${BAR}", "Bar")
+ self.d.setVar("TEST_${FOO}_append", "Foo")
+ with LogRecord() as logs:
+ bb.data.expandKeys(self.d)
+ self.assertFalse(logContains("Variable key TEST_${FOO} (Foo) replaces original key TEST_foo (Bar)", logs))
+ self.assertEqual(self.d.getVar("TEST_${FOO}", True), "BarFoo")
If you have any ideas on what this issue can be or how to fix it, please
let me know :)
--
olof johansson
More information about the bitbake-devel
mailing list