[SERVER-30166] Use of string instead of std::string in some source files prevents compilation Created: 17/Jul/17  Updated: 30/Oct/23  Resolved: 22/Aug/17

Status: Closed
Project: Core Server
Component/s: Build
Affects Version/s: None
Fix Version/s: 3.2.18, 3.4.10, 3.5.13

Type: Bug Priority: Major - P3
Reporter: Steven Green Assignee: Mark Benvenuto
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
is depended on by SERVER-29287 Upgrade pcre to 8.41 Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v3.4, v3.2, v3.0
Steps To Reproduce:

python2 buildscripts/scons.py -j4 --use-system-pcre --disable-warnings-as-errors core tools

(With libpcre-8.41 installed)

Sprint: Platforms 2017-08-21, Platforms 2017-09-11
Participants:

 Description   

If you build with --use-system-pcre with version 8.41 of pcre MongoDB fails to build because string is undefined. Replacing string with std::string in those files allows it to build again.
This applies to:
src/mongo/db/matcher/expression_leaf.cpp
src/mongo/db/repl/master_slave.cpp
src/mongo/shell/bench.cpp

This is preventing it building on gentoo linux.



 Comments   
Comment by Githook User [ 19/Oct/17 ]

Author:

{'email': 'mark.benvenuto@mongodb.com', 'name': 'Mark Benvenuto', 'username': 'markbenvenuto'}

Message: SERVER-30166 Fix Lint
Branch: v3.0
https://github.com/mongodb/mongo/commit/0941b8e2ec1ef7ddbf2bd07eb50fab67658d7617

Comment by Githook User [ 16/Oct/17 ]

Author:

{'email': 'steven@greenius.co.uk', 'name': 'Steven Green'}

Message: SERVER-30166 Replace string with explicit std::string. Enables compulation when using --use-system-pcre which presusably used to do 'using std::string' in an earlier version of pcre

Closes #1167

Signed-off-by: Mark Benvenuto <mark.benvenuto@mongodb.com>
(cherry picked from commit b7cebf82bc5e5572308cc3a3fb958a825db91498)
Branch: v3.0
https://github.com/mongodb/mongo/commit/b70b91f98c479d8f2abb3eb1c2805cc72962e464

Comment by Githook User [ 02/Oct/17 ]

Author:

{'email': 'steven@greenius.co.uk', 'name': 'Steven Green'}

Message: SERVER-30166 Replace string with explicit std::string. Enables compulation when using --use-system-pcre which presusably used to do 'using std::string' in an earlier version of pcre

Closes #1167

Signed-off-by: Mark Benvenuto <mark.benvenuto@mongodb.com>
(cherry picked from commit b7cebf82bc5e5572308cc3a3fb958a825db91498)
Branch: v3.4
https://github.com/mongodb/mongo/commit/218a7b1d4ea3d3b04a5f6f54c66640b3a15586b0

Comment by Githook User [ 02/Oct/17 ]

Author:

{'email': 'steven@greenius.co.uk', 'name': 'Steven Green'}

Message: SERVER-30166 Replace string with explicit std::string. Enables compulation when using --use-system-pcre which presusably used to do 'using std::string' in an earlier version of pcre

Closes #1167

Signed-off-by: Mark Benvenuto <mark.benvenuto@mongodb.com>
(cherry picked from commit b7cebf82bc5e5572308cc3a3fb958a825db91498)
Branch: v3.2
https://github.com/mongodb/mongo/commit/18f4c63869a32426bd33235a8cf51f06809a1b6b

Comment by Andrew Morrow (Inactive) [ 22/Sep/17 ]

Hi hydrapolic - The ticket is marked for backport so unless something changes or there are problems doing so, this issue will eventually be backported to 3.4 and most likely 3.2.

Comment by hydrapolic [ 22/Sep/17 ]

Can you please backport to 3.2/3.4?

Comment by Ramon Fernandez Marina [ 15/Sep/17 ]

Author:

{'username': u'sgolemon', 'name': u'Sara Golemon', 'email': u'sara.golemon@mongodb.com'}

Message:SERVER-30166 Support pipelines running on mongos only
Branch:master
https://github.com/mongodb/mongo/commit/7b7de197a787073ecf47f89d1f9976758f24390a

Comment by Mark Benvenuto [ 22/Aug/17 ]

Backports are needed for this issue because SERVER-29287 depends on this ticket, and SERVER-29287 is required for backports.

Comment by Githook User [ 22/Aug/17 ]

Author:

{'email': 'steven@greenius.co.uk', 'name': 'Steven Green'}

Message: SERVER-30166 Replace string with explicit std::string. Enables compulation when using --use-system-pcre which presusably used to do 'using std::string' in an earlier version of pcre

Closes #1167

Signed-off-by: Mark Benvenuto <mark.benvenuto@mongodb.com>
Branch: master
https://github.com/mongodb/mongo/commit/b7cebf82bc5e5572308cc3a3fb958a825db91498

Comment by Steven Green [ 17/Jul/17 ]

I have made two pull requests that replace string with std::string where needed so that it will compile. One against master (#1167) and the other against the 3.4 branch (#1166)

Two files (src/mongo/util/net/miniwebserver.cpp and src/mongo/db/dbwebserver.cpp) I just added a using std::string near the top of the cpp file as there were already some other using std:: directives there. The other 3 files I replaced string with std::string which looks like it is the preferred style rather than adding a using directive.

Comment by Steven Green [ 17/Jul/17 ]

This is the patch to libpcre that caused this problem to show itself... https://bugs.exim.org/show_bug.cgi?id=2084

Several using std directives (including "using std::string") were declared in global namespace in header file <pcre_stringpiece.h> which was included from <pcrecpp.h>. They have been moved into the pcrecpp namespace so as not to pollute the global namespace.

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