[Updated] D9752: fuzz: try and ensure fuzzer tests run against the right python-config

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Thu Jan 14 13:58:13 UTC 2021


Closed by commit rHG11735eaa5644: fuzz: try and ensure fuzzer tests run against the right python-config (authored by durin42).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D9752?vs=24822&id=24856

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D9752/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D9752

AFFECTED FILES
  tests/test-fuzz-targets.t

CHANGE DETAILS

diff --git a/tests/test-fuzz-targets.t b/tests/test-fuzz-targets.t
--- a/tests/test-fuzz-targets.t
+++ b/tests/test-fuzz-targets.t
@@ -1,4 +1,4 @@
-#require test-repo
+#require test-repo py3
 
   $ cd $TESTDIR/../contrib/fuzz
   $ OUT=$TESTTMP ; export OUT
@@ -26,13 +26,23 @@
   >        -fsanitize=fuzzer-no-link,address || return 1
   > }
 
+Try to find a python3-config that's next to our sys.executable. If
+that doesn't work, fall back to looking for a global python3-config
+and hope that works out for the best.
+  $ PYBIN=`$PYTHON -c 'import sys, os; print(os.path.dirname(sys.executable))'`
+  $ if [ -x "$PYBIN/python3-config" ] ; then
+  >   PYTHON_CONFIG="$PYBIN/python3-config"
+  > else
+  >   PYTHON_CONFIG="`which python3-config`"
+  > fi
+
 #if clang-libfuzzer
   $ CXX=clang++ havefuzz || exit 80
-  $ $MAKE -s clean all PYTHON_CONFIG=`which python-config`
+  $ $MAKE -s clean all PYTHON_CONFIG="$PYTHON_CONFIG"
 #endif
 #if no-clang-libfuzzer clang-6.0
   $ CXX=clang++-6.0 havefuzz || exit 80
-  $ $MAKE -s clean all CC=clang-6.0 CXX=clang++-6.0 PYTHON_CONFIG=`which python-config`
+  $ $MAKE -s clean all CC=clang-6.0 CXX=clang++-6.0 PYTHON_CONFIG="$PYTHON_CONFIG"
 #endif
 #if no-clang-libfuzzer no-clang-6.0
   $ exit 80



To: durin42, #hg-reviewers, pulkit
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20210114/c4ed7fde/attachment-0002.html>


More information about the Mercurial-patches mailing list