Skip to contentSkip to conversation

kas/ci: Fix bitbake variable referencing themselves

PATCH In review Florian Bezdeka 2 participants 3 messages Jun 1

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kas/ci: Fix bitbake variable referencing themselves

When trying to run a local kas build using the kas/opt/ci.yaml option file the following bitbake error occurred as the following two bitbake variables were referencing themselves:

Variables:
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY

Error:
bb.data_smart.ExpansionError: Failure expanding variable AWS_ACCESS_KEY_ID, expression was ${AWS_ACCESS_KEY_ID} which triggered exception
Exception: variable AWS_ACCESS_KEY_ID references itself! The variable dependency chain for the failure is: AWS_ACCESS_KEY_ID

The problem only exists for local builds as the gitlab project configuration defines such variables.

We can avoid the bitbake error by stopping forwaring the variables to bitbake. We don't need those variables inside the build environment. The only user is located in the deploy_to_aws.sh script, which is executed on gitlab CI level.

---
 kas/opt/ci.yaml | 4 ----
 1 file changed, 4 deletions(-)
kas/opt/ci.yaml +0 -4
index e1466a0..01d5c07 100644
@@ -23,7 +23,3 @@ local_conf_header:
     IMAGE_INSTALL:remove = "sshd-regen-keys"
     IMAGE_INSTALL:remove = "expand-on-first-boot"
     IMAGE_FSTYPES = "${@ 'ext4.gz' if d.getVar('MACHINE', True).startswith('qemu') else 'tar.gz' }"
-
-env:
-  AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID}
-  AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY}
Signature · 1 line
2.54.0
#1 lore raw
Quoted 33 lines · Florian Bezdeka

When trying to run a local kas build using the kas/opt/ci.yaml option file the following bitbake error occurred as the following two bitbake variables were referencing themselves:

Variables:
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY

Error:
bb.data_smart.ExpansionError: Failure expanding variable AWS_ACCESS_KEY_ID, expression was ${AWS_ACCESS_KEY_ID} which triggered exception
Exception: variable AWS_ACCESS_KEY_ID references itself! The variable dependency chain for the failure is: AWS_ACCESS_KEY_ID

The problem only exists for local builds as the gitlab project configuration defines such variables.

We can avoid the bitbake error by stopping forwaring the variables to bitbake. We don't need those variables inside the build environment. The only user is located in the deploy_to_aws.sh script, which is executed on gitlab CI level.

---
 kas/opt/ci.yaml | 4 ----
 1 file changed, 4 deletions(-)
kas/opt/ci.yaml +0 -0
index e1466a0..01d5c07 100644

kas/opt/ci.yaml local_conf_header: · line 29

Quoted 7 lines
kas/opt/ci.yaml +0 -4
@@ -23,7 +23,3 @@ local_conf_header:
     IMAGE_INSTALL:remove = "sshd-regen-keys"
     IMAGE_INSTALL:remove = "expand-on-first-boot"
     IMAGE_FSTYPES = "${@ 'ext4.gz' if d.getVar('MACHINE', True).startswith('qemu') else 'tar.gz' }"
-
-env:
-  AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID}
-  AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY}

Check the introducing commit 0e027423275a why those two are probably needed for bitbake as well.

Jan

Signature · 2 lines
Siemens AG, Foundational Technologies
Linux Expert Center
#2 lore raw
Quoted 29 lines · Jan Kiszka
Quoted 28 lines · Florian Bezdeka

When trying to run a local kas build using the kas/opt/ci.yaml option file the following bitbake error occurred as the following two bitbake variables were referencing themselves:

Variables:
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY

Error:
bb.data_smart.ExpansionError: Failure expanding variable AWS_ACCESS_KEY_ID, expression was ${AWS_ACCESS_KEY_ID} which triggered exception
Exception: variable AWS_ACCESS_KEY_ID references itself! The variable dependency chain for the failure is: AWS_ACCESS_KEY_ID

The problem only exists for local builds as the gitlab project configuration defines such variables.

We can avoid the bitbake error by stopping forwaring the variables to bitbake. We don't need those variables inside the build environment. The only user is located in the deploy_to_aws.sh script, which is executed on gitlab CI level.

---
 kas/opt/ci.yaml | 4 ----
 1 file changed, 4 deletions(-)
Quoted 16 lines

kas/opt/ci.yaml local_conf_header: · line 29

Quoted 12 lines
kas/opt/ci.yaml +0 -4
index e1466a0..01d5c07 100644
@@ -23,7 +23,3 @@ local_conf_header:
     IMAGE_INSTALL:remove = "sshd-regen-keys"
     IMAGE_INSTALL:remove = "expand-on-first-boot"
     IMAGE_FSTYPES = "${@ 'ext4.gz' if d.getVar('MACHINE', True).startswith('qemu') else 'tar.gz' }"
-
-env:
-  AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID}
-  AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY}

Check the introducing commit 0e027423275a why those two are probably needed for bitbake as well.

That said, maybe setting those to empty is already enough because kas will then pick up their value from the calling env - if set. In any case, please validate any new proposal accordingly.

Jan

Signature · 2 lines
Siemens AG, Foundational Technologies
Linux Expert Center