Mostly, I've managed to get quite far with packaging ReviewBoard for Linux. Although I don't know much about the Gentoo packaging system, it has turned out to be easier than I feared.
We're currently running ReviewBoard 2.5.18, installed using the portage package manager. So we have done this packaging for 2.5.18. I tried this upgrade previously, but was stymied and gave up. This time I pushed ahead after understanding a better approach.
I've gotten *almost* all the way to a successful 3.0.14 install of ReviewBoard. I've got it up and running, but one thing is going wrong, and I haven't figured out why, just yet. When I say I've got it up and running, that means that I've been able to perform rb-site upgrade on all the instances, login works, and I can browse the reviews. I can access the administrative pages (since I'm an admin). However, when I click on an individual review, I get an error:
Traceback (most recent call last):
File "/usr/lib64/python2.7/site-packages/django/core/handlers/base.py", line 137, in get_response
response = response.render()
File "/usr/lib64/python2.7/site-packages/django/template/response.py", line 105, in render
self.content = self.rendered_content
File "/usr/lib64/python2.7/site-packages/django/template/response.py", line 82, in rendered_content
content = template.render(context)
File "/usr/lib64/python2.7/site-packages/django/template/base.py", line 140, in render
return self._render(context)
File "/usr/lib64/python2.7/site-packages/django/template/base.py", line 134, in _render
return self.nodelist.render(context)
File "/usr/lib64/python2.7/site-packages/django/template/base.py", line 840, in render
bit = self.render_node(node, context)
File "/usr/lib64/python2.7/site-packages/django/template/base.py", line 854, in render_node
return node.render(context)
File "/usr/lib64/python2.7/site-packages/django/template/loader_tags.py", line 123, in render
return compiled_parent._render(context)
File "/usr/lib64/python2.7/site-packages/django/template/base.py", line 134, in _render
return self.nodelist.render(context)
File "/usr/lib64/python2.7/site-packages/django/template/base.py", line 840, in render
bit = self.render_node(node, context)
File "/usr/lib64/python2.7/site-packages/django/template/base.py", line 854, in render_node
return node.render(context)
File "/usr/lib64/python2.7/site-packages/django/template/loader_tags.py", line 123, in render
return compiled_parent._render(context)
File "/usr/lib64/python2.7/site-packages/django/template/base.py", line 134, in _render
return self.nodelist.render(context)
File "/usr/lib64/python2.7/site-packages/django/template/base.py", line 840, in render
bit = self.render_node(node, context)
File "/usr/lib64/python2.7/site-packages/django/template/base.py", line 854, in render_node
return node.render(context)
File "/usr/lib64/python2.7/site-packages/django/template/base.py", line 1125, in render
return func(*resolved_args, **resolved_kwargs)
File "/usr/lib64/python2.7/site-packages/djblets/extensions/templatetags/djblets_extensions.py", line 295, in load_extensions_css
_render_css_bundle))
File "/usr/lib64/python2.7/site-packages/djblets/extensions/templatetags/djblets_extensions.py", line 265, in _get_extension_bundles
yield renderer(context, extension, bundle_name)
File "/usr/lib64/python2.7/site-packages/djblets/extensions/templatetags/djblets_extensions.py", line 143, in _render_css_bundle
name, 'CSS')
File "/usr/lib64/python2.7/site-packages/djblets/extensions/templatetags/djblets_extensions.py", line 117, in _render_bundle
return node_cls('"%s"' % extension.get_bundle_id(name)).render(context)
File "/usr/lib64/python2.7/site-packages/pipeline/templatetags/pipeline.py", line 140, in render
return self.render_compressed(package, package_name, 'css')
File "/usr/lib64/python2.7/site-packages/djblets/extensions/templatetags/djblets_extensions.py", line 54, in render_compressed
rendered = self.render_compressed_output(*args, **kwargs)
File "/usr/lib64/python2.7/site-packages/pipeline/templatetags/pipeline.py", line 82, in render_compressed_output
return method(package, package.output_filename)
File "/usr/lib64/python2.7/site-packages/pipeline/templatetags/pipeline.py", line 147, in render_css
'url': mark_safe(staticfiles_storage.url(path))
File "/usr/lib64/python2.7/site-packages/django/contrib/staticfiles/storage.py", line 139, in url
hashed_name = self.hashed_name(clean_name).replace('\\', '/')
File "/usr/lib64/python2.7/site-packages/django/contrib/staticfiles/storage.py", line 96, in hashed_name
(clean_name, self))
ValueError: The file 'ext/rbintegrations.extension.RBIntegrationsExtension/css/fields.min.css' could not be found with <pipeline.storage.PipelineCachedStorage object at 0x7f8e1b6c9ad0>.
Note that this appears to be the same as:
... but that thread in the mailing list didn't get a response.
---------------------
I'm guessing I've done something to package this up incorrectly, but I'm not quite sure where to look next. Hence, the request for help. Several context notes:
- I'm running using wsgi (v4.5.13) under Apache (v2.4.39)
- Gentoo installs from *sources*, so I'm not using the .egg or .whl distributions, but the tar.gz.
- I did have to patch here and there for the setup steps (more on that below)
- Excluding differences in *.pyc files, the results of the Gentoo package installs of ReviewBoard and rbintegrations that I built are the same as the result of performing pip install --local -U ReviewBoard
The last time I ran into a problem, I got stuck on the "setup" stage. Gentoo's infrastructure for installing Python packages involves calling the "setup.py" script. In the ReviewBoard and rbintegrations sources, the setup.py attempts to do a whole bunch of stuff that Gentoo doesn't allow in a package install step (installing node packages, in particular, as it breaks the sandbox for the package install). The solution ended up being very simple for the ReviewBoard package - in setup.py, change the "cmdclass=" line to "cmdclass_unused=", which disables all the extra steps in the install. For the rbintegrations package, I needed to go a little further, replacing the "from reviewboard.extensions.packaging import setup" with "from setuptools import setup", adding lines for "package_data" to ensure that the "setup.py install" step captures all of the relevant css, js, less, and png files, as well as installing a few images (which I copied from the results of the pip install).
Although I don't believe it is relevant, there are a definitely python packages that are different between my "portage" based install vs. the "pip" install. Specifically, some of the python packages already exist in the Gentoo packaging system, so I didn't make new versions of those:
asn1crypto-0.24.0.dist-info --> 0.22.0
certifi-2019.3.9.dist-info --> 2018.4.16
cffi-1.12.3.dist-info --> 1.11.4
python_dateutil-2.8.0.dist-info --> 2.7.2
django_evolution-0.7.8.dist-info --> 0.7.7
dnspython-1.16.0.dist-info --> 1.15.0
futures-3.2.0.dist-info --> 3.1.1
idna-2.8.dist-info --> 2.5
Markdown-2.6.11.dist-info --> 2.6.8
PyNaCl-1.3.0.dist-info --> 1.2.1
pillowfight-0.3-py2.7.egg-info --> 0.2
pyasn1-0.4.5.dist-info --> 0.4.2
pycparser-2.19-py2.7.egg-info --> 2.14
Pygments-2.4.2.dist-info --> 2.3.1
pytz-2019.1.dist-info --> 2018.9
requests-2.22.0.dist-info --> 2.21.0
urllib3-1.25.3.dist-info --> 1.24.2
As I said, the resulting installed image in /usr/lib64/python2.7/site-packages/reviewboard and /usr/lib64/python2.7/site-packages/rbintegrations are identical to the ones installed via "pip install", with the exception of the *.pyc files.
Any idea where I should look to fix this problem?
In case it is relevant:
# python --version
Python 2.7.15