[SERVER-7565] Automatically generate error_codes.h and error_codes.cpp from a list of codes Created: 06/Nov/12  Updated: 11/Jul/16  Resolved: 07/Nov/12

Status: Closed
Project: Core Server
Component/s: Build
Affects Version/s: 2.3.0
Fix Version/s: 2.3.1

Type: Improvement Priority: Major - P3
Reporter: Tad Marshall Assignee: Andy Schwerin
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

scons and Visual Studio builds


Issue Links:
Depends
Participants:

 Description   

The source files mongo/base/error_codes.h and mongo/base/error_codes.cpp need to be kept in sync as new error codes are added. This would be easier to do correctly if the files were automatically generated by the build system from a single list of error codes.

Both of the scons and Visual Studio builds should do this, producing identical output files.



 Comments   
Comment by Andy Schwerin [ 06/Jan/14 ]

acochenour, because this ticket was closed, please file a new ticket, and include the steps you took to reproduce them.

Comment by A Cochenour [ 05/Jan/14 ]

As of 2.5.4 this does not appear to be resolved to VS (2008/2010/2012), the following files are missing and require manual intervention for builds to succeed:

src/mongo/base/error_codes.h
src/mongo/base/error_codes.cpp
src/mongo/db/auth/action_type.h
src/mongo/db/auth/action_type.cpp

It doesn't reasonable to require python/scons and manual intervention for Windows builds.

Comment by auto [ 07/Nov/12 ]

Author:

{u'date': u'2012-11-07T13:03:55Z', u'name': u'Tad Marshall', u'email': u'tad@10gen.com'}

Message: SERVER-7565 SERVER-7126 SERVER-7576 Visual Studio require Python, run Python scripts

This commit makes the Visual Studio builds require Python to be installed.

Add Pre-Build Events to Visual Studio projects to run the same Python
scripts that the scons build runs to create src/mongo/base/error_codes.cpp,
src/mongo/base/error_codes.h, src/mongo/db/auth/action_type.h and
src/mongo/db/auth/action_type.cpp.
Branch: master
https://github.com/mongodb/mongo/commit/5a7456f2c726953fd7c433d96c76e9b0a1ba6105

Comment by auto [ 06/Nov/12 ]

Author:

{u'date': u'2012-11-06T11:39:34Z', u'email': u'tad@10gen.com', u'name': u'Tad Marshall'}

Message: SERVER-7565 Make line endings Unix-style on Windows
Branch: master
https://github.com/mongodb/mongo/commit/e29a1916f78408fde55596f3b769dd7adc623d93

Comment by auto [ 06/Nov/12 ]

Author:

{u'date': u'2012-11-06T11:33:55Z', u'email': u'tad@10gen.com', u'name': u'Tad Marshall'}

Message: SERVER-7565 Fix typos and style
Branch: master
https://github.com/mongodb/mongo/commit/661bee981c0b3898d911b76fb9fba1430e608ab2

Comment by Tad Marshall [ 06/Nov/12 ]

Commit by Andy Schwerin (schwerin@10gen.com):

Add an isOK method to Status, and methods to get an ErrorCodes::Error from a string or an int.

Branch: master
https://github.com/mongodb/mongo/commit/79c550530065678d1611567cf262a7b325c2db47

Comment by Tad Marshall [ 06/Nov/12 ]

Commit by Andy Schwerin (schwerin@10gen.com):

Auto-generate error_codes.

{h,cpp}

.

Branch: master
https://github.com/mongodb/mongo/commit/e79fc864820e67fb45f3abbe308ce6ab07043c03

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