Skip to content

include/pybind11/numpy.h: gcc 4.8.4 does not have is_trivially_copyable #3270

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

Merged
merged 1 commit into from
Sep 15, 2021

Conversation

mkoeppe
Copy link
Contributor

@mkoeppe mkoeppe commented Sep 15, 2021

Description

Proposed fix for (#3269), tested on ubuntu-trusty.

Suggested changelog entry:

Restore compatibility with gcc 4.8.4 as distributed by ubuntu-trusty, linuxmint-17.

@@ -319,7 +319,7 @@ template <typename T> using remove_all_extents_t = typename array_info<T>::type;

template <typename T> using is_pod_struct = all_of<
std::is_standard_layout<T>, // since we're accessing directly in memory we need a standard layout type
#if defined(__GLIBCXX__) && (__GLIBCXX__ < 20150422 || __GLIBCXX__ == 20150623 || __GLIBCXX__ == 20150626 || __GLIBCXX__ == 20160803)
#if defined(__GLIBCXX__) && (__GLIBCXX__ < 20150422 || __GLIBCXX__ == 20150426 || __GLIBCXX__ == 20150623 || __GLIBCXX__ == 20150626 || __GLIBCXX__ == 20160803)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Yikes. Disappointed there isn't a better way to query this information.

Copy link
Collaborator

Choose a reason for hiding this comment

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

+1 but I'll merge this now to get us back to normal.

Question, to maybe do something different later in another PR: would there anything be lost if we simply made this

#if defined(__GLIBCXX__) && __GLIBCXX__ < 20160803

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the dates are the release dates, even if they are not sequential?

@rwgk rwgk merged commit 5b44324 into pybind:v2.7 Sep 15, 2021
@github-actions github-actions bot added the needs changelog Possibly needs a changelog entry label Sep 15, 2021
@rwgk rwgk removed the needs changelog Possibly needs a changelog entry label Sep 15, 2021
@rwgk
Copy link
Collaborator

rwgk commented Sep 15, 2021

TBH: I missed that this was against v2.7 (I assumed master).
@henryiii what's the best way to handle this? Also cherry-pick to master?

@henryiii
Copy link
Collaborator

Also cherry-pick to master?

Yep.

@henryiii
Copy link
Collaborator

Also, @mkoeppe it's best to target master, and then ask for it to be backported. If you do target a branch, I'd start the PR title with the branch name (usually in [], but I've seen other styles).

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Sep 15, 2021

Not exactly practical to ask downstream projects to test with your master branch -- we are using a release and our concern is to fix that.

By the way, I noticed that the directory layout of an sdist of the project differs from the directory layout of your repo, forcing me to hand-edit the patch. That's a bit unusual and something that you may want to fix in the medium term.

@henryiii
Copy link
Collaborator

This will not fix the release unless we make a new release. Generally, either make a PR against master or clearly note you are doing something non-standard. You are welcome to ask for a backport, we will do it if we can. If you make a patch to an upstream project, you should try to target the active development branch first. And clearly note if you don't.

If someone hadn't caught this, 2.8 would be missing this fix, even if there is a 2.7.3 (or whatever is next).

Not a huge criticism, and very happy for the patch, just a recommendation.

The SDist has the CMake install instead of the source, so that the SDist is installable without requiring CMake. However the directory structure should be somewhat close, the main (only?) difference is the includes are already placed where they need to go for Python.

@mkoeppe
Copy link
Contributor Author

mkoeppe commented Sep 15, 2021

Thanks for the explanations.

@henryiii henryiii added needs changelog Possibly needs a changelog entry and removed needs changelog Possibly needs a changelog entry labels Sep 16, 2021
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.

4 participants