Skip to content

Support extra envvars per snap (New)#2325

Merged
Hook25 merged 12 commits intomainfrom
support_extra_envvars_per_snap
Feb 11, 2026
Merged

Support extra envvars per snap (New)#2325
Hook25 merged 12 commits intomainfrom
support_extra_envvars_per_snap

Conversation

@Hook25
Copy link
Collaborator

@Hook25 Hook25 commented Feb 9, 2026

Description

Some libraries are not the default locations and, without ldconfig support, which we don't have in snaps, we don't have an easy way to point to them.
The old approach was to add them to the wrapper common, but this leads to:

  • code duplication, all frontends have a copy of this file
  • forced inheritance, Checkbox itself and all jobs of all providers see this variables and are influenced by them
  • broken w/ the new interface. Now that custom frontends no longer have an independent agent, this mechanism to define these variables doesn't work anymore.

This introduces a new mechanism, in the form of a file in the root of the snap with a very simple sintax and comments support. This file is supposed to be created during snap creation and is in the form of:

# comments
VARIABLE_NAME+=value

Resolved issues

Fixes: CHECKBOX-2172

Documentation

Added a HowTo that expains how to use the new packaging feature

Tests

Tested on a rebuilt version of Checkbox24. Use this command to run the test

snap download --edge checkbox24
unsquashfs checkbox24*.snap
cd squashfs-root
snap try --devmode .
checkbox24.checkbox run fwts
# ^^^ this fails
# lets patch it

Add this file under squashfs-root

#fwts is in /lib/fwts instead of /lib
LD_LIBRARY_PATH+=/lib/fwts
# lapack and blas are pulled by opencv and install libraries in a directory
LD_LIBRARY_PATH+=/usr/lib/x86_64-linux-gnu/lapack
LD_LIBRARY_PATH+=/usr/lib/x86_64-linux-gnu/blas
GI_TYPELIB_PATH+=/usr/lib/girepository-1.0
GI_TYPELIB_PATH+=/usr/lib/x86_64-linux-gnu/girepository-1.0

Now patch the snap and run the test(assuming ../checkbox points to checkbox repo at this branch

cp -rT ../checkbox/checkbox-ng/checkbox_ng/ `find . -name "checkbox_ng"`; cp -rT ../checkbox/checkbox-ng/plainbox/ `find . -name "plainbox"`; checkbox24.checkbox run fwts

Minor: remove dead code
Minor: why none? lets make this an empty list please
@codecov
Copy link

codecov bot commented Feb 9, 2026

Codecov Report

❌ Patch coverage is 88.31169% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 55.32%. Comparing base (bf63c5f) to head (24fe25e).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
checkbox-ng/plainbox/impl/execution.py 54.54% 5 Missing ⚠️
checkbox-ng/plainbox/impl/secure/providers/v1.py 90.90% 3 Missing and 1 partial ⚠️

❌ Your patch status has failed because the patch coverage (88.31%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2325      +/-   ##
==========================================
+ Coverage   55.25%   55.32%   +0.06%     
==========================================
  Files         413      413              
  Lines       44457    44524      +67     
  Branches     8195     8213      +18     
==========================================
+ Hits        24566    24634      +68     
+ Misses      19031    19029       -2     
- Partials      860      861       +1     
Flag Coverage Δ
checkbox-ng 71.82% <88.31%> (+0.12%) ⬆️
provider-base 32.17% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Hook25 Hook25 force-pushed the support_extra_envvars_per_snap branch from 6c45e3b to ff7bfce Compare February 10, 2026 10:26
Copy link
Collaborator

@fernando79513 fernando79513 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job here. I just have a couple of questions/suggestions, but it looks good in general (appart from the path bug)

This is designed for paths, it doesn't make sense to call it
extra_environment if it is not designed to set extra environment but
only add (and combine) extra paths
Copy link
Collaborator

@fernando79513 fernando79513 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM +1!
Good job, thanks!
👍

@Hook25 Hook25 merged commit 630ef1b into main Feb 11, 2026
48 of 49 checks passed
@Hook25 Hook25 deleted the support_extra_envvars_per_snap branch February 11, 2026 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants