Skip to content

Conversation

@ednolan
Copy link
Member

@ednolan ednolan commented Jul 9, 2025

Doing so violates the [CMAKE.PASSIVE_PROJECT] requirement of the Beman Standard:
https://github.com/bemanproject/beman/blob/main/docs/BEMAN_STANDARD.md#cmakepassive_projects

Due to this setting, all the CI jobs were running with C++26 set, making the C++20 jobs spuriously pass. This commit removes them.

Doing so violates the [CMAKE.PASSIVE_PROJECT] requirement of the
Beman Standard:
https://github.com/bemanproject/beman/blob/main/docs/BEMAN_STANDARD.md#cmakepassive_projects

Due to this setting, all the CI jobs were running with C++26 set,
making the C++20 jobs spuriously pass. This commit removes
them.

It also changes the C++ standard version used by the presets from
C++20 to C++23.
@ednolan ednolan force-pushed the enolan_cppversionfix1 branch from e25d166 to 2c8d96d Compare July 9, 2025 23:48
@coveralls
Copy link

Coverage Status

coverage: 92.578% (+0.4%) from 92.179%
when pulling 2c8d96d on enolan_cppversionfix1
into 196e80d on main.

Copy link
Member

@dietmarkuehl dietmarkuehl left a comment

Choose a reason for hiding this comment

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

I see you also disabled C++20. I thought the code would build with C++20. I may need to have a look at what breaks with C++20.

