summaryrefslogtreecommitdiff
path: root/src/third_party/wiredtiger/bench/workgen
diff options
context:
space:
mode:
authorLuke Chen <luke.chen@mongodb.com>2022-02-02 15:00:17 +1100
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-02-02 04:51:20 +0000
commit5fea92ae32c7265a957ed760946f75b7c75c0e2e (patch)
treed6fbf3ea747337e0148dca2c1e64f13654a39e5e /src/third_party/wiredtiger/bench/workgen
parent5f19771466dff7642eacbc2dfe4d4bfb1074b8a4 (diff)
downloadmongo-5fea92ae32c7265a957ed760946f75b7c75c0e2e.tar.gz
Import wiredtiger: 0d65fabfca1e3435e8f8298a98d4fc91c56e331c from branch mongodb-master
ref: 9e92b73891..0d65fabfca for: 5.3.0 WT-7598 Remove autoconf & scons build systems
Diffstat (limited to 'src/third_party/wiredtiger/bench/workgen')
-rw-r--r--src/third_party/wiredtiger/bench/workgen/Makefile.am32
-rwxr-xr-xsrc/third_party/wiredtiger/bench/workgen/runner/runner/__init__.py20
-rwxr-xr-xsrc/third_party/wiredtiger/bench/workgen/runner/runner/core.py14
3 files changed, 22 insertions, 44 deletions
diff --git a/src/third_party/wiredtiger/bench/workgen/Makefile.am b/src/third_party/wiredtiger/bench/workgen/Makefile.am
deleted file mode 100644
index a40967002c1..00000000000
--- a/src/third_party/wiredtiger/bench/workgen/Makefile.am
+++ /dev/null
@@ -1,32 +0,0 @@
-# FIX-ME-WT-8263: Remove the next line to keep the flags defined in configure.ac.in
-AM_CXXFLAGS =
-AM_CPPFLAGS = -I$(top_builddir)
-AM_CPPFLAGS +=-I$(top_srcdir)/src/include
-AM_CPPFLAGS +=-I$(top_srcdir)/test/utility
-
-PYSRC = $(top_srcdir)/bench/workgen
-PYDIRS = -t $(abs_builddir) -I $(abs_top_srcdir):$(abs_top_builddir) -L $(abs_top_builddir)/.libs:$(abs_top_builddir)/bench/workgen/.libs
-all-local: _workgen.so libworkgen.la
-libworkgen_la_SOURCES = workgen.cxx workgen_func.c
-noinst_LTLIBRARIES = libworkgen.la
-
-# We keep generated Python sources under bench/workgen.
-$(PYSRC)/workgen_wrap.cxx: $(PYSRC)/workgen.h $(PYSRC)/workgen.i
- (cd $(PYSRC) && \
- $(SWIG) -c++ -python -threads -O -Wall -I$(abs_top_builddir) -outdir ./workgen workgen.i)
-
-_workgen.so: $(top_builddir)/libwiredtiger.la $(PYSRC)/workgen_wrap.cxx libworkgen.la $(PYSRC)/workgen.h $(PYSRC)/workgen_time.h
- (cd $(PYSRC) && \
- $(PYTHON) setup.py build_ext -f -b $(abs_builddir) $(PYDIRS))
-
-install-exec-local:
- (cd $(PYSRC) && \
- $(PYTHON) setup.py build_py -d $(abs_builddir)/build && \
- $(PYTHON) setup.py build_ext -f -b $(abs_builddir)/build $(PYDIRS) && \
- $(PYTHON) setup.py install_lib -b $(abs_builddir)/build --skip-build $(PYTHON_INSTALL_ARG))
-
-# We build in different places for an install vs running from the tree:
-# clean up both. Don't rely on "setup.py clean" -- everything that should
-# be removed is created under the build directory.
-clean-local:
- rm -rf build _workgen.so workgen_wrap.o WT_TEST
diff --git a/src/third_party/wiredtiger/bench/workgen/runner/runner/__init__.py b/src/third_party/wiredtiger/bench/workgen/runner/runner/__init__.py
index be3d4b565e5..d758d953af4 100755
--- a/src/third_party/wiredtiger/bench/workgen/runner/runner/__init__.py
+++ b/src/third_party/wiredtiger/bench/workgen/runner/runner/__init__.py
@@ -34,11 +34,19 @@ import os, sys
thisdir = os.path.dirname(os.path.abspath(__file__))
workgen_src = os.path.dirname(os.path.dirname(thisdir))
wt_dir = os.path.dirname(os.path.dirname(workgen_src))
+curdir = os.getcwd()
env_builddir = os.getenv('WT_BUILDDIR')
if env_builddir:
wt_builddir = env_builddir
+elif os.path.isfile(os.path.join(curdir, 'wt')):
+ wt_builddir = curdir
else:
- wt_builddir = os.path.join(wt_dir, 'build_posix')
+ # Print a warning that we can't find a useable WiredTiger build. We will
+ # proceed however in the chance the Python paths are set up correctly.
+ print('Warning: Unable to identify WiredTiger build. Please consider either:\n'
+ '- Setting \'WT_BUILDDIR\' environment variable to specify the build directory.\n'
+ '- Calling workgen from the root of the build directory.')
+ wt_builddir = ''
def _prepend_env_path(pathvar, s):
last = ''
@@ -60,15 +68,15 @@ except:
try:
import wiredtiger
except:
- # If the .libs directory is not in our library search path,
+ # If the WiredTiger libraries is not in our library search path,
# we need to set it and retry. However, the dynamic link
# library has already cached its value, our only option is
# to restart the Python interpreter.
if '_workgen_init' not in os.environ:
os.environ['_workgen_init'] = 'true'
- dotlibs = os.path.join(wt_builddir, '.libs')
- _prepend_env_path('LD_LIBRARY_PATH', dotlibs)
- _prepend_env_path('DYLD_LIBRARY_PATH', dotlibs)
+ libsdir = os.path.join(wt_builddir)
+ _prepend_env_path('LD_LIBRARY_PATH', libsdir)
+ _prepend_env_path('DYLD_LIBRARY_PATH', libsdir)
py_args = sys.argv
py_args.insert(0, sys.executable)
try:
@@ -76,7 +84,7 @@ except:
except Exception as exception:
print('re-exec failed: ' + str(exception), file=sys.stderr)
print(' exec(' + sys.executable + ', ' + str(py_args) + ')')
- print('Try adding "' + dotlibs + '" to the', file=sys.stderr)
+ print('Try adding "' + libsdir + '" to the', file=sys.stderr)
print('LD_LIBRARY_PATH environment variable before running ' + \
'this program again.', file=sys.stderr)
sys.exit(1)
diff --git a/src/third_party/wiredtiger/bench/workgen/runner/runner/core.py b/src/third_party/wiredtiger/bench/workgen/runner/runner/core.py
index 3851634199d..a7907e90f81 100755
--- a/src/third_party/wiredtiger/bench/workgen/runner/runner/core.py
+++ b/src/third_party/wiredtiger/bench/workgen/runner/runner/core.py
@@ -57,11 +57,15 @@ def timed(seconds, op):
result._timed = seconds
return result
-# Check for a local build that contains the wt utility. First check in
-# current working directory, then in build_posix and finally in the disttop
-# directory. This isn't ideal - if a user has multiple builds in a tree we
-# could pick the wrong one.
+# Check for a local build that contains the wt utility. First check for a
+# user supplied 'WT_BUILDDIR' environment variable, then the current working
+# directory, then finally in in the disttop directory. This isn't
+# ideal - if a user has multiple builds in a tree we could pick the wrong one.
def _wiredtiger_builddir():
+ env_builddir = os.getenv('WT_BUILDDIR')
+ if env_builddir and os.path.isfile(os.path.join(env_builddir, 'wt')):
+ return env_builddir
+
if os.path.isfile(os.path.join(os.getcwd(), 'wt')):
return os.getcwd()
@@ -71,8 +75,6 @@ def _wiredtiger_builddir():
thisdir, os.pardir, os.pardir, os.pardir, os.pardir)
if os.path.isfile(os.path.join(wt_disttop, 'wt')):
return wt_disttop
- if os.path.isfile(os.path.join(wt_disttop, 'build_posix', 'wt')):
- return os.path.join(wt_disttop, 'build_posix')
if os.path.isfile(os.path.join(wt_disttop, 'wt.exe')):
return wt_disttop
raise Exception('Unable to find useable WiredTiger build')