Skip to content

Fix ODR violations in our Eigen Tensor tests#4412

Merged
rwgk merged 3 commits into
pybind:masterfrom
EthanSteinberg:fix_eigen_test_odr_violations
Dec 20, 2022
Merged

Fix ODR violations in our Eigen Tensor tests#4412
rwgk merged 3 commits into
pybind:masterfrom
EthanSteinberg:fix_eigen_test_odr_violations

Conversation

@EthanSteinberg

Copy link
Copy Markdown
Collaborator

Description

The current way we are doing unit tests with Eigen unintentionally triggers ODR violations due to testing both with and without std::array.

This fixes those ODR violations by updating our build scripts.

@EthanSteinberg EthanSteinberg changed the title Fix ODR violations in our Eigen Tensor Tests Fix ODR violations in our Eigen Tensor tests Dec 17, 2022
@EthanSteinberg EthanSteinberg marked this pull request as draft December 17, 2022 13:58
@EthanSteinberg

Copy link
Copy Markdown
Collaborator Author

Hi @rwgk, can you take a look at this PR? I think this fixes the ODR issue in our tests.

At least, based on https://github.com/pybind/pybind11/actions/runs/3720383627/jobs/6309827070

@EthanSteinberg EthanSteinberg marked this pull request as ready for review December 17, 2022 14:23

@rwgk rwgk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm traveling and have only very unreliable internet at the moment, therefore I couldn't try things out myself. I'll look more as soon as I can.

Comment thread tests/test_eigen_tensor.inl Outdated
Comment thread tests/test_eigen_tensor.cpp Outdated
Comment thread tests/test_eigen_tensor_avoid_stl_array.cpp Outdated

@rwgk rwgk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Awesome, thanks for the tweaks! With that I just had to add one line in my SConscript to adjust to this PR.

@rwgk rwgk merged commit ee4b9f5 into pybind:master Dec 20, 2022
@github-actions github-actions Bot added the needs changelog Possibly needs a changelog entry label Dec 20, 2022
@rwgk rwgk removed the needs changelog Possibly needs a changelog entry label Dec 20, 2022
@EthanSteinberg EthanSteinberg deleted the fix_eigen_test_odr_violations branch December 20, 2022 13:34
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.

3 participants