From 5c498583cc0107778ef2d217ecccc2fb5343f253 Mon Sep 17 00:00:00 2001 From: Bryn Lloyd Date: Wed, 16 Apr 2025 14:13:23 +0200 Subject: [PATCH] fix: upgrade 20.04 runners to 22.04 (fix for ICC, NVHPC) (#5621) * Upgrade the deprecated 20.04 runners to 22.04 (ICC, NVHPC) * fix ICC compile error --------- Co-authored-by: Bryn Lloyd <12702862+dyollb@users.noreply.github.com> --- .github/workflows/ci.yml | 4 ++-- include/pybind11/chrono.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d9308decb..79dd6390e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -432,7 +432,7 @@ jobs: # Testing on Ubuntu + NVHPC (previous PGI) compilers, which seems to require more workarounds ubuntu-nvhpc7: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 name: "🐍 3 • NVHPC 23.5 • C++17 • x64" env: @@ -550,7 +550,7 @@ jobs: # Testing on ICC using the oneAPI apt repo icc: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 name: "🐍 3 • ICC latest • x64" diff --git a/include/pybind11/chrono.h b/include/pybind11/chrono.h index 167ea0e3d..69e59b4d6 100644 --- a/include/pybind11/chrono.h +++ b/include/pybind11/chrono.h @@ -185,7 +185,7 @@ public: using us_t = duration; auto us = duration_cast(src.time_since_epoch() % seconds(1)); if (us.count() < 0) { - us += seconds(1); + us += duration_cast(seconds(1)); } // Subtract microseconds BEFORE `system_clock::to_time_t`, because: