Skip to content

ubuntu-latest runners have an incompatible combination of clang and libstdc++ #8659

@wheremyfoodat

Description

@wheremyfoodat

Description

Some ubuntu-latest runners come with a newer version of libstdc++ and still have clang 14 which only has partial consteval support. As a result, trying to compile a file that does #include <chrono> fails like this:

In file included from /home/runner/work/Panda3DS/Panda3DS/src/config.cpp:8:
In file included from /home/runner/work/Panda3DS/Panda3DS/third_party/toml11/toml.hpp:32:
In file included from /home/runner/work/Panda3DS/Panda3DS/third_party/toml11/toml/parser.hpp:9:
In file included from /home/runner/work/Panda3DS/Panda3DS/third_party/toml11/toml/combinator.hpp:16:
In file included from /home/runner/work/Panda3DS/Panda3DS/third_party/toml11/toml/result.hpp:5:
In file included from /home/runner/work/Panda3DS/Panda3DS/third_party/toml11/toml/traits.hpp:10:
/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/chrono:2320:48: error: call to consteval function 'std::chrono::hh_mm_ss::_S_fractional_width' is not a constant expression
        static constexpr unsigned fractional_width = {_S_fractional_width()};
                                                      ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/chrono:2320:48: note: undefined function '_S_fractional_width' cannot be used in a constant expression
/usr/bin/../lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/chrono:2275:2: note: declared here
        _S_fractional_width()
        ^
1 error generated.
gmake[2]: *** [CMakeFiles/Alber.dir/build.make:104: CMakeFiles/Alber.dir/src/config.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:588: CMakeFiles/Alber.dir/all] Error 2
gmake: *** [Makefile:136: all] Error 2

Should be fixable by using clang 17.

Platforms affected

  • Azure DevOps
  • GitHub Actions - Standard Runners
  • GitHub Actions - Larger Runners

Runner images affected

  • Ubuntu 20.04
  • Ubuntu 22.04
  • macOS 11
  • macOS 12
  • macOS 13
  • Windows Server 2019
  • Windows Server 2022

Image version and build link

2.310.2

Link to a failing build: https://github.com/wheremyfoodat/Panda3DS/actions/runs/6640518979/job/18041094730
Ignore the "Setting up newer Clang" step in this run, the compilation step was still using the stock ubuntu-latest clang

Is it regression?

Yes (worked fine until yesterday: https://github.com/wheremyfoodat/Panda3DS/actions/runs/6614729350/job/17965319784)

Expected behavior

Runner clang should probably be able to compile this

Actual behavior

Some (not all) ubuntu-latest runners fail to compile C++ files that do #include <chrono>

Repro steps

  1. Have any C++ code that does #include <chrono>, such as the Panda3DS repo above (without updating the compiler like it does now)
  2. Set up some ubuntu-latest actions for it.
  3. Specific runners should fail with the error message listed in the "Description" field

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions