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

[INFRA] Remove C++17 support #2915

Merged
merged 1 commit into from
Dec 17, 2021
Merged

[INFRA] Remove C++17 support #2915

merged 1 commit into from
Dec 17, 2021

Conversation

eseiler
Copy link
Member

@eseiler eseiler commented Dec 9, 2021

No description provided.

@vercel
Copy link

vercel bot commented Dec 9, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/seqan/seqan3/ELLPN8SU1nY2Y7rWvTidNNGcsUug
✅ Preview: https://seqan3-git-fork-eseiler-fix-lambda20-seqan.vercel.app

@eseiler eseiler requested review from a team and SGSSGene and removed request for a team December 9, 2021 16:33
@h-2
Copy link
Member

h-2 commented Dec 9, 2021

I think the change is not compatible. The auto syntax does not preserve references / output range, does it?

@h-2
Copy link
Member

h-2 commented Dec 9, 2021

I thought you dropped GCC7 and GCC8? I explicitly checked that the syntax works with GCC9!

@eseiler
Copy link
Member Author

eseiler commented Dec 9, 2021

I think the change is not compatible. The auto syntax does not preserve references / output range, does it?

I would need to check what decltype(in) deduces to. But forward seems cleaner anyway as it also makes the intent clear.

  • I could use a feature test macro to check for template lambdas, and then just use auto as fallback (still not 100% right).

  • I guess the lambda could also just be an ordinary function?

I thought you dropped GCC7 and GCC8? I explicitly checked that the syntax works with GCC9!

Yes, we dropped GCC7/8, but not yet -std=c++17 -fconcepts; at least not explicitly as far as I am aware.
We still run nightlies on CPP17 mode.
It's something that could be up for discussion, but right now we wouldn't gain much from dropping cpp17 support.

@eseiler eseiler removed the request for review from SGSSGene December 9, 2021 18:01
@eseiler eseiler marked this pull request as draft December 9, 2021 18:01
@eseiler
Copy link
Member Author

eseiler commented Dec 9, 2021

I think I need to write a function object to properly implement this for cpp17.
So, I would go with:

  • Cpp17: validate_char_for_fn
  • Cpp20: lambda with template parameter

@h-2
Copy link
Member

h-2 commented Dec 9, 2021

Hm, so you dropped GCC7 and GCC8, but you did not drop C++17 mode? Do you assume that users have code that is incompatible with C++20? And how will they survive an upgrade of their distro since newer compilers require C++20 mode, or not?

@h-2
Copy link
Member

h-2 commented Dec 9, 2021

Btw: it is possible to work around this without an extra object but is ugly. See the implementation of views::elements

@eseiler
Copy link
Member Author

eseiler commented Dec 10, 2021

I put the issue up for discussion on Monday.
The question will be whether to drop cpp17 (explicitly).

@smehringer
Copy link
Member

smehringer commented Dec 13, 2021

Core meeting 13.12.2021

Pro

  • Very little code is expected to break when a user switches from C++17 to C++20 standard (mostly warnings)
  • All compilers we support offer C++20
  • We will never be clang-compatible with C++17 (concepts)
  • Probably an oversight from dropping GCC7/8

Contra

  • Some code might break for users
  • We will keep running ahead of clang when using modern C++20 features

Decision

  • We will drop C++17 support

Follow-up tasks in this PR:

  • Remove -std=c++17 detection in CMake
  • Add warning if user compiles with C++17 (platform.hpp)
  • Adapt nightlies

@eseiler eseiler changed the title [FIX] Make lambda cpp17 compatible [INFRA] Remove c++17 supoort Dec 13, 2021
@eseiler eseiler changed the title [INFRA] Remove c++17 supoort [INFRA] Remove c++17 support Dec 13, 2021
@eseiler eseiler changed the title [INFRA] Remove c++17 support [INFRA] Remove C++17 support Dec 13, 2021
@eseiler eseiler force-pushed the fix/lambda20 branch 3 times, most recently from 978b527 to b00b4f4 Compare December 13, 2021 12:31
@eseiler
Copy link
Member Author

