From 8a9ac1f610d3ac647c7c47e92fb836a025ba6cbc Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Sun, 20 Sep 2020 07:30:11 -0400 Subject: [PATCH 01/28] .github: create test workflow --- .github/workflows/test.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..449343d3 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,36 @@ +# This is a basic workflow to help you get started with Actions + +name: CI + +# Controls when the action will run. Triggers the workflow on push or pull request +# events but only for the master branch +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "build" + build: + # The type of runner that the job will run on + runs-on: ubuntu-latest + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + # Runs a single command using the runners shell + - name: Run a one-line script + run: echo Hello, world! + + # Runs a set of commands using the runners shell + - name: Run a multi-line script + run: | + pwd=$(pwd -P) + mkdir build + cd build + make -f $pwd/Makefile srcdir=$pwd/ + From 60ed103733e0bd08c88fc30c6bab9e58cac2c240 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Sun, 20 Sep 2020 07:49:59 -0400 Subject: [PATCH 02/28] .github/workflows/test.yml: matrix experiment --- .github/workflows/test.yml | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 449343d3..9ae3ae79 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,21 +16,28 @@ jobs: build: # The type of runner that the job will run on runs-on: ubuntu-latest + name: Python ${{ matrix.python }} and GCC ${{ matrix.gcc }} + matrix: + #python [2, 3] + python [3] + #gcc [4.8, 4.9, 5, 6, 7, 8, 9, 10] + gcc [8, 9] # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v2 - # Runs a single command using the runners shell - - name: Run a one-line script - run: echo Hello, world! + - name: Set up Python ${{ matrix.python }} + # TODO - # Runs a set of commands using the runners shell - - name: Run a multi-line script + - name: Set up GCC ${{ matrix.gcc }} + run: sudo apt-get install g++-${{matrix.gcc}} gcc-${{matrix.gcc}}-plugin-dev + # TODO + + - name: Build plugin and run the testsuite run: | pwd=$(pwd -P) mkdir build cd build make -f $pwd/Makefile srcdir=$pwd/ - From 3b4a209ff049da7ae4e31f46f79287fed8f74d86 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Sun, 20 Sep 2020 07:54:11 -0400 Subject: [PATCH 03/28] .github/workflows/test.yml: fix yaml --- .github/workflows/test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9ae3ae79..ae3c9011 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,10 +18,10 @@ jobs: runs-on: ubuntu-latest name: Python ${{ matrix.python }} and GCC ${{ matrix.gcc }} matrix: - #python [2, 3] - python [3] - #gcc [4.8, 4.9, 5, 6, 7, 8, 9, 10] - gcc [8, 9] + # TODO: python: [2, 3]; other versions? + python: [3] + # TODO: gcc: [4.8, 4.9, 5, 6, 7, 8, 9, 10] + gcc: [8, 9] # Steps represent a sequence of tasks that will be executed as part of the job steps: From 9273ee6fbee9656e237a5baf8990df1972113405 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Sun, 20 Sep 2020 07:57:07 -0400 Subject: [PATCH 04/28] .github/workflows/test.yml: fix missing 'run' key --- .github/workflows/test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ae3c9011..1ba0aa7e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,6 +29,7 @@ jobs: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python }} + run: sudo apt-get install python-dev # TODO - name: Set up GCC ${{ matrix.gcc }} From bec1989faf0b8886d80f6bffe1e80e53e2234fea Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Sun, 20 Sep 2020 08:00:10 -0400 Subject: [PATCH 05/28] .github/workflows/test.yml: puth 'matrix' inside a 'strategy' --- .github/workflows/test.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1ba0aa7e..0c031c07 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,11 +17,12 @@ jobs: # The type of runner that the job will run on runs-on: ubuntu-latest name: Python ${{ matrix.python }} and GCC ${{ matrix.gcc }} - matrix: - # TODO: python: [2, 3]; other versions? - python: [3] - # TODO: gcc: [4.8, 4.9, 5, 6, 7, 8, 9, 10] - gcc: [8, 9] + strategy: + matrix: + # TODO: python: [2, 3]; other versions? + python: [3] + # TODO: gcc: [4.8, 4.9, 5, 6, 7, 8, 9, 10] + gcc: [8, 9] # Steps represent a sequence of tasks that will be executed as part of the job steps: From f0e9354893be7b7523d565606e82497a7f0780a1 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Sun, 20 Sep 2020 08:05:48 -0400 Subject: [PATCH 06/28] .github/workflows/test.yml: set CC and CXX --- .github/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0c031c07..6f96d80f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -39,6 +39,8 @@ jobs: - name: Build plugin and run the testsuite run: | + export CC=gcc-${{matrix.gcc}} + export CXX=g++-${{matrix.gcc}} pwd=$(pwd -P) mkdir build cd build From 80452425eb4aacf6dcb9927e2e04ebbdece40bcb Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Sun, 20 Sep 2020 08:12:38 -0400 Subject: [PATCH 07/28] .github/workflows/test.yml: more GCC versions --- .github/workflows/test.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6f96d80f..ad6e1766 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,8 +21,7 @@ jobs: matrix: # TODO: python: [2, 3]; other versions? python: [3] - # TODO: gcc: [4.8, 4.9, 5, 6, 7, 8, 9, 10] - gcc: [8, 9] + gcc: [4.8, 4.9, 5, 6, 7, 8, 9, 10] # Steps represent a sequence of tasks that will be executed as part of the job steps: @@ -31,11 +30,10 @@ jobs: - name: Set up Python ${{ matrix.python }} run: sudo apt-get install python-dev - # TODO + # TODO: this seems to be Python 2.7 - name: Set up GCC ${{ matrix.gcc }} run: sudo apt-get install g++-${{matrix.gcc}} gcc-${{matrix.gcc}}-plugin-dev - # TODO - name: Build plugin and run the testsuite run: | From 5812d88a11dff823897559b5e867063bd18b9924 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Sun, 20 Sep 2020 08:22:39 -0400 Subject: [PATCH 08/28] .github/workflows/test.yml: drop 4.8 and 4.9 for now; try to use different python versions --- .github/workflows/test.yml | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ad6e1766..89d16c0b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,12 +16,11 @@ jobs: build: # The type of runner that the job will run on runs-on: ubuntu-latest - name: Python ${{ matrix.python }} and GCC ${{ matrix.gcc }} + name: Python ${{ matrix.python-version }} and GCC ${{ matrix.gcc-version }} strategy: matrix: - # TODO: python: [2, 3]; other versions? - python: [3] - gcc: [4.8, 4.9, 5, 6, 7, 8, 9, 10] + python-version: [2.7, 3.5, 3.6, 3.7, 3.8] + gcc-version: [5, 6, 7, 8, 9, 10] # Steps represent a sequence of tasks that will be executed as part of the job steps: @@ -29,16 +28,23 @@ jobs: - uses: actions/checkout@v2 - name: Set up Python ${{ matrix.python }} - run: sudo apt-get install python-dev - # TODO: this seems to be Python 2.7 + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} - - name: Set up GCC ${{ matrix.gcc }} - run: sudo apt-get install g++-${{matrix.gcc}} gcc-${{matrix.gcc}}-plugin-dev + - name: Display Python version + run: python -c "import sys; print(sys.version)" + + - name: Set up GCC ${{ matrix.gcc-version }} + run: sudo apt-get install g++-${{matrix.gcc-version}} gcc-${{matrix.gcc-version}}-plugin-dev + + - name: Display GCC version + run: gcc-${{matrix.gcc-version}} --version - name: Build plugin and run the testsuite run: | - export CC=gcc-${{matrix.gcc}} - export CXX=g++-${{matrix.gcc}} + export CC=gcc-${{matrix.gcc-version}} + export CXX=g++-${{matrix.gcc-version}} pwd=$(pwd -P) mkdir build cd build From 3ac280a3e532ea5e6c397f75468274b5d1c82f32 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Sun, 20 Sep 2020 08:24:32 -0400 Subject: [PATCH 09/28] .github/workflows/test.yml: fix yaml --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 89d16c0b..a8a5ed6e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,13 +33,13 @@ jobs: python-version: ${{ matrix.python-version }} - name: Display Python version - run: python -c "import sys; print(sys.version)" + run: python -c "import sys; print(sys.version)" - name: Set up GCC ${{ matrix.gcc-version }} run: sudo apt-get install g++-${{matrix.gcc-version}} gcc-${{matrix.gcc-version}}-plugin-dev - name: Display GCC version - run: gcc-${{matrix.gcc-version}} --version + run: gcc-${{matrix.gcc-version}} --version - name: Build plugin and run the testsuite run: | From 22de1ae24cc8caab428693b8009ea2920d414cb1 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Sun, 20 Sep 2020 08:27:55 -0400 Subject: [PATCH 10/28] .github/workflows/test.yml: do gcc first; try to install python deps --- .github/workflows/test.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a8a5ed6e..face4e96 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,6 +27,12 @@ jobs: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v2 + - name: Set up GCC ${{ matrix.gcc-version }} + run: sudo apt-get install g++-${{matrix.gcc-version}} gcc-${{matrix.gcc-version}}-plugin-dev + + - name: Display GCC version + run: gcc-${{matrix.gcc-version}} --version + - name: Set up Python ${{ matrix.python }} uses: actions/setup-python@v2 with: @@ -35,11 +41,8 @@ jobs: - name: Display Python version run: python -c "import sys; print(sys.version)" - - name: Set up GCC ${{ matrix.gcc-version }} - run: sudo apt-get install g++-${{matrix.gcc-version}} gcc-${{matrix.gcc-version}}-plugin-dev - - - name: Display GCC version - run: gcc-${{matrix.gcc-version}} --version + - name: Install Python dependencies + run: python -m pip install --upgrade six pygments lxml - name: Build plugin and run the testsuite run: | From 234b63dba8d9f05df519ae5bdf8c040450da41e2 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Sun, 20 Sep 2020 08:36:49 -0400 Subject: [PATCH 11/28] .github/workflows/test.yml: test python-config --- .github/workflows/test.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index face4e96..0f281f29 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,13 +33,16 @@ jobs: - name: Display GCC version run: gcc-${{matrix.gcc-version}} --version + # https://docs.github.com/en/actions/guides/building-and-testing-python - name: Set up Python ${{ matrix.python }} uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - name: Display Python version - run: python -c "import sys; print(sys.version)" + run: | + python -c "import sys; print(sys.version)" + python-config --cflags - name: Install Python dependencies run: python -m pip install --upgrade six pygments lxml From 72d69980186f674f649c2ae2e0899287f49e75a8 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Sun, 20 Sep 2020 08:41:54 -0400 Subject: [PATCH 12/28] run-test-suite.py: don't assume python headers are in /usr/include/ --- run-test-suite.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/run-test-suite.py b/run-test-suite.py index f907b2e1..99e30318 100644 --- a/run-test-suite.py +++ b/run-test-suite.py @@ -137,10 +137,11 @@ def _cleanup(self, text): # e.g. # unknown struct PyObject * from /usr/include/python2.7/pyerrors.h:135 # unknown struct PyObject * from /usr/include/python3.2mu/pyerrors.h:132 - # should both become: + # unknown struct PyObject * from /opt/hostedtoolcache/Python/2.7.18/x64/include/python2.7/pyerrors.h:141 + # should all become: # unknown struct PyObject * from /usr/include/python?.?/pyerrors.h:nn - line = re.sub('/usr/include/python(.*)/(.*).h:[0-9]+', - r'/usr/include/python?.?/\2.h:nn', + line = re.sub('(.*)/include/python(.*)/(.*).h:[0-9]+', + r'/usr/include/python?.?/\3.h:nn', line) # Convert to the Python 3 format for the repr() of a frozenset: From f3e638e1d4620ea2ae23429cf26dacf9bfdf1009 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Sun, 20 Sep 2020 08:46:29 -0400 Subject: [PATCH 13/28] run-test-suite.py: fixup to don't assume python headers are in /usr/include/ --- run-test-suite.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run-test-suite.py b/run-test-suite.py index 99e30318..9a92bd19 100644 --- a/run-test-suite.py +++ b/run-test-suite.py @@ -140,7 +140,7 @@ def _cleanup(self, text): # unknown struct PyObject * from /opt/hostedtoolcache/Python/2.7.18/x64/include/python2.7/pyerrors.h:141 # should all become: # unknown struct PyObject * from /usr/include/python?.?/pyerrors.h:nn - line = re.sub('(.*)/include/python(.*)/(.*).h:[0-9]+', + line = re.sub('/(\S+)/include/python(.*)/(.*).h:[0-9]+', r'/usr/include/python?.?/\3.h:nn', line) From 0062d0e8748ea22891e59fb2e12a16718773c12e Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Sun, 20 Sep 2020 09:03:28 -0400 Subject: [PATCH 14/28] .github/workflows/test.yml: try to set PYTHON_CONFIG for python 3 --- .github/workflows/test.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0f281f29..f750df63 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -43,6 +43,7 @@ jobs: run: | python -c "import sys; print(sys.version)" python-config --cflags + python3-config --cflags - name: Install Python dependencies run: python -m pip install --upgrade six pygments lxml @@ -51,6 +52,10 @@ jobs: run: | export CC=gcc-${{matrix.gcc-version}} export CXX=g++-${{matrix.gcc-version}} + if [ $(python -c"import sys; print(sys.version_info.major)") = "3" ] + then + export PYTHON_CONFIG=python3-config + fi pwd=$(pwd -P) mkdir build cd build From a9543358eb297d2f6c4f17a4ec28b0060113d654 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Sun, 20 Sep 2020 09:15:47 -0400 Subject: [PATCH 15/28] .github/workflows/test.yml: pass any PYTHON_CONFIG for python 3 to Makefile --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f750df63..fc09067c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -59,4 +59,4 @@ jobs: pwd=$(pwd -P) mkdir build cd build - make -f $pwd/Makefile srcdir=$pwd/ + make -f $pwd/Makefile srcdir=$pwd/ PYTHON_CONFIG=$PYTHON_CONFIG From 7c3451512e7d453a82716ec0a26927eabb7d91c8 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Sun, 20 Sep 2020 09:18:29 -0400 Subject: [PATCH 16/28] .github/workflows/test.yml: set default PYTHON_CONFIG --- .github/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fc09067c..f71441ed 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -55,6 +55,8 @@ jobs: if [ $(python -c"import sys; print(sys.version_info.major)") = "3" ] then export PYTHON_CONFIG=python3-config + else + export PYTHON_CONFIG=python-config fi pwd=$(pwd -P) mkdir build From 3d5690a59f6e2f92f99a9f5ca2426352a42d5a48 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Sun, 20 Sep 2020 09:26:36 -0400 Subject: [PATCH 17/28] Undo 4deefc840e69e3c2c42f8a50963b8fb69c17efee to try to fix build on Python 3 < Python 3.8 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3a962573..c87ae8d1 100644 --- a/Makefile +++ b/Makefile @@ -104,7 +104,7 @@ PYTHON_CONFIG=python-config #PYTHON_CONFIG=python3.3dm-config PYTHON_INCLUDES=$(shell $(PYTHON_CONFIG) --includes) -PYTHON_LIBS=$(shell $(PYTHON) -c 'import sys;print("-lpython%d.%d" % sys.version_info[:2])') $(shell $(PYTHON_CONFIG) --libs) +PYTHON_LIBS=$(shell $(PYTHON_CONFIG) --libs) # Support having multiple named plugins # e.g. "python2.7" "python3.2mu" "python 3.2dmu" etc: From 13a5ade488f324b74e65b154eb780c8f5760bb3c Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Sun, 20 Sep 2020 09:34:05 -0400 Subject: [PATCH 18/28] .github/workflows/test.yml: attempt to debug PYTHON_CONFIG --- .github/workflows/test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f71441ed..0767cdb3 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -44,6 +44,8 @@ jobs: python -c "import sys; print(sys.version)" python-config --cflags python3-config --cflags + python-config --libs + python3-config --libs - name: Install Python dependencies run: python -m pip install --upgrade six pygments lxml @@ -58,6 +60,8 @@ jobs: else export PYTHON_CONFIG=python-config fi + $PYTHON_CONFIG --cflags + $PYTHON_CONFIG --libs pwd=$(pwd -P) mkdir build cd build From e45236b0e22d33f0c510ab8384418dcf4f4498a2 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Sun, 20 Sep 2020 09:58:47 -0400 Subject: [PATCH 19/28] .github/workflows/test.yml: fix name of Python installation step --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0767cdb3..a63f9421 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,7 +34,7 @@ jobs: run: gcc-${{matrix.gcc-version}} --version # https://docs.github.com/en/actions/guides/building-and-testing-python - - name: Set up Python ${{ matrix.python }} + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} From 539322eb8e292d2b53856b2529b26a0b2c5387ba Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Sun, 20 Sep 2020 10:00:12 -0400 Subject: [PATCH 20/28] Makefile: add python-config's --ldflags to the link --- Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Makefile b/Makefile index c87ae8d1..77616d5f 100644 --- a/Makefile +++ b/Makefile @@ -105,6 +105,7 @@ PYTHON_CONFIG=python-config PYTHON_INCLUDES=$(shell $(PYTHON_CONFIG) --includes) PYTHON_LIBS=$(shell $(PYTHON_CONFIG) --libs) +PYTHON_LDFLAGS=$(shell $(PYTHON_CONFIG) --ldflags) # Support having multiple named plugins # e.g. "python2.7" "python3.2mu" "python 3.2dmu" etc: @@ -152,6 +153,7 @@ $(PLUGIN_DSO): $(PLUGIN_OBJECT_FILES) $(LIBGCC_C_API_SO) $(PLUGIN_OBJECT_FILES) \ -o $@ \ $(LIBS) \ + $(PYTHON_LDFLAGS) \ -lgcc-c-api -Lgcc-c-api -Wl,-rpath=$(GCCPLUGINS_DIR) $(pwd)/gcc-c-api: From a6ef36bd33604e25be4654028d4a47d031b97fcb Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Sun, 20 Sep 2020 10:04:57 -0400 Subject: [PATCH 21/28] Makefile: omit testdemo for now --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 77616d5f..c04e7eee 100644 --- a/Makefile +++ b/Makefile @@ -324,7 +324,7 @@ testdemo: plugin print-gcc-version json-examples: plugin $(INVOCATION_ENV_VARS) $(srcdir)./gcc-with-cpychecker -I/usr/include/python2.7 -c libcpychecker_html/test/example1/bug.c -test-suite: plugin print-gcc-version testdejagnu testdemo +test-suite: plugin print-gcc-version testdejagnu $(INVOCATION_ENV_VARS) $(PYTHON) $(srcdir)./run-test-suite.py $(if $(srcdir),--srcdir=$(srcdir)) show-ssa: plugin From e38864c672891b1fc742456ed82006fca21b9175 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Sun, 20 Sep 2020 12:33:51 -0400 Subject: [PATCH 22/28] .github/workflows/test.yml: try to set LD_LIBRARY_PATH --- .github/workflows/test.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a63f9421..c3d73283 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -62,7 +62,11 @@ jobs: fi $PYTHON_CONFIG --cflags $PYTHON_CONFIG --libs + # Try to extract "-Lpath" from python-config --ldflags and add + # it to LD_LIBRARY_PATH + LD_LIBRARY_PATH=$(echo $($PYTHON_CONFIG --ldflags) | grep -o "\-L\S*" | cut -c 3-):$(LD_LIBRARY_PATH) + echo LD_LIBRARY_PATH: $LD_LIBRARY_PATH pwd=$(pwd -P) mkdir build cd build - make -f $pwd/Makefile srcdir=$pwd/ PYTHON_CONFIG=$PYTHON_CONFIG + make -f $pwd/Makefile srcdir=$pwd/ PYTHON_CONFIG=$PYTHON_CONFIG LD_LIBRARY_PATH=$LD_LIBRARY_PATH From 280f59c742861a3c67a51788d12ad9930da242d6 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Sun, 20 Sep 2020 12:41:00 -0400 Subject: [PATCH 23/28] .github/workflows/test.yml: fix LD_LIBRARY_PATH access --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c3d73283..7fd09eb2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -64,7 +64,7 @@ jobs: $PYTHON_CONFIG --libs # Try to extract "-Lpath" from python-config --ldflags and add # it to LD_LIBRARY_PATH - LD_LIBRARY_PATH=$(echo $($PYTHON_CONFIG --ldflags) | grep -o "\-L\S*" | cut -c 3-):$(LD_LIBRARY_PATH) + LD_LIBRARY_PATH=$(echo $($PYTHON_CONFIG --ldflags) | grep -o "\-L\S*" | cut -c 3-):$LD_LIBRARY_PATH echo LD_LIBRARY_PATH: $LD_LIBRARY_PATH pwd=$(pwd -P) mkdir build From bbd1105e014e519a02189590f2247e4a7edc2bff Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Sun, 20 Sep 2020 12:46:38 -0400 Subject: [PATCH 24/28] run-test-suite.py: exclude absinterp tests for GCC 6 as well as GCC 7 and later --- run-test-suite.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run-test-suite.py b/run-test-suite.py index 9a92bd19..fc70a9a5 100644 --- a/run-test-suite.py +++ b/run-test-suite.py @@ -797,7 +797,7 @@ def exclude_tests_below(path): exclude_test('tests/cpychecker/PyArg_ParseTuple/without_PY_SSIZE_T_CLEAN') # absinterp and thus the refcount-checker have bit-rotted: -if GCC_VERSION >= 7000: +if GCC_VERSION >= 6000: exclude_tests_below('tests/cpychecker/absinterp') exclude_tests_below('tests/cpychecker/refcounts') From 2fa41bd02bca0c5b372e8d73debbf6e231d9453d Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Sun, 20 Sep 2020 12:50:00 -0400 Subject: [PATCH 25/28] run-test-suite.py: exclude absinterp tests for GCC 5 as well as GCC 6 and later --- run-test-suite.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run-test-suite.py b/run-test-suite.py index fc70a9a5..ebc011e6 100644 --- a/run-test-suite.py +++ b/run-test-suite.py @@ -797,7 +797,7 @@ def exclude_tests_below(path): exclude_test('tests/cpychecker/PyArg_ParseTuple/without_PY_SSIZE_T_CLEAN') # absinterp and thus the refcount-checker have bit-rotted: -if GCC_VERSION >= 6000: +if GCC_VERSION >= 5000: exclude_tests_below('tests/cpychecker/absinterp') exclude_tests_below('tests/cpychecker/refcounts') From fa8a5126cfa71b45bff63cc46ab99468d951ed2d Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Sun, 20 Sep 2020 12:55:31 -0400 Subject: [PATCH 26/28] run-test-suite.py: use configparser.ConfigParser rather than configparser.SafeConfigParser --- run-test-suite.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/run-test-suite.py b/run-test-suite.py index ebc011e6..a64bdf1e 100644 --- a/run-test-suite.py +++ b/run-test-suite.py @@ -287,7 +287,7 @@ def run_test(testdir, srcdir): out = TestStream(os.path.join(testdir, 'stdout.txt'), srcdir) err = TestStream(os.path.join(testdir, 'stderr.txt'), srcdir) - cp = configparser.SafeConfigParser() + cp = configparser.ConfigParser() metadatapath = os.path.join(testdir, 'metadata.ini') cp.read([metadatapath]) From f342f843f3a743e8976f635bef4c3e145dbd724a Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Sun, 20 Sep 2020 13:10:12 -0400 Subject: [PATCH 27/28] run-test-suite.py: skip tests/plugin/namespace on Python >= 3.7 --- run-test-suite.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/run-test-suite.py b/run-test-suite.py index a64bdf1e..b65064dc 100644 --- a/run-test-suite.py +++ b/run-test-suite.py @@ -801,6 +801,10 @@ def exclude_tests_below(path): exclude_tests_below('tests/cpychecker/absinterp') exclude_tests_below('tests/cpychecker/refcounts') +# RuntimeError repr seems to have lost a trailing comma, perhaps in Python 3.7 +if sys.version_info[0] == 3 and sys.version_info[1] >= 7: + exclude_tests_below('tests/plugin/namespace') + def run_one_test(testdir): try: sys.stdout.write('%s: ' % testdir) From cd57097989d5427faba1b770eb5896e5eedba0a5 Mon Sep 17 00:00:00 2001 From: David Malcolm Date: Sun, 20 Sep 2020 13:18:07 -0400 Subject: [PATCH 28/28] Reinstate 4deefc840e69e3c2c42f8a50963b8fb69c17efee --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c04e7eee..2421636a 100644 --- a/Makefile +++ b/Makefile @@ -104,7 +104,7 @@ PYTHON_CONFIG=python-config #PYTHON_CONFIG=python3.3dm-config PYTHON_INCLUDES=$(shell $(PYTHON_CONFIG) --includes) -PYTHON_LIBS=$(shell $(PYTHON_CONFIG) --libs) +PYTHON_LIBS=$(shell $(PYTHON) -c 'import sys;print("-lpython%d.%d" % sys.version_info[:2])') $(shell $(PYTHON_CONFIG) --libs) PYTHON_LDFLAGS=$(shell $(PYTHON_CONFIG) --ldflags) # Support having multiple named plugins