[SERVER-15469] bare assert causes errorcodes.py to fail instead of printing an message Created: 30/Sep/14  Updated: 01/Oct/14  Resolved: 01/Oct/14

Status: Closed
Project: Core Server
Component/s: Build
Affects Version/s: None
Fix Version/s: 2.7.8

Type: Bug Priority: Minor - P4
Reporter: Geert Bosch Assignee: Geert Bosch
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File errorcodes-patch.txt    
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

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

Participants:

 Description   

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



 Comments   
Comment by Githook User [ 01/Oct/14 ]

Author:

{u'username': u'GeertBosch', u'name': u'Geert Bosch', u'email': u'geert@mongodb.com'}

Message: SERVER-15469: Fix errorcodes.py error message for bare assert
Branch: master
https://github.com/mongodb/mongo/commit/d41c5f3514e41310545dc7ff1cd2d056248f5f75

Generated at Thu Feb 08 03:38:07 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.