Details
-
Bug
-
Resolution: Fixed
-
Critical
-
None
-
Untriaged
-
1
-
Unknown
-
Build Team 2021 Sprint 01
Description
The file eventing/gen/CMakeLists.txt directly invokes "python" to run the script third_party/inspector/compress_json.py. This is bad since python isn't actually a build prerequisite for Server, but it's worse because the script is python 2 and doesn't appear to work correctly in python 3:
[ 97%] Coverting ../audit/audit_descriptor.json to auditevent/events.go |
Traceback (most recent call last):
|
File "../third_party/inspector/compress_json.py", line 12, in <module> |
data = zlib.compress(text, zlib.Z_BEST_COMPRESSION)
|
TypeError: a bytes-like object is required, not 'str' |
Python 2 is now EOL and not all build slaves will have it available going forward. In particular it is not on the Ubuntu 20.04 buildslave.
This compress_json.py script needs to be updated to python 3, which in this case will involve properly handling byte arrays. The CMakeLists.txt can then be updated to use ${PYTHON_EXE} rather than bare "python" to invoke it (which will be the build-provided python3 executable use for couchbase-cli and other tools).
Attachments
Issue Links
- is a backport of
-
MB-39181 Eventing build cannot depend on python 2
- Closed
For Gerrit Dashboard: MB-43666 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
143500,3 | MB-43666: Update header generation to use python 3 | mad-hatter | eventing | Status: MERGED | +2 | +1 |
176836,3 | MB-43666: Update header generation to use python 3 | 6.5.2 | eventing | Status: MERGED | +2 | +1 |