Skip to content

Commit 50e3c06

Browse files
committed
Fix dbcounter installation on Jammy
There are two problems with dbcounter installation on Jammy. The first is straightforward. We have to use `py_modules` instead of `modules` to specify the source file. I don't know how this works on other distros but the docs [0] seem to clearly indicate py_modules does this. The second issue is quite an issue and requires story time. When pip/setuptools insteall editable installs (as is done for many of the openstack projects) it creates an easy-install.pth file that tells the python interpreter to add the source dirs of those repos to the python path. Normally these paths are appended to your sys.path. Pip's isolated build env relies on the assumption that these paths are appeneded to the path when it santizes sys.path to create the isolated environemnt. However, when SETUPTOOLS_SYS_PATH_TECHNIQUE is set to rewrite the paths are not appended and are inserted in the middle. This breaks pip's isolated build env which broke dbcounter installations. We fix this by not setting SETUPTOOLS_SYS_PATH_TECHNIQUE to rewrite. Upstream indicates the reason we set this half a decade ago has since been fixed properly. The reason Jammy and nothing else breaks is that python3.10 is the first python version to use pip's isolated build envs by default. I've locally fiddled with a patch to pip [1] to try and fix this behavior even when rewrite is set. I don't plan to push this upstream but it helps to illustrate where the problem lies. If someone else would like to upstream this feel free. Finally this change makes the jammy platform job voting again and adds it to the gate to ensure we don't regress again. [0] https://docs.python.org/3/distutils/sourcedist.html#specifying-the-files-to-distribute [1] https://paste.opendev.org/show/bqVAuhgMtVtfYupZK5J6/ Change-Id: I237f5663b0f8b060f6df130de04e17e2b1695f8a
1 parent 34c2842 commit 50e3c06

3 files changed

Lines changed: 2 additions & 3 deletions

File tree

.zuul.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,6 @@
731731
parent: tempest-full-py3
732732
description: Ubuntu 22.04 LTS (jammy) platform test
733733
nodeset: openstack-single-node-jammy
734-
voting: false
735734
timeout: 9000
736735
vars:
737736
configure_swap_size: 4096
@@ -950,6 +949,7 @@
950949
- devstack
951950
- devstack-ipv6
952951
- devstack-platform-centos-9-stream
952+
- devstack-platform-ubuntu-jammy
953953
- devstack-enforce-scope
954954
- devstack-multinode
955955
- devstack-unit-tests

inc/python

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,6 @@ function pip_install {
194194
https_proxy="${https_proxy:-}" \
195195
no_proxy="${no_proxy:-}" \
196196
PIP_FIND_LINKS=$PIP_FIND_LINKS \
197-
SETUPTOOLS_SYS_PATH_TECHNIQUE=rewrite \
198197
$cmd_pip $upgrade \
199198
$@
200199
result=$?

tools/dbcounter/setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ url = http://github.com/openstack/devstack
88
license = Apache
99

1010
[options]
11-
modules = dbcounter
11+
py_modules = dbcounter
1212
entry_points =
1313
[sqlalchemy.plugins]
1414
dbcounter = dbcounter:LogCursorEventsPlugin

0 commit comments

Comments
 (0)