Skip to content

Commit 5c9f5b2

Browse files
fixes and update ci
1 parent 0806289 commit 5c9f5b2

File tree

2 files changed

+70
-65
lines changed

2 files changed

+70
-65
lines changed

.github/workflows/ci.yml

Lines changed: 64 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -166,82 +166,82 @@ jobs:
166166
run: pytest tests/extra_setuptools
167167

168168

169-
# deadsnakes:
170-
# strategy:
171-
# fail-fast: false
172-
# matrix:
173-
# include:
174-
# - python-version: 3.9
175-
# python-debug: true
176-
# valgrind: true
177-
# - python-version: 3.10-dev
178-
# python-debug: false
169+
deadsnakes:
170+
strategy:
171+
fail-fast: false
172+
matrix:
173+
include:
174+
- python-version: 3.9
175+
python-debug: true
176+
valgrind: true
177+
# - python-version: 3.10-dev
178+
# python-debug: false
179179

180-
# name: "🐍 ${{ matrix.python-version }}${{ matrix.python-debug && '-dbg' || '' }} (deadsnakes)${{ matrix.valgrind && ' • Valgrind' || '' }} • x64"
181-
# runs-on: ubuntu-latest
180+
name: "🐍 ${{ matrix.python-version }}${{ matrix.python-debug && '-dbg' || '' }} (deadsnakes)${{ matrix.valgrind && ' • Valgrind' || '' }} • x64"
181+
runs-on: ubuntu-latest
182182

183-
# steps:
184-
# - uses: actions/checkout@v2
183+
steps:
184+
- uses: actions/checkout@v2
185185

186-
# - name: Setup Python ${{ matrix.python-version }} (deadsnakes)
187-
# uses: deadsnakes/action@v2.1.1
188-
# with:
189-
# python-version: ${{ matrix.python-version }}
190-
# debug: ${{ matrix.python-debug }}
186+
- name: Setup Python ${{ matrix.python-version }} (deadsnakes)
187+
uses: deadsnakes/action@v2.1.1
188+
with:
189+
python-version: ${{ matrix.python-version }}
190+
debug: ${{ matrix.python-debug }}
191191

192-
# - name: Update CMake
193-
# uses: jwlawson/actions-setup-cmake@v1.7
192+
- name: Update CMake
193+
uses: jwlawson/actions-setup-cmake@v1.7
194194

195-
# - name: Valgrind cache
196-
# if: matrix.valgrind
197-
# uses: actions/cache@v2
198-
# id: cache-valgrind
199-
# with:
200-
# path: valgrind
201-
# key: 3.16.1 # Valgrind version
195+
- name: Valgrind cache
196+
if: matrix.valgrind
197+
uses: actions/cache@v2
198+
id: cache-valgrind
199+
with:
200+
path: valgrind
201+
key: 3.16.1 # Valgrind version
202202

203-
# - name: Compile Valgrind
204-
# if: matrix.valgrind && steps.cache-valgrind.outputs.cache-hit != 'true'
205-
# run: |
206-
# VALGRIND_VERSION=3.16.1
207-
# curl https://sourceware.org/pub/valgrind/valgrind-$VALGRIND_VERSION.tar.bz2 -o - | tar xj
208-
# mv valgrind-$VALGRIND_VERSION valgrind
209-
# cd valgrind
210-
# ./configure
211-
# make -j 2 > /dev/null
212-
213-
# - name: Install Valgrind
214-
# if: matrix.valgrind
215-
# working-directory: valgrind
216-
# run: |
217-
# sudo make install
218-
# sudo apt-get update
219-
# sudo apt-get install libc6-dbg # Needed by Valgrind
203+
- name: Compile Valgrind
204+
if: matrix.valgrind && steps.cache-valgrind.outputs.cache-hit != 'true'
205+
run: |
206+
VALGRIND_VERSION=3.16.1
207+
curl https://sourceware.org/pub/valgrind/valgrind-$VALGRIND_VERSION.tar.bz2 -o - | tar xj
208+
mv valgrind-$VALGRIND_VERSION valgrind
209+
cd valgrind
210+
./configure
211+
make -j 2 > /dev/null
212+
213+
- name: Install Valgrind
214+
if: matrix.valgrind
215+
working-directory: valgrind
216+
run: |
217+
sudo make install
218+
sudo apt-get update
219+
sudo apt-get install libc6-dbg # Needed by Valgrind
220220
221-
# - name: Prepare env
222-
# run: python -m pip install -r tests/requirements.txt --prefer-binary
221+
- name: Prepare env
222+
run: python -m pip install -r tests/requirements.txt --prefer-binary
223223

224-
# - name: Configure
225-
# run: >
226-
# cmake -S . -B build
227-
# -DCMAKE_BUILD_TYPE=Debug
228-
# -DPYBIND11_WERROR=ON
229-
# -DDOWNLOAD_CATCH=ON
230-
# -DDOWNLOAD_EIGEN=ON
231-
# -DCMAKE_CXX_STANDARD=17
224+
- name: Configure
225+
run: >
226+
cmake -S . -B build
227+
-DCMAKE_BUILD_TYPE=Debug
228+
-DPYBIND11_WERROR=ON
229+
-DDOWNLOAD_CATCH=ON
230+
-DDOWNLOAD_EIGEN=ON
231+
-DCMAKE_CXX_STANDARD=17
232232
233-
# - name: Build
234-
# run: cmake --build build -j 2
233+
- name: Build
234+
run: cmake --build build -j 2
235235

236-
# - name: Python tests
237-
# run: cmake --build build --target pytest
236+
- name: Python tests
237+
run: cmake --build build --target pytest
238238

239-
# - name: C++ tests
240-
# run: cmake --build build --target cpptest
239+
- name: C++ tests
240+
run: cmake --build build --target cpptest
241241

242-
# - name: Run Valgrind on Python tests
243-
# if: matrix.valgrind
244-
# run: cmake --build build --target memcheck
242+
- name: Run Valgrind on Python tests
243+
if: matrix.valgrind
244+
run: cmake --build build --target memcheck
245245

246246

247247
# Testing on clang using the excellent silkeh clang docker images

include/pybind11/pybind11.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1489,7 +1489,12 @@ class class_ : public detail::generic_type {
14891489
// This should be called when the item is *actually* being deleted
14901490
// TODO(eric.cousineau): Do we care about use cases where the user manually calls this?
14911491
auto *inst = (detail::instance *) self.ptr();
1492-
const detail::type_info *lowest_type = detail::get_lowest_type(self);
1492+
const detail::type_info *lowest_type = detail::get_lowest_type(self, false);
1493+
if (!lowest_type) {
1494+
// This should only happen in a multi-inheritance case (which is
1495+
// not yet supported for this fork's ownership transfer setup).
1496+
return;
1497+
}
14931498
auto& release_info = lowest_type->release_info;
14941499
// The references are as follows:
14951500
// 1. When Python calls __del__ via tp_del (default slot)

0 commit comments

Comments
 (0)