Bug ID 1212650
Summary SeaMonkey 2.53.16 won't build due to Python 2/3 issues
Classification openSUSE
Product openSUSE Tumbleweed
Version Current
Hardware Other
OS Other
Status NEW
Severity Critical
Priority P5 - None
Component Firefox
Assignee factory-mozilla@lists.opensuse.org
Reporter psychonaut@nothingisreal.com
QA Contact qa-bugs@suse.de
CC wolfgang@rosenauer.org
Target Milestone ---
Found By ---
Blocker ---

Created attachment 867764 [details]
Patch for the "invalid mode" error when building SeaMonkey

Recently the SeaMonkey 2.53.16 package stopped compiling for Tumbleweed:

```
[   75s] ./mach --log-no-times configure
[   75s] Error running mach:
[   75s] 
[   75s]     ['--log-no-times', 'configure']
[   75s] 
[   75s] The error occurred in code that was called by the mach command. This
is either
[   75s] a bug in the called code itself or in the way that mach is calling it.
[   75s] 
[   75s] You should consider filing a bug for this issue.
[   75s] 
[   75s] If filing a bug, please include the full output of mach, including
this error
[   75s] message.
[   75s] 
[   75s] The details of the failure are as follows:
[   75s] 
[   75s] ValueError: invalid mode: 'rU'
[   75s] 
[   75s]   File
"/home/abuild/rpmbuild/BUILD/seamonkey-2.53.16/mozilla/python/mozbuild/mozbuild/build_commands.py",
line 98, in configure
[   75s]     return driver.configure(
[   75s]            ^^^^^^^^^^^^^^^^^
[   75s]   File
"/home/abuild/rpmbuild/BUILD/seamonkey-2.53.16/mozilla/python/mozbuild/mozbuild/controller/building.py",
line 1424, in configure
[   75s]     self._write_mozconfig_json()
[   75s]   File
"/home/abuild/rpmbuild/BUILD/seamonkey-2.53.16/mozilla/python/mozbuild/mozbuild/controller/building.py",
line 1505, in _write_mozconfig_json
[   75s]     with FileAvoidWrite(mozconfig_json) as fh:
[   75s]   File
"/home/abuild/rpmbuild/BUILD/seamonkey-2.53.16/mozilla/python/mozbuild/mozbuild/util.py",
line 345, in __exit__
[   75s]     self.close()
[   75s]   File
"/home/abuild/rpmbuild/BUILD/seamonkey-2.53.16/mozilla/python/mozbuild/mozbuild/util.py",
line 268, in close
[   75s]     existing = _open(self.name, self.mode)
[   75s]                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
[   75s]   File
"/home/abuild/rpmbuild/BUILD/seamonkey-2.53.16/mozilla/python/mozbuild/mozbuild/util.py",
line 66, in _open
[   75s]     return io.open(path, mode, encoding='utf-8', newline='\n')
[   75s]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[   75s] make: *** [GNUmakefile:71:
/home/abuild/rpmbuild/BUILD/seamonkey-2.53.16/mozilla/obj-x86_64-pc-linux-gnu/Makefile]
Error 1
[   75s] error: Bad exit status from /var/tmp/rpm-tmp.qjzAE2 (%build)

```

Applying the attached patch, which changes all instances of 'rU' to 'r' and all
instances of "rU" to "r" in the Python source files, works around this "invalid
mode" error, but then throws up a new one:

```
[   33s] /usr/bin/gmake -f client.mk MOZ_PARALLEL_BUILD=12 -s configure
[   33s] cd
/home/abuild/rpmbuild/BUILD/seamonkey-2.53.16/mozilla/obj-x86_64-pc-linux-gnu
[   33s] /home/abuild/rpmbuild/BUILD/seamonkey-2.53.16/mozilla/configure
[   33s] Creating Python 3 environment
[   33s]
/home/abuild/rpmbuild/BUILD/seamonkey-2.53.16/mozilla/third_party/python/virtualenv/virtualenv.py:24:
DeprecationWarning: The distutils package is deprecated and slated for removal
in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
[   33s]   import distutils.spawn
[   33s]
/home/abuild/rpmbuild/BUILD/seamonkey-2.53.16/mozilla/third_party/python/virtualenv/virtualenv.py:25:
DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig
instead
[   33s]   import distutils.sysconfig
[   33s] Using base prefix '/usr'
[   33s] New python executable in
/home/abuild/rpmbuild/BUILD/seamonkey-2.53.16/mozilla/obj-x86_64-pc-linux-gnu/_virtualenvs/init_py3/bin/python3
[   33s] Also creating executable in
/home/abuild/rpmbuild/BUILD/seamonkey-2.53.16/mozilla/obj-x86_64-pc-linux-gnu/_virtualenvs/init_py3/bin/python
[   33s] ERROR: The executable
/home/abuild/rpmbuild/BUILD/seamonkey-2.53.16/mozilla/obj-x86_64-pc-linux-gnu/_virtualenvs/init_py3/bin/python3
is not functioning
[   33s] ERROR: It thinks sys.prefix is '/usr' (should be
'/home/abuild/rpmbuild/BUILD/seamonkey-2.53.16/mozilla/obj-x86_64-pc-linux-gnu/_virtualenvs/init_py3')
[   33s] ERROR: virtualenv is not compatible with this system or executable
```

I think the problem might be that the build system is now installing Python 3.x
(in addition to Python 2.7) whereas before it was installing only Python 2.7. 
The spec file has `BuildRequires` only for `python-devel` and `python2-xml`
which I think should pull in only Python 2.7, so there might be some other
`BuildRequires` that now depends on Python 3.x.

According to [the release notes of SeaMonkey
2.53.17beta1](https://www.seamonkey-project.org/releases/seamonkey2.53.17/),
the build system in that version now uses Python 3 ([or maybe
not](https://bugzilla.mozilla.org/show_bug.cgi?id=1840074)), so perhaps this
problem can simply be ignored until the release of 2.53.17.  I'm not really
sure what else can be done to fix this issue for the 2.53.16 package -- perhaps
some of the 2.53.17beta1 changes can be backported, but I don't know if this is
sufficient, or if there is perhaps a quicker workaround.


You are receiving this mail because: