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:
@@ -212,7 +212,7 @@ jobs:
|
|||||||
if: failure()
|
if: failure()
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get install -y gdb
|
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)
|
BIN=$(ls -t target/debug/deps/$name-* | grep -v '\.d$' | head -1)
|
||||||
[ -n "$BIN" ] || continue
|
[ -n "$BIN" ] || continue
|
||||||
xvfb-run -a gdb -batch -ex run -ex bt -- "$BIN" --nocapture || true
|
xvfb-run -a gdb -batch -ex run -ex bt -- "$BIN" --nocapture || true
|
||||||
|
|||||||
@@ -76,8 +76,10 @@ extern "C" {
|
|||||||
}
|
}
|
||||||
#[cfg(target_os = "windows")]
|
#[cfg(target_os = "windows")]
|
||||||
extern "C" {
|
extern "C" {
|
||||||
fn localtime_s(result: *mut Tm, timep: *const i64) -> i32;
|
// UCRT exports the 64-bit-time variants; `localtime_s`/`gmtime_s` are
|
||||||
fn gmtime_s(result: *mut Tm, timep: *const i64) -> i32;
|
// 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):
|
/// Expand Qt date/time format tokens (`QDateTime::toString` syntax):
|
||||||
@@ -306,9 +308,9 @@ impl NodeBehavior for TimeFormatNode {
|
|||||||
unsafe {
|
unsafe {
|
||||||
let secs64 = secs as i64;
|
let secs64 = secs as i64;
|
||||||
if to_bool(&local_val) {
|
if to_bool(&local_val) {
|
||||||
localtime_s(&mut tm, &secs64);
|
_localtime64_s(&mut tm, &secs64);
|
||||||
} else {
|
} else {
|
||||||
gmtime_s(&mut tm, &secs64);
|
_gmtime64_s(&mut tm, &secs64);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user