From 652f6f71eb2f0e09849cf416b4d33cb1078846eb Mon Sep 17 00:00:00 2001 From: James Farrell Date: Mon, 1 Apr 2024 16:56:43 +0000 Subject: [PATCH 1/2] Pass RUST_BACKTRACE when running docker. --- src/ci/docker/run.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/src/ci/docker/run.sh b/src/ci/docker/run.sh index 740eb7504f8..9d72fd8a55a 100755 --- a/src/ci/docker/run.sh +++ b/src/ci/docker/run.sh @@ -323,6 +323,7 @@ docker \ --env GITHUB_ACTIONS \ --env GITHUB_REF \ --env GITHUB_STEP_SUMMARY="/checkout/obj/${SUMMARY_FILE}" \ + --env RUST_BACKTRACE \ --env TOOLSTATE_REPO_ACCESS_TOKEN \ --env TOOLSTATE_REPO \ --env TOOLSTATE_PUBLISH \ From ca36fe310e8970a66461ff7fc8496a76c75b70ed Mon Sep 17 00:00:00 2001 From: David Carlier Date: Mon, 1 Apr 2024 14:28:37 +0100 Subject: [PATCH 2/2] std::thread: set_name change for solaris/illumos. truncate down to 32 (31 + 1) for solaris/illumos. --- library/std/src/sys/pal/unix/thread.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/library/std/src/sys/pal/unix/thread.rs b/library/std/src/sys/pal/unix/thread.rs index 77e31d802a3..5ac68050b95 100644 --- a/library/std/src/sys/pal/unix/thread.rs +++ b/library/std/src/sys/pal/unix/thread.rs @@ -182,8 +182,11 @@ fn pthread_setname_np( if let Some(f) = pthread_setname_np.get() { #[cfg(target_os = "nto")] - let name = truncate_cstr::<{ libc::_NTO_THREAD_NAME_MAX as usize }>(name); + const THREAD_NAME_MAX: usize = libc::_NTO_THREAD_NAME_MAX as usize; + #[cfg(any(target_os = "solaris", target_os = "illumos"))] + const THREAD_NAME_MAX: usize = 32; + let name = truncate_cstr::<{ THREAD_NAME_MAX }>(name); let res = unsafe { f(libc::pthread_self(), name.as_ptr()) }; debug_assert_eq!(res, 0); } @@ -360,6 +363,8 @@ fn drop(&mut self) { target_os = "tvos", target_os = "watchos", target_os = "nto", + target_os = "solaris", + target_os = "illumos", ))] fn truncate_cstr(cstr: &CStr) -> [libc::c_char; MAX_WITH_NUL] { let mut result = [0; MAX_WITH_NUL];