Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

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

Closed
2 of 10 tasks
wheremyfoodat opened this issue Oct 25, 2023 · 37 comments · Fixed by microsoft/snmalloc#645
Closed
2 of 10 tasks

Comments

@wheremyfoodat
Copy link

wheremyfoodat commented Oct 25, 2023

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
@saran-t
Copy link

saran-t commented Oct 25, 2023

Also being hit by this: https://github.com/google-deepmind/mujoco_mpc/actions/runs/6644237828/job/18052982016

I think this is only affecting C++20 builds.

@wheremyfoodat
Copy link
Author

Oh yeah, it does only affect C++20 builds, the STL headers shouldn't touch consteval and friends if building for an earlier standard version.

@Ozaq
Copy link

Ozaq commented Oct 26, 2023

Same issue for us :/ https://github.com/PedestrianDynamics/jupedsim/actions/runs/6645042045/job/18055479382

I noticed that after the image upgrade clang-15 is available but not the default clang, is this related?

Also gradual rollout fine and dandy but how am I supposed to select a newly added clang version if it is random if I get an old or new image? Should I just apt install to ensure that there is a clang-15? And why are you doing the same for the ubuntu-22.04 image? Now I have no save version to fall back on...

Ozaq added a commit to Ozaq/jupedsim that referenced this issue Oct 26, 2023
Ozaq added a commit to Ozaq/jupedsim that referenced this issue Oct 26, 2023
Ozaq added a commit to Ozaq/jupedsim that referenced this issue Oct 26, 2023
Ozaq added a commit to Ozaq/jupedsim that referenced this issue Oct 26, 2023
@wheremyfoodat
Copy link
Author

Same issue for us :/ https://github.com/PedestrianDynamics/jupedsim/actions/runs/6645042045/job/18055479382

I noticed that after the image upgrade clang-15 is available but not the default clang, is this related?

Also gradual rollout fine and dandy but how am I supposed to select a newly added clang version if it is random if I get an old or new image? Should I just apt install to ensure that there is a clang-15? And why are you doing the same for the ubuntu-22.04 image? Now I have no save version to fall back on...

You can use the LLVM Ubuntu repository as a workaround until this is fixed. You can make it install clang-17 like here: https://github.com/wheremyfoodat/Panda3DS/blob/master/.github/workflows/Linux_Build.yml

Note that the clang command will still invoke the default clang 14, you need to use clang-17 everywhere as well.

Ozaq added a commit to Ozaq/jupedsim that referenced this issue Oct 26, 2023
Ozaq added a commit to PedestrianDynamics/jupedsim that referenced this issue Oct 26, 2023
@ilia-shipitsin
Copy link
Contributor

thank you for the report. we'll have a look

@vkottler
Copy link

vkottler commented Oct 26, 2023

Maybe an anecdote, but one solution I tried (that didn't work, but seems like it should) was:

Having clang-15 / clang++-15 use --gcc-toolchain=$(dirname $(gcc-12 -print-libgcc-file-name)), but even after that + adding a number of extra hard-coded -I / -L arguments, I couldn't get figure out /usr/bin/ld: cannot find crtbeginS.o: No such file or directory (during final linking, when all other includes and library arguments were located fine and crtbeginS.o and other startup objects are in the "toolchain"
directory).

Setting LD_LIBRARY_PATH to also point at the toolchain directory didn't seem to do anything (nor LIBRARY_PATH).

It seems that --gcc-toolchain= doesn't work out of the box with these Debian toolchain builds or something.

Anyway, since GCC 12 + 13 and clang 15 can currently be installed, pairing GCC 12 with clang 15 seems like an escape hatch but I wasn't personally able to get it working.

edit: this comment's suggestion to use clang 17 seems promising as an alternative

@jviotti
Copy link

jviotti commented Oct 26, 2023

Same issue here on C++20: https://github.com/sourcemeta/jsontoolkit/actions/runs/6646548576/job/18060229938. Interestingly enough, the problem is not always reproducible. Retrying the same job a couple times makes it go away.

