Details
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
For Gerrit Dashboard: MB-39181 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
127949,2 | MB-39181: Update header generation to use python 3 | unstable | eventing | Status: MERGED | +2 | +1 |