From dfe5787c255eaab3d8022c972a1afa1dd83e62ef Mon Sep 17 00:00:00 2001 From: Noel Power Date: Sat, 24 Nov 2018 11:13:47 +0000 Subject: [PATCH] autobuild: Adjust autobuild for PY2/PY3 get_python_lib behaviour The resuls of get_python_lib are different between python2 & python3 and this results in autobuild generating the wrong PYTHONPATH with python3. python2 ======= print ("%s" % get_python_lib(standard_lib=1, prefix='/my/prefix')) /my/prefix/lib64/python2.7 python3 print ("%s" % get_python_lib(standard_lib=1, prefix='/my/prefix')) /my/prefix/lib/python3.6 But with addition of plat_specific param the results are the same python2 ======= print ("%s" % get_python_lib(plat_specific=1, standard_lib=0, prefix='/my/prefix')) /my/prefix/lib64/python2.7/site-packages python3 ======= print ("%s" % get_python_lib(plat_specific=1, standard_lib=0, prefix='/my/prefix')) /my/prefix/lib64/python3.6/site-packages Signed-off-by: Noel Power Reviewed-by: Andrew Bartlett --- script/autobuild.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/script/autobuild.py b/script/autobuild.py index f8a5e2e43141..5dd4d3a8df67 100755 --- a/script/autobuild.py +++ b/script/autobuild.py @@ -70,7 +70,7 @@ if os.environ.get("AUTOBUILD_SKIP_SAMBA_O3", "0") == "1": ctdb_configure_params = " --enable-developer --picky-developer ${PREFIX}" samba_configure_params = " --picky-developer ${PREFIX} ${EXTRA_PYTHON} --with-profiling-data" -samba_libs_envvars = "PYTHONPATH=${PYTHON_PREFIX}/site-packages:$PYTHONPATH" +samba_libs_envvars = "PYTHONPATH=${PYTHON_PREFIX}:$PYTHONPATH" samba_libs_envvars += " PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${PREFIX_DIR}/lib/pkgconfig" samba_libs_envvars += " ADDITIONAL_CFLAGS='-Wmissing-prototypes'" samba_libs_configure_base = samba_libs_envvars + " ./configure --abi-check --enable-debug --picky-developer -C ${PREFIX}" @@ -205,13 +205,13 @@ tasks = { "samba-ctdb": [("random-sleep", "script/random-sleep.sh 60 600", "text/plain"), # make sure we have tdb around: - ("tdb-configure", "cd lib/tdb && PYTHONPATH=${PYTHON_PREFIX}/site-packages:$PYTHONPATH PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${PREFIX_DIR}/lib/pkgconfig ./configure --bundled-libraries=NONE --abi-check --enable-debug -C ${PREFIX}", "text/plain"), + ("tdb-configure", "cd lib/tdb && PYTHONPATH=${PYTHON_PREFIX}:$PYTHONPATH PKG_CONFIG_PATH=$PKG_CONFIG_PATH:${PREFIX_DIR}/lib/pkgconfig ./configure --bundled-libraries=NONE --abi-check --enable-debug -C ${PREFIX}", "text/plain"), ("tdb-make", "cd lib/tdb && make", "text/plain"), ("tdb-install", "cd lib/tdb && make install", "text/plain"), # build samba with cluster support (also building ctdb): - ("samba-configure", "PYTHONPATH=${PYTHON_PREFIX}/site-packages:$PYTHONPATH PKG_CONFIG_PATH=${PREFIX_DIR}/lib/pkgconfig:${PKG_CONFIG_PATH} ./configure.developer --picky-developer ${PREFIX} --with-selftest-prefix=./bin/ab --with-cluster-support --bundled-libraries=!tdb", "text/plain"), + ("samba-configure", "PYTHONPATH=${PYTHON_PREFIX}:$PYTHONPATH PKG_CONFIG_PATH=${PREFIX_DIR}/lib/pkgconfig:${PKG_CONFIG_PATH} ./configure.developer --picky-developer ${PREFIX} --with-selftest-prefix=./bin/ab --with-cluster-support --bundled-libraries=!tdb", "text/plain"), ("samba-make", "make", "text/plain"), ("samba-check", "./bin/smbd -b | grep CLUSTER_SUPPORT", "text/plain"), ("samba-install", "make install", "text/plain"), @@ -476,7 +476,7 @@ class builder(object): self.done = True return (self.stage, self.cmd, self.output_mime_type) = self.sequence[self.next] - self.cmd = self.cmd.replace("${PYTHON_PREFIX}", get_python_lib(standard_lib=1, prefix=self.prefix)) + self.cmd = self.cmd.replace("${PYTHON_PREFIX}", get_python_lib(plat_specific=1, standard_lib=0, prefix=self.prefix)) self.cmd = self.cmd.replace("${PREFIX}", "--prefix=%s" % self.prefix) if self.py3: self.cmd = self.cmd.replace("${EXTRA_PYTHON}", "%s" % extra_python) -- 2.34.1