erenon added a commit to erenon/ms-binlog that referenced this issue Feb 6, 2024
erenon added a commit to erenon/ms-binlog that referenced this issue Feb 6, 2024
erenon added a commit to erenon/ms-binlog that referenced this issue Feb 6, 2024
@Ozaq
Copy link

Ozaq commented Feb 14, 2024

Microsoft / Github seems to not care. Bad optics.

@wheremyfoodat
Copy link
Author

The real treasure is the friends we made along the way while waiting 3 months for a fix

@jviotti
Copy link

jviotti commented Feb 14, 2024

The real treasure is the friends we made along the way while waiting 3 months for a fix

Haha happy C++ coding everybody! We'll stand together even in the face of broken CI 😅 GitHub is us after all.

kklobe added a commit to dosbox-staging/dosbox-staging that referenced this issue Feb 16, 2024
kklobe added a commit to dosbox-staging/dosbox-staging that referenced this issue Feb 16, 2024
kklobe added a commit to dosbox-staging/dosbox-staging that referenced this issue Feb 17, 2024
KitsuneRal pushed a commit to quotient-im/libQuotient that referenced this issue Feb 17, 2024
kklobe added a commit to dosbox-staging/dosbox-staging that referenced this issue Feb 17, 2024
KitsuneRal pushed a commit to quotient-im/libQuotient that referenced this issue Feb 17, 2024
KitsuneRal added a commit to quotient-im/Quaternion that referenced this issue Feb 18, 2024
kklobe added a commit to dosbox-staging/dosbox-staging that referenced this issue Feb 18, 2024
kklobe added a commit to dosbox-staging/dosbox-staging that referenced this issue Feb 18, 2024
kklobe added a commit to dosbox-staging/dosbox-staging that referenced this issue Feb 18, 2024
kklobe added a commit to dosbox-staging/dosbox-staging that referenced this issue Feb 18, 2024
erenon added a commit to erenon/ms-binlog that referenced this issue Feb 22, 2024
Due to bug[0], on ubuntu, clang cannot #include <chrono>
with -std=c++20. Switch it to c++17, compile with c++20 on macOS.

Alternative solution: install latest clang on ubuntu,
but that takes much more time to run.

[0]: actions/runner-images#8659
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Feb 25, 2024
Version 3.3.0, 2024-02-20
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

