View Issue Details

IDProjectCategoryView StatusLast Update
0009648ardourbugspublic2024-03-04 22:00
ReporterEickmeyer Assigned Tox42  
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
PlatformUbuntuOSLinuxOS Version(any)
Product Version8.4 
Summary0009648: Build fails with Python 3.12
DescriptionThis is mostly a heads-up when Debian switches to Python 3.12. itstool is largely unmaintained and has a few breakages due to Python 3.12 and is throwing issues into STDOUT, causing translations to fail to build. Ignoring STDERR output makes it build properly.

A one-line change in /wscript fixes this:

--- wscript
+++ wscript
@@ -1003,7 +1003,7 @@ def configure(conf):
 
     # freedesktop translations needs itstool > 1.0.3 (-j option)
     if Options.options.freedesktop:
- output = subprocess.Popen("itstool --version", shell=True, stderr=subprocess.STDOUT, stdout=subprocess.PIPE).communicate()[0].splitlines()
+ output = subprocess.Popen("itstool --version", shell=True, stderr=subprocess.DEVNULL, stdout=subprocess.PIPE).communicate()[0].splitlines()
         o = output[0].decode('utf-8')
         itstool = o.split(' ')[0]
         version = o.split(' ')[1].split('.')

Steps To ReproduceSimply build in Ubuntu Noble Numbat (future Ubuntu 24.04 LTS). Eventually, after Debian transitions to Python 3.12, this will be reproducible there. Really, there's no reason to be monitoring STDOUT here.
Additional InformationI have attached the patch being used in Ubuntu, this can also be used in Debian or reimplemented for your use. Thanks to Gianfranco Costamonga for the fix.
TagsNo tags attached.

Activities

Eickmeyer

2024-02-28 17:39

reporter  

fix-build-python-3.12.patch (1,794 bytes)   
Description:
itstool --version              
/usr/bin/itstool:239: SyntaxWarning: invalid escape sequence '\s'
  if re.sub('\s+', ' ', text).strip() != '':
/usr/bin/itstool:337: SyntaxWarning: invalid escape sequence '\s'
  message = re.sub('\s+', ' ', message).strip()
/usr/bin/itstool:475: SyntaxWarning: invalid escape sequence '\s'
  return re.sub('\s+', ' ', self.locnote).strip()
/usr/bin/itstool:477: SyntaxWarning: invalid escape sequence '\s'
  return '(itstool) link: ' + re.sub('\s+', ' ', self.locnoteref).strip()
/usr/bin/itstool:891: SyntaxWarning: invalid escape sequence '\<'
  regex = re.compile('(.*) \<(.*)\>, (.*)')
/usr/bin/itstool:926: SyntaxWarning: invalid escape sequence '\s'
  if re.sub('\s+', '', prevtext) == '':
/usr/bin/itstool:1452: SyntaxWarning: invalid escape sequence '\.'
  _locale_pattern = re.compile('([a-zA-Z0-9-]+)(_[A-Za-z0-9]+)?(@[A-Za-z0-9]+)?(\.[A-Za-z0-9]+)?')
itstool 2.0.6

Having stderr output inside the returned command tricks the system to fail in detecting the version.
Ignoring stderr output looks fine to make it build properly
Author: Gianfranco Costamagna <locutusofborg@debian.org>
Last-Update: 2024-02-28

--- ardour-8.4.0+ds1.orig/wscript
+++ ardour-8.4.0+ds1/wscript
@@ -1003,7 +1003,7 @@ def configure(conf):
 
     # freedesktop translations needs itstool > 1.0.3 (-j option)
     if Options.options.freedesktop:
-        output = subprocess.Popen("itstool --version", shell=True, stderr=subprocess.STDOUT, stdout=subprocess.PIPE).communicate()[0].splitlines()
+        output = subprocess.Popen("itstool --version", shell=True, stderr=subprocess.DEVNULL, stdout=subprocess.PIPE).communicate()[0].splitlines()
         o = output[0].decode('utf-8')
         itstool = o.split(' ')[0]
         version = o.split(' ')[1].split('.')
fix-build-python-3.12.patch (1,794 bytes)   

x42

2024-03-04 14:31

administrator   ~0028580

Thanks. applied as 8.4-43-g338cd09a4a

Do you know where those `SyntaxWarning: invalid escape sequence` come from?

Eickmeyer

2024-03-04 16:28

reporter   ~0028581

It comes from `itstool` being incompliant with new Python 3.12 rules, and largely unmaintained upstream. However, though it's throwing the warnings, it's still doing its job with the translations, so there's no reason to panic. The only issue was that the wscript was seeing these warnings as errors and the entire build process was shutting-down as a result.

Issue History

Date Modified Username Field Change
2024-02-28 17:39 Eickmeyer New Issue
2024-02-28 17:39 Eickmeyer File Added: fix-build-python-3.12.patch
2024-03-04 14:31 x42 Note Added: 0028580
2024-03-04 16:28 Eickmeyer Note Added: 0028581
2024-03-04 22:00 x42 Assigned To => x42
2024-03-04 22:00 x42 Status new => resolved
2024-03-04 22:00 x42 Resolution open => fixed