Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-15469

bare assert causes errorcodes.py to fail instead of printing an message

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.7.8
    • Affects Version/s: None
    • Component/s: Build
    • Labels:
      None
    • Fully Compatible
    • ALL
    • Hide

      Add a bare "assert(1);" to a .cpp file. Run scons.

      Show
      Add a bare "assert(1);" to a .cpp file. Run scons.

      A type error in errorcodes.py causes it to fail instead of printing a message.
      The attached patch fixes this and outputs the message in a format that is similar to compilation errors, so IDEs will allow easy fixing.

      TypeError: %d format: a number is required, not str:
      File "/Users/bosch/mongo/SConstruct", line 1953:
      checkErrorCodes()
      File "/Users/bosch/mongo/SConstruct", line 1949:
      if x.checkErrorCodes() == False:
      File "/Users/bosch/mongo/buildscripts/errorcodes.py", line 127:
      (codes, errors) = readErrorCodes()
      File "/Users/bosch/mongo/buildscripts/errorcodes.py", line 155:
      parseSourceFiles( checkDups )
      File "/Users/bosch/mongo/buildscripts/errorcodes.py", line 75:
      print( "%s\n%d" % (sourceFile, line) )
      Command /Users/bosch/bin/buildx failed with exit code 2

            Assignee:
            geert.bosch@mongodb.com Geert Bosch
            Reporter:
            geert.bosch@mongodb.com Geert Bosch
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: