forked from google/pybind11clif
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Transfer PR google#4329 from master to smart_holder branch, STEP 1.
The patch .rej below are resolved, but THIS STATE DOES NOT BUILD: ``` clang++ -o pybind11/tests/test_constants_and_functions.os -c -std=c++17 -fPIC -fvisibility=hidden -O0 -g -Wall -Wextra -Wconversion -Wcast-qual -Wdeprecated -Wundef -Wnon-virtual-dtor -Wunused-result -Werror -isystem /usr/include/python3.10 -isystem /usr/include/eigen3 -DPYBIND11_STRICT_ASSERTS_CLASS_HOLDER_VS_TYPE_CASTER_MIX -DPYBIND11_ENABLE_TYPE_CASTER_ODR_GUARD_IF_AVAILABLE -DPYBIND11_TEST_BOOST -Ipybind11/include -I/usr/local/google/home/rwgk/forked/pybind11/include -I/usr/local/google/home/rwgk/clone/pybind11/include /usr/local/google/home/rwgk/forked/pybind11/tests/test_constants_and_functions.cpp In file included from /usr/local/google/home/rwgk/forked/pybind11/tests/test_constants_and_functions.cpp:11: In file included from /usr/local/google/home/rwgk/forked/pybind11/tests/pybind11_tests.h:3: In file included from /usr/local/google/home/rwgk/forked/pybind11/include/pybind11/eval.h:14: /usr/local/google/home/rwgk/forked/pybind11/include/pybind11/pybind11.h:1781:9: error: static_assert failed due to requirement '!holder_is_smart_holder == type_caster_type_is_type_caster_base_subtype' "py::class_ holder vs type_caster mismatch: missing PYBIND11_TYPE_CASTER_BASE_HOLDER(T, ...) or collision with custom py::detail::type_caster<T>?" static_assert(!holder_is_smart_holder == type_caster_type_is_type_caster_base_subtype, ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /usr/local/google/home/rwgk/forked/pybind11/include/pybind11/pybind11.h:2460:11: note: in instantiation of function template specialization 'pybind11::class_<MyEnum>::class_<>' requested here : class_<Type>(scope, name, extra...), m_base(*this, scope) { ^ /usr/local/google/home/rwgk/forked/pybind11/tests/test_constants_and_functions.cpp:106:5: note: in instantiation of function template specialization 'pybind11::enum_<MyEnum>::enum_<>' requested here py::enum_<MyEnum>(m, "MyEnum") ^ 1 error generated. ``` ________ ``` rwgk.c.googlers.com:~/forked/pybind11 $ patch -p 1 < ~/native_enum_git_diff_master_2022-11-19+131942.patch patching file .github/workflows/python312.yml patching file CMakeLists.txt Hunk google#1 FAILED at 111. Hunk google#2 succeeded at 138 (offset 5 lines). 1 out of 2 hunks FAILED -- saving rejects to file CMakeLists.txt.rej patching file include/pybind11/cast.h Hunk google#1 FAILED at 12. Hunk google#2 succeeded at 78 (offset 30 lines). Hunk google#3 succeeded at 1173 (offset 41 lines). 1 out of 3 hunks FAILED -- saving rejects to file include/pybind11/cast.h.rej patching file include/pybind11/detail/abi_platform_id.h patching file include/pybind11/detail/cross_extension_shared_state.h patching file include/pybind11/detail/internals.h Hunk google#1 FAILED at 16. Hunk google#2 succeeded at 109 (offset 1 line). Hunk google#3 FAILED at 203. Hunk google#4 succeeded at 398 (offset 11 lines). Hunk google#5 succeeded at 457 (offset 11 lines). 2 out of 5 hunks FAILED -- saving rejects to file include/pybind11/detail/internals.h.rej patching file include/pybind11/detail/native_enum_data.h patching file include/pybind11/detail/type_map.h patching file include/pybind11/embed.h patching file include/pybind11/native_enum.h patching file include/pybind11/pybind11.h Hunk google#1 FAILED at 12. Hunk google#2 succeeded at 1269 (offset 1 line). Hunk google#3 succeeded at 2457 (offset 255 lines). 1 out of 3 hunks FAILED -- saving rejects to file include/pybind11/pybind11.h.rej patching file include/pybind11/pytypes.h patching file tests/CMakeLists.txt Hunk google#1 succeeded at 160 (offset 18 lines). patching file tests/conftest.py patching file tests/extra_python_package/test_files.py Hunk google#2 FAILED at 47. 1 out of 2 hunks FAILED -- saving rejects to file tests/extra_python_package/test_files.py.rej patching file tests/test_embed/test_interpreter.cpp patching file tests/test_enum.cpp patching file tests/test_enum.py patching file tests/test_native_enum.cpp patching file tests/test_native_enum.py ```
- Loading branch information
Ralf W. Grosse-Kunstleve
committed
Nov 19, 2022
1 parent
d095a9b
commit 04557ca
Showing
20 changed files
with
1,207 additions
and
166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
name: Python312 | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
|
||
concurrency: | ||
group: python312-${{ github.ref }} | ||
cancel-in-progress: false | ||
|
||
env: | ||
PYTEST_TIMEOUT: 300 | ||
|
||
jobs: | ||
standard: | ||
name: "🐍 3.12 latest • ubuntu-latest • x64" | ||
runs-on: ubuntu-latest | ||
# if: "contains(github.event.pull_request.labels.*.name, 'python dev')" | ||
|
||
steps: | ||
- name: Show env | ||
run: env | ||
|
||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup Python 3.12 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.12-dev" | ||
|
||
- name: Setup Boost | ||
run: sudo apt-get install libboost-dev | ||
|
||
- name: Update CMake | ||
uses: jwlawson/actions-setup-cmake@v1.13 | ||
|
||
- name: Run pip installs | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install --prefer-binary -r tests/requirements.txt | ||
python -m pip install --prefer-binary numpy | ||
# python -m pip install --prefer-binary scipy | ||
|
||
- name: Show platform info | ||
run: python -m platform | ||
|
||
- name: Show CMake version | ||
run: cmake --version | ||
|
||
# FIRST BUILD | ||
- name: Configure C++11 | ||
run: > | ||
cmake -S . -B build11 | ||
-DCMAKE_VERBOSE_MAKEFILE=ON | ||
-DPYBIND11_WERROR=ON | ||
-DDOWNLOAD_CATCH=ON | ||
-DDOWNLOAD_EIGEN=ON | ||
-DCMAKE_CXX_STANDARD=11 | ||
-DCMAKE_BUILD_TYPE=Debug | ||
- name: Build C++11 | ||
run: cmake --build build11 -j 2 | ||
|
||
- name: Python tests C++11 | ||
run: cmake --build build11 --target pytest -j 2 | ||
|
||
- name: C++ tests C++11 | ||
run: cmake --build build11 --target cpptest -j 2 | ||
|
||
- name: Interface test C++11 | ||
run: cmake --build build11 --target test_cmake_build | ||
|
||
- name: Clean directory | ||
run: git clean -fdx | ||
|
||
# SECOND BUILD | ||
- name: Configure C++17 | ||
run: > | ||
cmake -S . -B build17 | ||
-DCMAKE_VERBOSE_MAKEFILE=ON | ||
-DPYBIND11_WERROR=ON | ||
-DDOWNLOAD_CATCH=ON | ||
-DDOWNLOAD_EIGEN=ON | ||
-DCMAKE_CXX_STANDARD=17 | ||
-DCMAKE_BUILD_TYPE=Debug | ||
- name: Build C++17 | ||
run: cmake --build build17 -j 2 | ||
|
||
- name: Python tests C++17 | ||
run: cmake --build build17 --target pytest | ||
|
||
- name: C++ tests C++17 | ||
run: cmake --build build17 --target cpptest | ||
|
||
- name: Interface test C++17 | ||
run: cmake --build build17 --target test_cmake_build | ||
|
||
- name: Clean directory | ||
run: git clean -fdx | ||
|
||
# THIRD BUILD | ||
- name: Configure C++17 max DPYBIND11_INTERNALS_VERSION | ||
run: > | ||
cmake -S . -B build17max | ||
-DCMAKE_VERBOSE_MAKEFILE=ON | ||
-DPYBIND11_WERROR=ON | ||
-DDOWNLOAD_CATCH=ON | ||
-DDOWNLOAD_EIGEN=ON | ||
-DCMAKE_CXX_STANDARD=17 | ||
-DCMAKE_BUILD_TYPE=Debug | ||
-DPYBIND11_INTERNALS_VERSION=10000000 | ||
- name: Build C++17 max DPYBIND11_INTERNALS_VERSION | ||
run: cmake --build build17max -j 2 | ||
|
||
- name: Python tests C++17 max DPYBIND11_INTERNALS_VERSION | ||
run: cmake --build build17max --target pytest | ||
|
||
- name: C++ tests C++17 max DPYBIND11_INTERNALS_VERSION | ||
run: cmake --build build17max --target cpptest | ||
|
||
- name: Interface test C++17 max DPYBIND11_INTERNALS_VERSION | ||
run: cmake --build build17max --target test_cmake_build | ||
|
||
# Ensure the setup_helpers module can build packages using setuptools | ||
- name: Setuptools helpers test | ||
run: pytest tests/extra_setuptools | ||
|
||
- name: Clean directory | ||
run: git clean -fdx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
// Copyright (c) 2022 The pybind Community. | ||
// All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
#pragma once | ||
|
||
#include "common.h" | ||
|
||
/// On MSVC, debug and release builds are not ABI-compatible! | ||
#if defined(_MSC_VER) && defined(_DEBUG) | ||
# define PYBIND11_BUILD_TYPE "_debug" | ||
#else | ||
# define PYBIND11_BUILD_TYPE "" | ||
#endif | ||
|
||
/// Let's assume that different compilers are ABI-incompatible. | ||
/// A user can manually set this string if they know their | ||
/// compiler is compatible. | ||
#ifndef PYBIND11_COMPILER_TYPE | ||
# if defined(_MSC_VER) | ||
# define PYBIND11_COMPILER_TYPE "_msvc" | ||
# elif defined(__INTEL_COMPILER) | ||
# define PYBIND11_COMPILER_TYPE "_icc" | ||
# elif defined(__clang__) | ||
# define PYBIND11_COMPILER_TYPE "_clang" | ||
# elif defined(__PGI) | ||
# define PYBIND11_COMPILER_TYPE "_pgi" | ||
# elif defined(__MINGW32__) | ||
# define PYBIND11_COMPILER_TYPE "_mingw" | ||
# elif defined(__CYGWIN__) | ||
# define PYBIND11_COMPILER_TYPE "_gcc_cygwin" | ||
# elif defined(__GNUC__) | ||
# define PYBIND11_COMPILER_TYPE "_gcc" | ||
# else | ||
# define PYBIND11_COMPILER_TYPE "_unknown" | ||
# endif | ||
#endif | ||
|
||
/// Also standard libs | ||
#ifndef PYBIND11_STDLIB | ||
# if defined(_LIBCPP_VERSION) | ||
# define PYBIND11_STDLIB "_libcpp" | ||
# elif defined(__GLIBCXX__) || defined(__GLIBCPP__) | ||
# define PYBIND11_STDLIB "_libstdcpp" | ||
# else | ||
# define PYBIND11_STDLIB "" | ||
# endif | ||
#endif | ||
|
||
/// On Linux/OSX, changes in __GXX_ABI_VERSION__ indicate ABI incompatibility. | ||
#ifndef PYBIND11_BUILD_ABI | ||
# if defined(__GXX_ABI_VERSION) | ||
# define PYBIND11_BUILD_ABI "_cxxabi" PYBIND11_TOSTRING(__GXX_ABI_VERSION) | ||
# else | ||
# define PYBIND11_BUILD_ABI "" | ||
# endif | ||
#endif | ||
|
||
#ifndef PYBIND11_INTERNALS_KIND | ||
# if defined(WITH_THREAD) | ||
# define PYBIND11_INTERNALS_KIND "" | ||
# else | ||
# define PYBIND11_INTERNALS_KIND "_without_thread" | ||
# endif | ||
#endif | ||
|
||
/// See README_smart_holder.rst: | ||
/// Classic / Conservative / Progressive cross-module compatibility | ||
#ifndef PYBIND11_INTERNALS_SH_DEF | ||
# if defined(PYBIND11_USE_SMART_HOLDER_AS_DEFAULT) | ||
# define PYBIND11_INTERNALS_SH_DEF "" | ||
# else | ||
# define PYBIND11_INTERNALS_SH_DEF "_sh_def" | ||
# endif | ||
#endif | ||
|
||
/* NOTE - ATTENTION - WARNING - EXTREME CAUTION | ||
Changing this will break compatibility with `PYBIND11_INTERNALS_VERSION 4` | ||
See pybind11/detail/type_map.h for more information. | ||
*/ | ||
#define PYBIND11_PLATFORM_ABI_ID_V4 \ | ||
PYBIND11_INTERNALS_KIND PYBIND11_COMPILER_TYPE PYBIND11_STDLIB PYBIND11_BUILD_ABI \ | ||
PYBIND11_BUILD_TYPE PYBIND11_INTERNALS_SH_DEF | ||
|
||
/// LEGACY "ABI-breaking" APPROACH, ORIGINAL COMMENT | ||
/// ------------------------------------------------ | ||
/// Tracks the `internals` and `type_info` ABI version independent of the main library version. | ||
/// | ||
/// Some portions of the code use an ABI that is conditional depending on this | ||
/// version number. That allows ABI-breaking changes to be "pre-implemented". | ||
/// Once the default version number is incremented, the conditional logic that | ||
/// no longer applies can be removed. Additionally, users that need not | ||
/// maintain ABI compatibility can increase the version number in order to take | ||
/// advantage of any functionality/efficiency improvements that depend on the | ||
/// newer ABI. | ||
/// | ||
/// WARNING: If you choose to manually increase the ABI version, note that | ||
/// pybind11 may not be tested as thoroughly with a non-default ABI version, and | ||
/// further ABI-incompatible changes may be made before the ABI is officially | ||
/// changed to the new version. | ||
#ifndef PYBIND11_INTERNALS_VERSION | ||
# define PYBIND11_INTERNALS_VERSION 4 | ||
#endif |
Oops, something went wrong.