From b8bb84091d1e5b5b586553bf79ec15e5d1fc61f4 Mon Sep 17 00:00:00 2001 From: Andy Schwerin Date: Thu, 23 Feb 2012 17:35:30 -0500 Subject: [PATCH] SERVER-5057 C++ Client Build Break Remove support for building a shared client library from the client source distribution, because it is broken. Fix the clientBuild "scons" alias, to correctly build and test the C++ driver as part of the nightly build. There were some type errors, before. --- distsrc/client/SConstruct | 8 ++------ src/mongo/SConscript | 14 ++++++++++---- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/distsrc/client/SConstruct b/distsrc/client/SConstruct index 4979c9244e6..503b71ccbc7 100755 --- a/distsrc/client/SConstruct +++ b/distsrc/client/SConstruct @@ -68,10 +68,7 @@ for x in dirs: allClientFiles += Glob( "mongo/" + x + "*.cpp" ) allClientFiles += Glob( "mongo/util/*.c" ) -libs = [] -libs += env.SharedLibrary( "mongoclient" , allClientFiles ) -sharedClientLibName = str(libs[-1]) -libs += env.Library( "mongoclient" , allClientFiles ) +libs = env.Library( "mongoclient" , allClientFiles ) # install @@ -86,12 +83,11 @@ for x in dirs: env.Alias( "install" , prefix ) - # example setup clientTests = [] clientEnv = env.Clone(); -clientEnv.Prepend( LIBS=["libmongoclient.a", sharedClientLibName]) +clientEnv.Prepend( LIBS=["mongoclient"] ) clientEnv.Prepend( LIBPATH=["."] ) # examples diff --git a/src/mongo/SConscript b/src/mongo/SConscript index 06a2546f8f7..c5a671a1845 100644 --- a/src/mongo/SConscript +++ b/src/mongo/SConscript @@ -151,6 +151,7 @@ coreServerFiles = [ "util/version.cpp", ] + env['MONGO_SCRIPTING_FILES'] clientFiles = commonFiles + [ + 'client/clientAndShell.cpp', 'client/clientOnly.cpp', 'client/gridfs.cpp', 'db/commands.cpp', @@ -540,7 +541,7 @@ env.Alias( "mongoclient", '#/%s' % ( has_option( "sharedclient" ) and sharedClie # client dist def build_and_test_client(env, target, source): - from subprocess import call + import subprocess installDir = env.subst('$INSTALL_DIR', target=target, source=source) installDir = env.GetBuildPath(installDir) @@ -549,9 +550,14 @@ def build_and_test_client(env, target, source): else: scons_command = ["scons"] - call(scons_command + ["libmongoclient.a", "clientTests"], cwd=installDir) + exit_code = subprocess.call(scons_command + ["clientTests"], cwd=installDir) + if exit_code: + return exit_code + + smoke_cmd = utils.smoke_command("--test-path", installDir, "client") + exit_code = subprocess.call(smoke_cmd) + if exit_code: + return exit_code - return bool(call(utils.smoke_command([ - "--test-path", installDir, "client"]))) env.Alias("clientBuild", [mongod, '$INSTALL_DIR'], [build_and_test_client]) env.AlwaysBuild("clientBuild")