After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 795792 - cerbero backtrace when attempting to package GStreamer master build on ubuntu
cerbero backtrace when attempting to package GStreamer master build on ubuntu
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: cerbero
git master
Other Linux
: Normal major
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-05-04 05:48 UTC by Matthew Thyer
Modified: 2018-11-03 10:23 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Matthew Thyer 2018-05-04 05:48:50 UTC
Cerbero crashes with a Python backtrace when it gets to the packaging stage on Ubuntu.
Tested on Ubuntu 16.04 LTS and 18.04 LTS native and in docker containers.
This appears to be an issue related to the porting of cerbero from Python 2 to Python 3 as it does not occur if I checkout version 1.12.4 of cerbero instead of master.

The two warnings and the backtrace are:

WARNING: No specific packager available for the distro version ubuntu_18_04_bionic, using generic packager for distro debian
WARNING: No packager defined, using default packager "Default <default@change.me>"
Traceback (most recent call last):
  • File "./cerbero-uninstalled", line 9 in <module>
    main()
  • File "./cerbero/main.py", line 130 in main
    Main(sys.argv[1:])
  • File "./cerbero/main.py", line 55 in __init__
    self.run_command()
  • File "./cerbero/main.py", line 105 in run_command
    res = commands.run(command, self.config, self.args)
  • File "./cerbero/commands/__init__.py", line 78 in run
    return _commands[command].run(config, args)
  • File "./cerbero/commands/package.py", line 82 in run
    pkg = Packager(config, p, self.store)
  • File "./cerbero/packages/packager.py", line 53 in __new__
    return _packagers[d][v](config, package, store)
  • File "./cerbero/packages/debian.py", line 448 in __new__
    return DebianPackager(config, package, store)
  • File "./cerbero/packages/debian.py", line 187 in __init__
    self.license = f.read()
  • File "/usr/lib/python3.6/encodings/ascii.py", line 26 in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xef in position 0: ordinal not in range(128)

Steps to reproduce in a docker container are:

docker run -it ubuntu bash
apt install -y sudo python3 python-dev git intltool
populate your ~/.gitconfig for your identity
mkdir ~/git
cd ~/git
git clone git://anongit.freedesktop.org/gstreamer/cerbero
cd ~/git/cerbero
./cerbero-uninstalled bootstrap
./cerbero-uninstalled package gstreamer-1.0
Comment 1 Matthew Thyer 2018-05-04 06:14:04 UTC
Looking a bit further I see that class class DebianPackager in 'cerbero/packages/debian.py' reads from the file 'license.txt' which appears to be the file 'packages/gstreamer-1.0/license.txt'.

This file does start with three strange characters:
~/git/cerbero# hexdump -C -n 14 packages/gstreamer-1.0/license.txt
00000000  ef bb bf 49 6e 73 74 61  6c 6c 65 72 2c 20        |...Installer, |
0000000e
Comment 2 Matthew Thyer 2018-05-06 23:10:02 UTC
Stripping non-ascii characters from the file "packages/gstreamer-1.0/license.txt" allows pacakging using the default packager to complete.

My build process is now:

docker run -it ubuntu bash
apt install -y sudo python3 python-dev git intltool
populate your ~/.gitconfig for your identity
mkdir ~/git
cd ~/git
git clone git://anongit.freedesktop.org/gstreamer/cerbero
cd ~/git/cerbero
./cerbero-uninstalled bootstrap
perl -pi -e 's/[^[:ascii:]]//g' packages/gstreamer-1.0/license.txt
./cerbero-uninstalled package gstreamer-1.0
Comment 3 Matthew Thyer 2018-05-07 06:59:35 UTC
As noted in the gstreamer-devel mailing list, the above steps are not totally accurate as I'm 1) restricting myself to the ubuntu:xenial docker image and I'm using the 1.14 branch of cerbero.
So the exact steps to reproduce what I'm doing (and get packages built) are:
1.	docker run -it ubuntu:xenial bash
2.	apt install -y sudo python3 python-dev git intltool
3.	populate your ~/.gitconfig for your identity
4.	mkdir ~/git
5.	cd ~/git
6.	git clone git://anongit.freedesktop.org/gstreamer/cerbero -b 1.14
7.	cd ~/git/cerbero
8.	git checkout 1.14
9.	yes | ./cerbero-uninstalled bootstrap
10.	perl -pi -e 's/[^[:ascii:]]//g' packages/gstreamer-1.0/license.txt
11.	./cerbero-uninstalled package gstreamer-1.0
Comment 4 David Ing 2018-05-10 17:11:21 UTC
I don't think we can modify the license files in place as a permanent solution.

There is nothing about Debian policy that prohibits UTF-8 license files (see https://www.debian.org/doc/debian-policy/), so I don't think it's a Debian problem.  It must be a python (cerbero) problem requiring a modification to the cerbero code.
Comment 5 Nicolas Dufresne (ndufresne) 2018-05-10 18:51:38 UTC
Yes, the Python code need to support this.
Comment 6 David Ing 2018-05-10 19:22:06 UTC
I know that this problem did not exist in Cerbero 1.12.4.

Although I haven't looked at the code yet, this is probably a result of the Python 2 --> 3 conversion for which there are many implications around string encoding.  Fixing this is probably a simple matter of treating the contents of the license file as a byte array (thus avoiding any string conversions), but it may be more complicated then that.
Comment 7 GStreamer system administrator 2018-11-03 10:23:03 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/cerbero/issues/54.