As an aside, I noticed the generic presets (debug and release) don't work with the setup from infra. That's a bit sad (I think I saw that Claus did have a PR for that but I haven't looked, yet).

@dietmarkuehl dietmarkuehl merged commit 73880e9 into main Jul 10, 2025
41 checks passed
@ednolan
Copy link
Member Author

ednolan commented Jul 10, 2025

This was the error I got when I tried building with Clang 20 and C++20:

[374/396] /usr/local/bin/clang++ -DCMAKE_INTDIR=\"Release\" -I/home/eddie/sync/cpp/bemanproject/execution/include -stdlib=libc++ -O3  -O3 -DNDEBUG -std=gnu++20 -MD -MT examples/CMakeFiles/beman.execution.examples.intro-5-consumer.dir/Release/intro-5-consumer.cpp.o -MF examples/CMakeFiles/beman.execution.examples.intro-5-consumer.dir/Release/intro-5-consumer.cpp.o.d -o examples/CMakeFiles/beman.execution.examples.intro-
5-consumer.dir/Release/intro-5-consumer.cpp.o -c /home/eddie/sync/cpp/bemanproject/execution/examples/intro-5-consumer.cpp
FAILED: [code=1] examples/CMakeFiles/beman.execution.examples.intro-5-consumer.dir/Release/intro-5-consumer.cpp.o
/usr/local/bin/clang++ -DCMAKE_INTDIR=\"Release\" -I/home/eddie/sync/cpp/bemanproject/execution/include -stdlib=libc++ -O3  -O3 -DNDEBUG -std=gnu++20 -MD -MT examples/CMakeFiles/beman.execution.examples.intro-5-consumer.dir/Release/intro-5-consumer.cpp.o -MF examples/CMakeFiles/beman.execution.examples.intro-5-consumer.dir/Release/intro-5-consumer.cpp.o.d -o examples/CMakeFiles/beman.execution.examples.intro-5-consumer
.dir/Release/intro-5-consumer.cpp.o -c /home/eddie/sync/cpp/bemanproject/execution/examples/intro-5-consumer.cpp
/home/eddie/sync/cpp/bemanproject/execution/examples/intro-5-consumer.cpp:24:29: error: no template named 'expected' in namespace 'std'
   24 |         auto set_value(std::expected<Value, Error>&& exp) noexcept -> void {
      |                        ~~~~~^
/home/eddie/sync/cpp/bemanproject/execution/examples/intro-5-consumer.cpp:91:33: error: no member named 'expected' in namespace 'std'
   91 |     ex::sync_wait(ex::just(std::expected<success, failure>(success::one)) | expected_to_channel() |
      |                            ~~~~~^
/home/eddie/sync/cpp/bemanproject/execution/examples/intro-5-consumer.cpp:91:42: error: 'success' does not refer to a value
   91 |     ex::sync_wait(ex::just(std::expected<success, failure>(success::one)) | expected_to_channel() |
      |                                          ^
/home/eddie/sync/cpp/bemanproject/execution/examples/intro-5-consumer.cpp:15:12: note: declared here
   15 | enum class success : std::uint8_t { one };
      |            ^
/home/eddie/sync/cpp/bemanproject/execution/examples/intro-5-consumer.cpp:91:51: error: 'failure' does not refer to a value
   91 |     ex::sync_wait(ex::just(std::expected<success, failure>(success::one)) | expected_to_channel() |
      |                                                   ^
/home/eddie/sync/cpp/bemanproject/execution/examples/intro-5-consumer.cpp:16:12: note: declared here
   16 | enum class failure : std::uint8_t { fail_one };
      |            ^
4 errors generated.

@ednolan
Copy link
Member Author

ednolan commented Jul 10, 2025

As an aside, I noticed the generic presets (debug and release) don't work with the setup from infra. That's a bit sad (I think I saw that Claus did have a PR for that but I haven't looked, yet).

I would like to upstream the fix for this into exemplar.

@ednolan ednolan deleted the enolan_cppversionfix1 branch July 10, 2025 00:17
@dietmarkuehl
Copy link
Member

As an aside, I noticed the generic presets (debug and release) don't work with the setup from infra. That's a bit sad (I think I saw that Claus did have a PR for that but I haven't looked, yet).

I would like to upstream the fix for this into exemplar.

I have accepted Claus’s change. It did restore something you removed (there was a conflict about it which I resolved in favor of Claus’s version).

@dietmarkuehl
Copy link
Member

This was the error I got when I tried building with Clang 20 and C++20:

[374/396] /usr/local/bin/clang++ -DCMAKE_INTDIR=\"Release\" -I/home/eddie/sync/cpp/bemanproject/execution/include -stdlib=libc++ -O3  -O3 -DNDEBUG -std=gnu++20 -MD -MT examples/CMakeFiles/beman.execution.examples.intro-5-consumer.dir/Release/intro-5-consumer.cpp.o -MF examples/CMakeFiles/beman.execution.examples.intro-5-consumer.dir/Release/intro-5-consumer.cpp.o.d -o examples/CMakeFiles/beman.execution.examples.intro-
5-consumer.dir/Release/intro-5-consumer.cpp.o -c /home/eddie/sync/cpp/bemanproject/execution/examples/intro-5-consumer.cpp
FAILED: [code=1] examples/CMakeFiles/beman.execution.examples.intro-5-consumer.dir/Release/intro-5-consumer.cpp.o
/usr/local/bin/clang++ -DCMAKE_INTDIR=\"Release\" -I/home/eddie/sync/cpp/bemanproject/execution/include -stdlib=libc++ -O3  -O3 -DNDEBUG -std=gnu++20 -MD -MT examples/CMakeFiles/beman.execution.examples.intro-5-consumer.dir/Release/intro-5-consumer.cpp.o -MF examples/CMakeFiles/beman.execution.examples.intro-5-consumer.dir/Release/intro-5-consumer.cpp.o.d -o examples/CMakeFiles/beman.execution.examples.intro-5-consumer
.dir/Release/intro-5-consumer.cpp.o -c /home/eddie/sync/cpp/bemanproject/execution/examples/intro-5-consumer.cpp
/home/eddie/sync/cpp/bemanproject/execution/examples/intro-5-consumer.cpp:24:29: error: no template named 'expected' in namespace 'std'
   24 |         auto set_value(std::expected<Value, Error>&& exp) noexcept -> void {
      |                        ~~~~~^
/home/eddie/sync/cpp/bemanproject/execution/examples/intro-5-consumer.cpp:91:33: error: no member named 'expected' in namespace 'std'
   91 |     ex::sync_wait(ex::just(std::expected<success, failure>(success::one)) | expected_to_channel() |
      |                            ~~~~~^
/home/eddie/sync/cpp/bemanproject/execution/examples/intro-5-consumer.cpp:91:42: error: 'success' does not refer to a value
   91 |     ex::sync_wait(ex::just(std::expected<success, failure>(success::one)) | expected_to_channel() |
      |                                          ^
/home/eddie/sync/cpp/bemanproject/execution/examples/intro-5-consumer.cpp:15:12: note: declared here
   15 | enum class success : std::uint8_t { one };
      |            ^
/home/eddie/sync/cpp/bemanproject/execution/examples/intro-5-consumer.cpp:91:51: error: 'failure' does not refer to a value
   91 |     ex::sync_wait(ex::just(std::expected<success, failure>(success::one)) | expected_to_channel() |
      |                                                   ^
/home/eddie/sync/cpp/bemanproject/execution/examples/intro-5-consumer.cpp:16:12: note: declared here
   16 | enum class failure : std::uint8_t { fail_one };
      |            ^
4 errors generated.

OK, that makes sense: I guess I should disable this example (and possibly others) when building with a C++ version which doesn’t have the corresponding components.

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