View Bug Details

IDProjectCategoryView StatusLast Update
0002731DCP-o-maticPackagingpublic2024-01-16 21:01
Reporterbradel Assigned Tocarl  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platform64-bitOSLinuxOS VersionArch
Product Version2.16.70 
Summary0002731: Configure failure for libsub
Description

On Arch we encountered a weird bug. The bug is triggered during the config phase of libsub. When a lib pc file with weird non ascii characters is installed (in the case of Arch it is libvpl which contains the (R) symbol), the wscript fails with the attached error. The issue is when the output of pkg-config --list-all is parsed. This command prints the name and description field from the pc files, and in the case of libvpl the description contains the (R) symbol. The failure then occurs when pkg.decode('utf-8') is called.

Please find attached the vpl.pc file which contains the offending character and a patch which resolves the issue for my setup.

Best regards,
Benjamin

Steps To Reproduce

Move the vpl.pc file to the pkgconfig directory
Call "python waf configure" for the libsub project

Additional Information

configure error:

Setting top to : /home/benjamin/Programme/libsub
Setting out to : /home/benjamin/Programme/libsub/build
Checking for 'g++' (C++ compiler) : /usr/bin/g++
Checking for program 'pkg-config' : /usr/bin/pkg-config
Checking for 'openssl' : yes
Checking for boost library >= 1.45 : yes
Checking for boost filesystem library : yes
Traceback (most recent call last):
File "/home/benjamin/Programme/libsub/.waf3-2.0.24-c88b74123ce8b9d1a27999f7cf96dff0/waflib/Scripting.py", line 119, in waf_entry_point
run_commands()
File "/home/benjamin/Programme/libsub/.waf3-2.0.24-c88b74123ce8b9d1a27999f7cf96dff0/waflib/Scripting.py", line 182, in run_commands
ctx=run_command(cmd_name)
^^^^^^^^^^^^^^^^^^^^^
File "/home/benjamin/Programme/libsub/.waf3-2.0.24-c88b74123ce8b9d1a27999f7cf96dff0/waflib/Scripting.py", line 173, in run_command
ctx.execute()
File "/home/benjamin/Programme/libsub/.waf3-2.0.24-c88b74123ce8b9d1a27999f7cf96dff0/waflib/Configure.py", line 85, in execute
super(ConfigurationContext,self).execute()
File "/home/benjamin/Programme/libsub/.waf3-2.0.24-c88b74123ce8b9d1a27999f7cf96dff0/waflib/Context.py", line 92, in execute
self.recurse([os.path.dirname(g_module.root_path)])
File "/home/benjamin/Programme/libsub/.waf3-2.0.24-c88b74123ce8b9d1a27999f7cf96dff0/waflib/Context.py", line 133, in recurse
user_function(self)
File "/home/benjamin/Programme/libsub/wscript", line 144, in configure
pkg = pkg.decode('utf-8')
^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xae in position 36: invalid start byte

TagsNo tags attached.
Branch
Estimated weeks required
Estimated work required

Activities

bradel

2024-01-16 20:06

reporter  

vpl.pc (375 bytes)   
prefix=${pcfiledir}/../../
libdir=${pcfiledir}/../
includedir=${pcfiledir}/../../include

Name: Intel� Video Processing Library
Description: Accelerated video decode, encode, and frame processing capabilities on Intel� GPUs
Version: 2.10
URL: https://github.com/intel/libvpl

Libs: -L${libdir} -lvpl -ldl   -lstdc++
Libs.private: 
Cflags: -I${includedir} -I${includedir}/vpl
vpl.pc (375 bytes)   
0001-Don-t-convert-pkg-config-output-to-utf-8.patch (1,095 bytes)   
From fb91f873ebf4882ccecb949a65044e2b37448467 Mon Sep 17 00:00:00 2001
From: Benjamin Radel <benjamin@radel.tk>
Date: Tue, 16 Jan 2024 20:39:05 +0100
Subject: [PATCH] Don't convert pkg-config output to utf-8

Don't convert pkg-config output to utf-8 to prevent failure if obscure
non ascii characters are present
---
 wscript | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/wscript b/wscript
index 06e2660..855de57 100644
--- a/wscript
+++ b/wscript
@@ -141,8 +141,7 @@ def configure(conf):
     # Find the icu- libraries on the system as we need to link to them when we look for boost locale.
     locale_libs = ['boost_locale%s' % boost_lib_suffix, 'boost_system%s' % boost_lib_suffix]
     for pkg in subprocess.check_output(['pkg-config', '--list-all']).splitlines():
-        pkg = pkg.decode('utf-8')
-        if pkg.startswith("icu"):
+        if pkg.startswith(b'icu'):
             for lib in subprocess.check_output(['pkg-config', '--libs-only-l', pkg.split()[0]]).split():
                 name = lib[2:]
                 if not name in locale_libs:
-- 
2.43.0

carl

2024-01-16 21:01

administrator   ~0006256

Thank you, I applied the patch and tagged v1.6.46 which I'll use for DCP-o-matic 2.16.72.

Bug History

Date Modified Username Field Change
2024-01-16 20:06 bradel New Bug
2024-01-16 20:06 bradel File Added: vpl.pc
2024-01-16 20:06 bradel File Added: 0001-Don-t-convert-pkg-config-output-to-utf-8.patch
2024-01-16 21:01 carl Assigned To => carl
2024-01-16 21:01 carl Status new => resolved
2024-01-16 21:01 carl Resolution open => fixed
2024-01-16 21:01 carl Note Added: 0006256