Uploaded image for project: 'Couchbase Python Client Library'
  1. Couchbase Python Client Library
  2. PYCBC-1178

Unable to install 'couchbase' module due to '-Werror' flag

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 3.2.7
    • None
    • library
    • None
    • 1

    Description

      What's the issue?
      I'm currently unable to install the 'couchbase' Python module on my local machine, looking at the output, it appears to be failing due to a warning (which is being treated as an error due to the use of the '-Werror' flag in 'cbuild_config.py').

      GCC non-zero exit status

      [pipenv.exceptions.InstallError]:     src/iops.c: In function ‘update_event’:
      [pipenv.exceptions.InstallError]:     src/iops.c:412:17: error: array subscript ‘lcb_uint32_t {aka unsigned int}[0]’ is partly outside array bounds of ‘short int[1]’ [-Werror=array-bounds]
      [pipenv.exceptions.InstallError]:       412 |         usecs = *(lcb_uint32_t*)arg;
      [pipenv.exceptions.InstallError]:           |                 ^~~~~~~~~~~~~~~~~~~
      [pipenv.exceptions.InstallError]:     src/iops.c:516:69: note: while referencing ‘flags’
      [pipenv.exceptions.InstallError]:       516 | update_event(lcb_io_opt_t io, lcb_socket_t sock, void *event, short flags,
      [pipenv.exceptions.InstallError]:           |                                                               ~~~~~~^~~~~
      [pipenv.exceptions.InstallError]:     src/iops.c: In function ‘delete_event’:
      [pipenv.exceptions.InstallError]:     src/iops.c:412:17: error: array subscript ‘lcb_uint32_t {aka unsigned int}[0]’ is partly outside array bounds of ‘short int[1]’ [-Werror=array-bounds]
      [pipenv.exceptions.InstallError]:       412 |         usecs = *(lcb_uint32_t*)arg;
      [pipenv.exceptions.InstallError]:           |                 ^~~~~~~~~~~~~~~~~~~
      [pipenv.exceptions.InstallError]:     src/iops.c:548:11: note: while referencing ‘tmp’
      [pipenv.exceptions.InstallError]:       548 |     short tmp = 0;
      [pipenv.exceptions.InstallError]:           |           ^~~
      [pipenv.exceptions.InstallError]:     cc1: all warnings being treated as errors
      [pipenv.exceptions.InstallError]:     error: command '/usr/bin/gcc' failed with exit code 1
      

      I've confirmed that I can build the SDK using 'pip3 install --user .' in the SDK repository if I remove this compiler flag.

      I imagine this may be something to do with newer versions of GCC having improved/new warnings which weren't picked up by older releases (I've included the GCC version below)?

      GCC Version

      gcc (GCC) 11.1.0
      Copyright (C) 2021 Free Software Foundation, Inc.
      This is free software; see the source for copying conditions.  There is NO
      warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
      

      Attachments

        1. Dockerfile.arch
          0.2 kB
        2. logs.txt
          641 kB
        For Gerrit Dashboard: PYCBC-1178
        # Subject Branch Project Status CR V

        Activity

          People

            jared.casey Jared Casey
            james.lee James Lee
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty