Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-39181

Eventing build cannot depend on python 2

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Critical
    • 7.0.0
    • None
    • build, eventing
    • None
    • Untriaged
    • 1
    • Unknown
    • Build Team 2020 Sprint 9

    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

          Activity

            People

              ceej Chris Hillery
              ceej Chris Hillery
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty