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

Test suite does not build on centos7 #72

Closed
bbannier opened this issue Sep 21, 2020 · 5 comments
Closed

Test suite does not build on centos7 #72

bbannier opened this issue Sep 21, 2020 · 5 comments
Assignees
Labels
available on master Fix is done on master branch, issue closed on next release bug Something isn't working test Issue with test code
Milestone

Comments

@bbannier
Copy link

bbannier commented Sep 21, 2020

The test suite does not seem to build under centos7 with devtoolset-9. This seems to be due to a used TestAllocator not implementing rebind (deprecated in C++17, removed in C++20), e.g.,

/opt/rh/devtoolset-9/root/usr/include/c++/9/bits/basic_string.h: In instantiation of ‘class std::basic_string<char, std::char_traits<char>, TestAllocator<char> >’:
/tmp/cirrus-ci-build/test/filesystem_test.cpp:588:116:   required from here
/opt/rh/devtoolset-9/root/usr/include/c++/9/bits/basic_string.h:3142:63: error: no class template named ‘rebind’ in ‘class TestAllocator<char>’
 3142 |       typedef typename _Alloc::template rebind<_CharT>::other _CharT_alloc_type;
      |                                                               ^~~~~~~~~~~~~~~~~
/opt/rh/devtoolset-9/root/usr/include/c++/9/bits/basic_string.h:3160:68: error: no class template named ‘rebind’ in ‘class TestAllocator<char>’
 3160 |       typedef __gnu_cxx::__normal_iterator<pointer, basic_string>  iterator;
      |                                                                    ^~~~~~~~
/opt/rh/devtoolset-9/root/usr/include/c++/9/bits/basic_string.h:3162:61: error: no class template named ‘rebind’ in ‘class TestAllocator<char>’
 3162 |                                                             const_iterator;
      |                                                             ^~~~~~~~~~~~~~
/opt/rh/devtoolset-9/root/usr/include/c++/9/bits/basic_string.h:3163:53: error: no class template named ‘rebind’ in ‘class TestAllocator<char>’
 3163 |       typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
      |                                                     ^~~~~~~~~~~~~~~~~~~~~~
/opt/rh/devtoolset-9/root/usr/include/c++/9/bits/basic_string.h:3164:52: error: no class template named ‘rebind’ in ‘class TestAllocator<char>’
 3164 |       typedef std::reverse_iterator<iterator>      reverse_iterator;

I was exploring whether this library would be a good replacement for devtoolset on centos7 since the base system libstdc++ is fairly old there, and some the std filesystem library often requires compiled components (the devtoolset workflow is easiest to deploy if the produced artifacts have not runtime dependencies on devtoolset libraries).

I have tested this by extending the Cirrus CI setup with centos7 and centos8 platforms here. The build and test steps pass for centos8, but centos7 fails with above error.

Ideally it should be possible to use this library to statically compile in a libstdc++-neutral std::filesystem-like functionality (either by using header-only components or by a static link).

I understand that there is no official support for centos platforms, so please close this if it is out of scope.

@gulrak gulrak self-assigned this Sep 21, 2020
@gulrak
Copy link
Owner

gulrak commented Sep 21, 2020

I'll see what I can do. Will need to fix that on the way to C++20 support anyway, I guess. Thanks for reporting it.

@gulrak
Copy link
Owner

gulrak commented Sep 21, 2020

I used your referenced centos7/8 .cirrus.yml changes to test this, if it is okay with you, I'll merge them with the fix, than I would call it a supported platform, as that's what is needed for me to keep track that I don't break things for it.

@bbannier
Copy link
Author

I used your referenced centos7/8 .cirrus.yml changes to test this, if it is okay with you, I'll merge them with the fix, than I would call it a supported platform, as that's what is needed for me to keep track that I don't break things for it.

Yes, please, use the code if it is useful. Since devtoolset should ideally only be used during build, but not runtime, ultimately this line https://github.com/bbannier/filesystem/blob/81908c385b017f39cee013ff73d5c3abb67261be/.cirrus.yml#L25 should probably read instead

- source /opt/rh/devtoolset-9/enable && PATH=$PATH:/usr/local/bin .ci/unix-test.sh
+ PATH=$PATH:/usr/local/bin .ci/unix-test.sh

With that you could ensure that the binary produced with devtoolset can be used without it.

@gulrak gulrak added this to the v1.3.6 milestone Sep 22, 2020
@gulrak gulrak added bug Something isn't working test Issue with test code labels Sep 22, 2020
gulrak added a commit that referenced this issue Oct 4, 2020
gulrak added a commit that referenced this issue Oct 4, 2020
@gulrak gulrak added the available on master Fix is done on master branch, issue closed on next release label Oct 4, 2020
@gulrak
Copy link
Owner

gulrak commented Oct 10, 2020

Released with v1.3.6

@gulrak gulrak closed this as completed Oct 10, 2020
@bbannier
Copy link
Author

Awesome, thanks a lot @gulrak.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
available on master Fix is done on master branch, issue closed on next release bug Something isn't working test Issue with test code
Projects
None yet
Development

No branches or pull requests

2 participants