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

DM-15151: Set symbol visibility to hidden in pybind11 wrappers #39

Merged
merged 4 commits into from Sep 12, 2018

Conversation

r-owen
Copy link
Contributor

@r-owen r-owen commented Aug 28, 2018

No description provided.

@r-owen r-owen force-pushed the tickets/DM-15151 branch 2 times, most recently from c1295ce to d2c1850 Compare August 28, 2018 23:50
@r-owen r-owen changed the title Set symbol visibility to hidden in pybind11 wrappers DM-15151: Set symbol visibility to hidden in pybind11 wrappers Aug 29, 2018
@r-owen r-owen force-pushed the tickets/DM-15151 branch 3 times, most recently from ed939e2 to 6aeb0f2 Compare August 29, 2018 20:23
Copy link
Member

@kfindeisen kfindeisen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, assuming you're sure about which classes are getting the LSST_EXPORT treatment -- I have no idea how to review that.

*
* Implemented in the .cc file to work around symbol visiblity issues on macOS
* e.g. https://github.com/pybind/pybind11/issues/1503
*/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The location of the implementation doesn't seem like something we want in the API documentation. Consider moving to a normal comment.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be a method on PropertySet in the first place? If it's only needed for pybind11, maybe it should be a separate function (in the same files as now, I take it?).

Copy link
Contributor Author

@r-owen r-owen Sep 5, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implementation has to be in the shared object library that contains PropertySet. I don't think it's possible to do that if I only define the function in the pybind11 wrapper.

There is also a bit of C++ code that uses typeOfT (in pex_policy), though there may be another way to do it.

I will change the comment as per your suggestion.

[](std::type_info const& self, std::type_info const& other) { return self != other; });
[](std::type_info const& self, std::type_info const& other) { return self != other; })
.def("name", &std::type_info::name)
.def("hash_code", &std::type_info::hash_code);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not __hash__?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fear that will make it harder to find (I only added these fields for debugging). But what the heck, I'll change it. If folks really want it they can read the wrapper.

it help debug issues in Python
The way _propertyContainerGet got a PropertySet or PropertyList
was by first trying to return as a PropertyList, then checking
the type and returning as a PropertySet if it matched. This was
inefficient because the type of a PropertyList is the same as a
PropertySet, so do that check first. Also, use isPropertySetPtr
for the test to make the code look a bit cleaner.
@r-owen
Copy link
Contributor Author

r-owen commented Sep 12, 2018

Having ripped out boost persistence in DM-15599 the symbol export is no longer necessary. I will remove it assuming a full Jenkins run (including ci_hsc) passes.

@r-owen r-owen merged commit 4176dd3 into master Sep 12, 2018
@timj timj deleted the tickets/DM-15151 branch September 25, 2018 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants