Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[smart_holder] git merge master #4881

Merged
merged 4 commits into from
Oct 12, 2023
Merged

Commits on Oct 6, 2023

  1. chore(deps): bump seanmiddleditch/gha-setup-ninja from 3 to 4 (pybind…

    …#4875)
    
    Bumps [seanmiddleditch/gha-setup-ninja](https://github.com/seanmiddleditch/gha-setup-ninja) from 3 to 4.
    - [Release notes](https://github.com/seanmiddleditch/gha-setup-ninja/releases)
    - [Commits](seanmiddleditch/gha-setup-ninja@v3...v4)
    
    ---
    updated-dependencies:
    - dependency-name: seanmiddleditch/gha-setup-ninja
      dependency-type: direct:production
      update-type: version-update:semver-major
    ...
    
    Signed-off-by: dependabot[bot] <[email protected]>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Oct 6, 2023
    Configuration menu
    Copy the full SHA
    6c77208 View commit details
    Browse the repository at this point in the history

Commits on Oct 12, 2023

  1. Add pybind11/gil_safe_call_once.h (to fix deadlocks in pybind11/numpy…

    ….h) (pybind#4877)
    
    * LazyInitializeAtLeastOnceDestroyNever v1
    
    * Go back to using `union` as originally suggested by jbms@. The trick (also suggested by jbms@) is to add empty ctor + dtor.
    
    * Revert "Go back to using `union` as originally suggested by jbms@. The trick (also suggested by jbms@) is to add empty ctor + dtor."
    
    This reverts commit e7b8c4f.
    
    * Remove `#include <stdalign.h>`
    
    * `include\pybind11/numpy.h(24,10): fatal error C1083: Cannot open include file: 'stdalign.h': No such file or directory`
    
    * @tkoeppe wrote: this is a C interop header (and we're not writing C)
    
    * Suppress gcc 4.8.5 (CentOS 7) warning.
    
    ```
    include/pybind11/eigen/../numpy.h:63:53: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]
             return *reinterpret_cast<T *>(value_storage_);
                                                         ^
    ```
    
    * Replace comments:
    
    Document PRECONDITION.
    
    Adopt comment suggested by @tkoeppe: pybind#4877 (comment)
    
    * Adopt suggestion by @tkoeppe:
    
    * pybind#4877 (comment)
    
    * https://godbolt.org/z/Wa79nKz6e
    
    * Add `PYBIND11_CONSTINIT`, but it does not work for the current use cases:
    
    ```
    g++ -o pybind11/tests/test_numpy_array.os -c -std=c++20 -fPIC -fvisibility=hidden -O0 -g -Wall -Wextra -Wconversion -Wcast-qual -Wdeprecated -Wundef -Wnon-virtual-dtor -Wunused-result -Werror -isystem /usr/include/python3.11 -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_numpy_array.cpp
    ```
    
    ```
    In file included from /usr/local/google/home/rwgk/forked/pybind11/tests/test_numpy_array.cpp:10:
    /usr/local/google/home/rwgk/forked/pybind11/include/pybind11/numpy.h: In static member function ‘static pybind11::detail::npy_api& pybind11::detail::npy_api::get()’:
    /usr/local/google/home/rwgk/forked/pybind11/include/pybind11/numpy.h:258:82: error: ‘constinit’ variable ‘api_init’ does not have a constant initializer
      258 |         PYBIND11_CONSTINIT static LazyInitializeAtLeastOnceDestroyNever<npy_api> api_init;
          |                                                                                  ^~~~~~~~
    ```
    
    ```
    In file included from /usr/local/google/home/rwgk/forked/pybind11/tests/test_numpy_array.cpp:10:
    /usr/local/google/home/rwgk/forked/pybind11/include/pybind11/numpy.h: In static member function ‘static pybind11::object& pybind11::dtype::_dtype_from_pep3118()’:
    /usr/local/google/home/rwgk/forked/pybind11/include/pybind11/numpy.h:697:13: error: ‘constinit’ variable ‘imported_obj’ does not have a constant initializer
      697 |             imported_obj;
          |             ^~~~~~~~~~~~
    ```
    
    * Revert "Add `PYBIND11_CONSTINIT`, but it does not work for the current use cases:"
    
    This reverts commit f07b28b.
    
    * Reapply "Add `PYBIND11_CONSTINIT`, but it does not work for the current use cases:"
    
    This reverts commit 36be645.
    
    * Add Default Member Initializer on `value_storage_` as suggested by @tkoeppe:
    
    pybind#4877 (comment)
    
    This fixes the errors reported under commit f07b28b.
    
    * Fix copy-paste-missed-a-change mishap in commit 88cec11.
    
    * Semi-paranoid placement new (based on pybind#4877 (comment)).
    
    * Move PYBIND11_CONSTINIT to detail/common.h
    
    * Move code to the right places, rename new class and some variables.
    
    * Fix oversight: update tests/extra_python_package/test_files.py
    
    * Get the name right first.
    
    * Use `std::call_once`, `std::atomic`, following a pattern developed by @tkoeppe
    
    * Make the API more self-documenting (and possibly more easily reusable).
    
    * google-clang-tidy IWYU fixes
    
    * Rewrite comment as suggested by @tkoeppe
    
    * Update test_exceptions.cpp and exceptions.rst
    
    * Fix oversight in previous commit: add `PYBIND11_CONSTINIT`
    
    * Make `get_stored()` non-const for simplicity.
    
    As suggested by @tkoeppe: not seeing any reasonable use in which `get_stored` has to be const.
    
    * Add comment regarding `KeyboardInterrupt` behavior, based heavily on information provided by @jbms.
    
    * Add `assert(PyGILState_Check())` in `gil_scoped_release` ctor (simple & non-simple implementation) as suggested by @EthanSteinberg.
    
    * Fix oversight in previous commit (missing include cassert).
    
    * Remove use of std::atomic, leaving comments with rationale, why it is not needed.
    
    * Rewrite comment re `std:optional` based on deeper reflection (aka 2nd thoughts).
    
    * Additional comment with the conclusion of a discussion under PR pybind#4877.
    
    * pybind#4877 (comment)
    
    * Small comment changes suggested by @tkoeppe.
    Ralf W. Grosse-Kunstleve authored Oct 12, 2023
    Configuration menu
    Copy the full SHA
    0e2c3e5 View commit details
    Browse the repository at this point in the history
  2. Merge branch 'master' into sh_merge_master

    Ralf W. Grosse-Kunstleve committed Oct 12, 2023
    Configuration menu
    Copy the full SHA
    2c88356 View commit details
    Browse the repository at this point in the history
  3. Tracking ci.yml changes from master.

    Ralf W. Grosse-Kunstleve committed Oct 12, 2023
    Configuration menu
    Copy the full SHA
    9015869 View commit details
    Browse the repository at this point in the history