ci+fix: link the exported UCRT time symbols; gdb over copier_test too

- localtime_s/gmtime_s are MinGW header inlines, not symbols — link
  _localtime64_s/_gmtime64_s
- copier_test also segfaults only on the Linux runner; add it to the
  on-failure gdb backtrace
This commit is contained in:
2026-08-21 09:51:22 +08:00
parent 7fb9c92931
commit b5a2ea7697
2 changed files with 7 additions and 5 deletions
+1 -1
View File
@@ -212,7 +212,7 @@ jobs:
if: failure()
run: |
sudo apt-get install -y gdb
for name in node_e2e_test suites_test; do
for name in node_e2e_test suites_test copier_test; do
BIN=$(ls -t target/debug/deps/$name-* | grep -v '\.d$' | head -1)
[ -n "$BIN" ] || continue
xvfb-run -a gdb -batch -ex run -ex bt -- "$BIN" --nocapture || true
+6 -4
View File
@@ -76,8 +76,10 @@ extern "C" {
}
#[cfg(target_os = "windows")]
extern "C" {
fn localtime_s(result: *mut Tm, timep: *const i64) -> i32;
fn gmtime_s(result: *mut Tm, timep: *const i64) -> i32;
// UCRT exports the 64-bit-time variants; `localtime_s`/`gmtime_s` are
// header inlines on MinGW, not linkable symbols.
fn _localtime64_s(result: *mut Tm, timep: *const i64) -> i32;
fn _gmtime64_s(result: *mut Tm, timep: *const i64) -> i32;
}
/// Expand Qt date/time format tokens (`QDateTime::toString` syntax):
@@ -306,9 +308,9 @@ impl NodeBehavior for TimeFormatNode {
unsafe {
let secs64 = secs as i64;
if to_bool(&local_val) {
localtime_s(&mut tm, &secs64);
_localtime64_s(&mut tm, &secs64);
} else {
gmtime_s(&mut tm, &secs64);
_gmtime64_s(&mut tm, &secs64);
}
}