* Fix a potential denial of service caused by accepting arbitrary
  length primes as potential elliptic curve parameters in ASN.1
  encodings. With very large inputs the primality verification
  can become computationally expensive. Now any prime field larger
  than 1024 bits is rejected immediately. Reported by Bing Shi.
  (GH #3913)

* Add FrodoKEM post-quantum KEM (GH #3679 #3807 #3892)

* Add support for Blake2s (GH #3796)

* Add support for RFC 7250 in TLS 1.3 to allow authenticating peers
  using raw public keys (GH #3771)

* Update the BSI TLS policy to match the latest TR, particularly
  enabling support for TLS 1.3 (GH #3809)

* Add AsymmetricKey::generate_another() to generate a new key of the
  same type and parameters as an existing key (GH #3770 #3786)

* Add Private_Key::remaining_operations() that indicates the number of
  remaining signatures for stateful hash-based signatures (GH #3821)

* Add implementation of EC_PrivateKey::check_key() (GH #3782 #3804)

* Add hardware acceleration for SHA-512 on ARMv8 (GH #3860 #3864)

* X.509 certificates that contain Authority Information Access (AIA)
  extensions can now be encoded (GH #3784)

* Various functions defined in ``mem_ops.h`` are now deprecated
  for public use (GH #3759 #3752 #3757)

* The ASIO TLS stream can now be used with C++20 coroutines (GH #3764)

* New public header asio_compat.h to check compatibility of the ASIO
  TLS stream with the available boost version (1.73.0+) (GH #3765)

* Flatten input buffer sequences in the ASIO TLS stream to avoid
  creating unnecessarily small TLS records (GH #3839)

* Hard-rename the potentially harmful build configuration flag
  --terminate-on-asserts to --unsafe-terminate-on-asserts (GH #3755)

* Use modern SQLite3 APIs with integer width annotations from SQLite3 3.37
  (GH #3788 #3793)

* Generate and install a CMake package config file (botan-config.cmake)
  (GH #3722 #3827 #3830 #3825)

* Add TLS::Channel::is_handshake_complete() predicate method (GH #3762)

* Add support for setting thread names on Haiku OS and DragonflyBSD
  (GH #3758 #3785)

* Use /Zc:throwingNew with MSVC (GH #3858)

* Work around a warning in GCC 13 (GH #3852)

* Add a CLI utility for testing RSA side channels using the MARVIN
  toolkit (GH #3749)

* CLI utility 'tls_http_server' is now based on Boost Beast
  (GH #3763 #3791)

* CLI utility 'tls_client_hello' can detect and handle TLS 1.3 messages
  (GH #3820)

* Add a detailed migration guide for users of OpenSSL 1.1 (GH #3815)

* Various updates to the documentation and code examples
  (GH #3777 #3805 #3802 #3794 #3815 #3823 #3828 #3842 #3841 #3849 #3745)

* Fixes and improvements to the build experience using ``ninja``
  (GH #3751 #3750 #3769 #3798 #3848)

* Fix handling of cofactors when performing scalar blinding in EC (GH #3803)

* Fix potential timing side channels in Kyber (GH #3846 #3874)

* Fix a potential dangling reference resulting in a crash in the OCB
  mode of operation (GH #3814)

* Fix validity checks in the construction of the ASIO TLS stream
  (GH #3766)

* Fix error code handling in ASIO TLS stream (GH #3795 #3801 #3773)

* Fix a TLS 1.3 assertion failure that would trigger if the
  application callback returned an empty certificate chain. (GH #3754)

* Fix a RFC 7919 conformance bug introduced in 3.2.0, where the TLS
  server would fail to reject a client hello that advertised (only)
  FFDHE groups that are not known to us. (GH #3743 #3742 #3729)

* Fix that modifications made in TLS::Callbacks::tls_modify_extensions()
  for the TLS 1.3 Certificate message were not being applied. (GH #3792)

* Fix string mapping of the PKCS#11 mechanism RSA signing mechanism that
  use SHA-384 (GH #3868)

* Fix a build issue on NetBSD (GH #3767)

* Fix the configure.py to avoid recursing out of our source tree (GH #3748)

* Fix various clang-tidy warnings (GH #3822)

* Fix CLI tests on windows and enable them in CI (GH #3845)

* Use ``BufferStuffer`` and ``concat`` helpers in public key code
  (GH #3756 #3753)

* Add a nightly test to ensure hybrid TLS 1.3 PQ/T compatibility with
  external implementations (GH #3740)

* Internal memory operation helpers are now memory container agnostic
  using C++20 ranges (GH #3715 #3707)

* Public and internal headers are now clearly separated in the build
  directory. That restricts the examples build target to public headers.
  (GH #3880)

* House keeping for better code formatting with clang-format
  (GH #3862 #3865)

* Build documentation in CI and fail on warnings or errors (GH #3838)

* Work around a GitHub Actions CI issue (actions/runner-images#8659)
  (GH #3783 #3833 #3888)
anadrome added a commit to NelsonAU/mctslib that referenced this issue Mar 1, 2024
@actions actions locked and limited conversation to collaborators Mar 4, 2024
@mikhailkoliada mikhailkoliada converted this issue into discussion #9446 Mar 4, 2024
patricia-gallardo added a commit to mod-cpp/ms-pacman that referenced this issue Mar 19, 2024
patricia-gallardo added a commit to mod-cpp/ms-pacman that referenced this issue Mar 19, 2024
patricia-gallardo added a commit to mod-cpp/ms-pacman that referenced this issue Mar 19, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

Successfully merging a pull request may close this issue.