-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Connecting PYBIND11_INTERNALS_VERSION to PYBIND11_USE_SMART_HOLDER_AS_DEFAULT. #2939
Conversation
@rhaschke the github web UI won't let me add you as a reviewer, I have no idea why. Tagging you here instead. |
#2879 is used for testing with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would expect a user to enable PYBIND11_USE_SMART_HOLDER_AS_DEFAULT
via a compiler define on the cmdline. I followed this approach in #2930, which enables both variants as two different workflows: CI
and CI SH
.
@@ -10,6 +10,7 @@ | |||
#pragma once | |||
|
|||
#include "../pytypes.h" | |||
#include "smart_holder_sfinae_hooks_only.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is your approach to define PYBIND11_USE_SMART_HOLDER_AS_DEFAULT
?
Why don't you use a compiler definition?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initially mainly to have an easy way to run the CI with smart_holder as default. But then I thought it's good to keep as an option, to give people an easy way to experiment using smart_holder as default without having to go into their cmake/CI/IDE/whatever they may have. As-is, it works both ways. I'm reluctant to take one option away, especially because the cost is just a few extra lines in smart_holder_sfinae_hooks_only.h. With pytypes.h included first here, everything else is included already anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't asking to remove that option. I was just wondering. For CI, I suggest to use the cmake argument option to allow both checks to run on the same code base. I'm still struggling with some issues in #2930 though... But, I'm optimistic 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, good, thanks! And yes, it'll be awesome to trigger all testing with just one PR.
You can only tag people as a reviewer that are part of the maintainer team. |
d353b45
to
4b9bc48
Compare
…ybind#2939. For compatibility with PR pybind#3275.
Extensions built with
PYBIND11_USE_SMART_HOLDER_AS_DEFAULT
defined are incompatible with extensions built against master, orPYBIND11_USE_SMART_HOLDER_AS_DEFAULT
undefined, thereforePYBIND11_INTERNALS_VERSION
needs to be different. The approach chosen here is to add1000
to thePYBIND11_INTERNALS_VERSION
on master.