Merge ~sylvain-pineau/checkbox-ng:add_env_PERL5LIB into checkbox-ng:master

Proposed by Sylvain Pineau
Status: Merged
Approved by: Sylvain Pineau
Approved revision: ebc8c6af7dd2ef72a4993e7f275dc8a64f9a1389
Merged at revision: 6e6794d0e4a725dd9a1d8153e7bbe9bb2c36a74a
Proposed branch: ~sylvain-pineau/checkbox-ng:add_env_PERL5LIB
Merge into: checkbox-ng:master
Diff against target: 23 lines (+3/-2)
1 file modified
plainbox/impl/execution.py (+3/-2)
Reviewer Review Type Date Requested Status
Sylvain Pineau (community) Approve
Review via email: mp+401767@code.launchpad.net

Description of the change

On interim release, standard perl modules are loaded from host, which fails:

Can't load '/usr/lib/x86_64-linux-gnu/perl-base/auto/Cwd/Cwd.so' for module Cwd: /snap/core20/current/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by /usr/lib/x86_64-linux-gnu/perl-base/auto/Cwd/Cwd.so) at /usr/lib/x86_64-linux-gnu/perl-base/XSLoader.pm line 93.
 at /usr/lib/x86_64-linux-gnu/perl-base/Cwd.pm line 80.
Compilation failed in require at /tmp/nest-fklulusb.fb0c9a20efff53557c9692007fb7b11f9f15c36c4338d445a9b11875f6e0fb9c/inxi_snapshot line 22.
BEGIN failed--compilation aborted at /tmp/nest-fklulusb.fb0c9a20efff53557c9692007fb7b11f9f15c36c4338d445a9b11875f6e0fb9c/inxi_snapshot line 22.

Inxi related jobs (e.g raw_devices_dmi) running as root cannot load the right perl modules if PERL5LIB set in wrapper_common* is not passed to the target environment. This MR fixes it.

To post a comment you must log in.
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

inxi was one example, better to land this little patch to avoid similar import errors even on lts.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/plainbox/impl/execution.py b/plainbox/impl/execution.py
2index 7d5e5fe..e1aa65b 100644
3--- a/plainbox/impl/execution.py
4+++ b/plainbox/impl/execution.py
5@@ -453,7 +453,7 @@ def get_execution_environment(job, environ, session_id, nest_dir):
6 job.provider.locale_dir
7 if (os.getenv("SNAP") or os.getenv("SNAP_APP_PATH")):
8 copy_vars = ['PYTHONHOME', 'PYTHONUSERBASE', 'LD_LIBRARY_PATH',
9- 'GI_TYPELIB_PATH']
10+ 'GI_TYPELIB_PATH', 'PERL5LIB']
11 for key, value in env.items():
12 if key in copy_vars or key.startswith('SNAP'):
13 env[key] = value
14@@ -537,7 +537,8 @@ def get_differential_execution_environment(job, environ, session_id, nest_dir,
15 # Preserve the copy_vars variables + those prefixed with SNAP on Snappy
16 if (os.getenv("SNAP") or os.getenv("SNAP_APP_PATH")):
17 copy_vars = ['PYTHONHOME', 'PYTHONUSERBASE', 'LD_LIBRARY_PATH',
18- 'GI_TYPELIB_PATH', 'PROVIDERPATH', 'PYTHONPATH']
19+ 'GI_TYPELIB_PATH', 'PROVIDERPATH', 'PYTHONPATH',
20+ 'PERL5LIB']
21 for key, value in base_env.items():
22 if key in copy_vars or key.startswith('SNAP'):
23 delta_env[key] = value

Subscribers

People subscribed via source and target branches