eseiler commented Dec 13, 2021

The behaviour right now is:

  • If CMake is used (find_package), we will require CPP20 to be available as 1) builtin, 2) -std=c++20, or 3) -std=c++2a; in this order. Implemented in seqan3-config.cmake.
  • We will always compile with CPP20 if included via find_package - we set SEQAN3_CXX_FLAGS.
  • We still need the -fconcepts check for gcc9.
  • If you only include the headers, there is a warning that we do not support CPP17, see platform.hpp.
  • This warning can be disabled by defining SEQAN3_DISABLE_CPP17_DIAGNOSTIC.

  • builtin means that the test-source either compiles without flags, or with the flags set via -DCMAKE_CXX_FLAGS by the user.
-std= __cplusplus
c++17 201703
c++2a 201709
c++20 202002, 200204

Documentation will be follow-up. We still need to change docs to reflect the discontinuation of GCC7/8 support.

@eseiler eseiler force-pushed the fix/lambda20 branch 2 times, most recently from 235069a to 15cd07a Compare December 13, 2021 13:04
@eseiler eseiler marked this pull request as ready for review December 13, 2021 13:19
@eseiler eseiler requested a review from SGSSGene December 13, 2021 13:19
@codecov
Copy link

codecov bot commented Dec 13, 2021

Codecov Report

Merging #2915 (e542712) into master (999352e) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2915   +/-   ##
=======================================
  Coverage   98.28%   98.28%           
=======================================
  Files         267      267           
  Lines       11459    11459           
=======================================
  Hits        11262    11262           
  Misses        197      197           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 999352e...e542712. Read the comment docs.

* Add warning in platform.hpp
* Add SEQAN3_DISABLE_CPP17_DIAGNOSTIC to disable warning
* Only detect CPP20 support
Copy link
Contributor

@SGSSGene SGSSGene left a comment

Choose a reason for hiding this comment

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

The future is now!

@eseiler eseiler requested a review from smehringer December 15, 2021 13:06
This was linked to issues Dec 15, 2021
Comment on lines +48 to +49
//!\brief This disables the warning you would get if you compile with `-std=c++17`.
#define SEQAN3_DISABLE_CPP17_DIAGNOSTIC
Copy link
Member

Choose a reason for hiding this comment

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

I would maybe write something a little more directed at the user, like "define this variable to disable..."

Side note: We do not really define this variable, but we need to define it so we can document it?

Copy link
Member Author

Choose a reason for hiding this comment

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

I just copy-pasted the documentation from the pre-cxx11-abi.
If you want, I can do a doc sweep for these definitions afterwards (new PR) and change all at once.

We only define it for doxygen so that we can document it.
In the actual code, we only check if it is defined, not the value.

# if (__cplusplus < 201703)
# error "SeqAn3 requires C++20, make sure that you have set -std=c++2a (gcc9) or -std=c++20 (gcc10 and higher)."
# elif not defined(SEQAN3_DISABLE_CPP17_DIAGNOSTIC) && (__cplusplus >= 201703) && (__cplusplus < 201709)
# pragma GCC warning "SeqAn 3.1.x is the last version that supports C++17. Newer SeqAn versions, including this one, might not compile with -std=c++17. To disable this warning, use -std=c++2a (gcc9), -std=c++20 (gcc10 and higher), or -DSEQAN3_DISABLE_CPP17_DIAGNOSTIC."
Copy link
Member

Choose a reason for hiding this comment

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

why is this a pragma and not an error?

Copy link
Member Author

Choose a reason for hiding this comment

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

Same as with pre-cxx-11 ABI.
It might compile, but no guarantees from our side.
It would be totally OK to use cpp17 for now, unless you use the view::char_valid_for or view::assign_strictly_to anywhere.

@eseiler eseiler requested a review from smehringer December 16, 2021 09:45
@smehringer smehringer merged commit cf4e1d7 into seqan:master Dec 17, 2021
@eseiler eseiler deleted the fix/lambda20 branch December 17, 2021 08:56
@eseiler eseiler removed a link to an issue Apr 24, 2022
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.

[CRON] AVX2
4 participants